Team:Freiburg/Templates/html/js.html

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
-
<svg xmlns="http://www.w3.org/1999/xhtml"
 
-
      xmlns:svg="http://www.w3.org/2000/svg" style="height:0;>
 
-
    <filter id="invertfilter">
 
-
      <feColorMatrix values="-1      0      0      0 1
 
-
                              0    -1      0      0 1
 
-
                              0      0    -1      0 1
 
-
                              0      0      0      1 0" style="color-interpolation-filters:sRGB"/>
 
-
    </filter>
 
-
  </svg>
 
<button class="invertbutton" onclick="invertColors();">Inv.</button>
<button class="invertbutton" onclick="invertColors();">Inv.</button>
<script>
<script>
-
var inverted = false;
+
function invertColors() {
-
    function invertColors() {
+
       var $html = $('html');
       var $html = $('html');
       $html.toggleClass('inverted-colors');
       $html.toggleClass('inverted-colors');
-
      var $uninvert = $html.find('.content img, .slideshow,.invertbutton');
 
-
      inverted = !inverted;
 
-
      if (inverted) {
 
-
        $html.css('filter', 'url(#invertfilter)');
 
-
        $uninvert.css('filter', 'url(#invertfilter)');
 
-
      } else {
 
-
        $html.css('filter', 'none');
 
-
        $uninvert.css('filter', 'none');
 
-
      }
 
     };
     };
(function(){
(function(){

Revision as of 20:02, 14 October 2014