Skip to content

Instantly share code, notes, and snippets.

@AndersDamgaard
Forked from pachacamac/IdleBlur.js
Last active March 10, 2016 08:57
Show Gist options
  • Save AndersDamgaard/d610c065ee3a03e4aabd to your computer and use it in GitHub Desktop.
Save AndersDamgaard/d610c065ee3a03e4aabd to your computer and use it in GitHub Desktop.
javascript:(function(){
var delay=60000, delay2=1000, intensity=0.0, timer, timer2, i=0;
function reset(){document.documentElement.setAttribute('style',''); clearTimeout(timer); clearTimeout(timer2); intensity = 0.0; i = 0; timer = setTimeout(blur, delay);}
function blur(){
if(intensity<6){
intensity+=0.5;
applyBlur(intensity);
timer2 = setTimeout(blur, delay2);
}
}
function applyBlur(intens){document.documentElement.setAttribute('style', 'filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'blur\'><feGaussianBlur stdDeviation=\''+intens+'\' /></filter></svg>#blur");-webkit-filter:blur('+intens+'px);filter:blur('+intens+'px);');}
['mousemove', 'keydown', 'mousedown', 'scroll'].forEach(function(e){document.addEventListener(e, reset, false);});
reset();
})();void(0);
@sbrl
Copy link

sbrl commented Feb 24, 2015

Does anyone have a version of this that I could drag to my bookmarks bar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment