Widget:TreasureCardFilter

From Unforgotten Realms Wiki
Revision as of 15:16, 6 June 2015 by imported>Plornt (Adding gem variables to cards)
Jump to navigationJump to search

<script>

   window.addEventListener("load", function () { 
      var FILTER_INITIALIZED = false;
      var FILTERS = [];
      var $GEMS = $("[data-filter-binding]");
      $GEMS.bind("click", function (ev) {
           if (FILTER_INITIALIZED == false) {
                FILTER_INITIALIZED = true;
                $GEMS.each(function () { 
                    $(this).addClass("gem-deselected");
                });
           }
          
           ev.preventDefault();
           $(this).toggleClass("gem-deselected");
 
       });
   });

</script> <style> .gem-deselected { -webkit-filter: grayscale(100%); filter: grayscale(100%); filter: gray; filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale"); } </style>

Filters
Cost: Coin