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">
 +
    <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>
-
function invertColors() {
+
var inverted = false;
-
  $('html').toggleClass('inverted-colors');
+
    function invertColors() {
-
};
+
      var $html = $('html');
 +
      $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(){
   var DEBUG = false;
   var DEBUG = false;

Revision as of 19:22, 14 October 2014