FuruholmAnton
4/15/2018 - 10:58 AM

Zenmode.js

;(function() {
  var lastKey;
  var timeout;
  document.addEventListener('keydown', function(e) {
    if (lastKey == 18 && e.keyCode == 90) {
      document.body.classList.toggle('furu-zenmode');
      lastKey = '';
      clearTimeout(timeout);
    } else {
      lastKey = e.keyCode;
      timeout = setTimeout(function(e) {
        lastKey = '';
        console.log('reset')
      }, 1000);
    }
  });
})();