Last active
August 29, 2015 14:01
-
-
Save mhafalir/ee56107188f3731a9507 to your computer and use it in GitHub Desktop.
Blur Switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var blurit = blured == undefined || blured == false; | |
| var blured = blurit; | |
| if(blurInterval){ | |
| clearInterval(blurInterval); | |
| } | |
| function blurSwitch(){ | |
| var service = ''; | |
| var def = [ | |
| { host: 'mail.google.com', selectors: [{ selector: 'div.yW,div.xT,span.y2,div.av,div.aKs', hshadow: '0', vshadow: '0', blur: '12px', color: '#000000' }] }, | |
| { host: 'trello.com', selectors: [{ selector: '.list-card-title.clear,h3', hshadow: '0', vshadow: '0', blur: '12px', color: '#000000' }, { selector: '.board-list-item-name,.board-list-item-sub-name', hshadow: '0', vshadow: '0', blur: '12px', color: '#ffffff' }] }, | |
| { host: '*', selectors: [{ selector: 'h1,h2,h3,h4,h5,p,a,li,input,textarea,div,span', hshadow: '0', vshadow: '0', blur: '12px', color: '#999999' }] } | |
| ]; | |
| var host = window.location.host; | |
| for (var i = 0; i < def.length; i++) { | |
| var d = def[i]; | |
| if (d.host == host || d.host == '*') { | |
| var els; | |
| for (var j = 0; j < d.selectors.length; j++) { | |
| var s = d.selectors[j]; | |
| try { | |
| els = document.querySelectorAll(s.selector); | |
| for (k = 0; k < els.length; k++) { | |
| var e = els[k]; | |
| e.style.color = blurit ? "transparent" : ""; | |
| e.style.textShadow = blurit ? s.hshadow + " " + s.vshadow + " " + s.blur + " " + s.color : ""; | |
| } | |
| } catch (e) { | |
| console.log(e); | |
| } | |
| } | |
| break; | |
| } | |
| } void (0); | |
| } | |
| blurSwitch(); | |
| var blurInterval = setInterval(blurSwitch, 3000); | |
| void(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function blurSwitch(){var e="";var t=[{host:"mail.google.com",selectors:[{selector:"div.yW,div.xT,span.y2,div.av,div.aKs",hshadow:"0",vshadow:"0",blur:"12px",color:"#000000"}]},{host:"trello.com",selectors:[{selector:".list-card-title.clear,h3",hshadow:"0",vshadow:"0",blur:"12px",color:"#000000"},{selector:".board-list-item-name,.board-list-item-sub-name",hshadow:"0",vshadow:"0",blur:"12px",color:"#ffffff"}]},{host:"*",selectors:[{selector:"h1,h2,h3,h4,h5,p,a,li,input,textarea,div,span",hshadow:"0",vshadow:"0",blur:"12px",color:"#999999"}]}];var n=window.location.host;for(var r=0;r<t.length;r++){var i=t[r];if(i.host==n||i.host=="*"){var s;for(var o=0;o<i.selectors.length;o++){var u=i.selectors[o];try{s=document.querySelectorAll(u.selector);for(k=0;k<s.length;k++){var a=s[k];a.style.color=blurit?"transparent":"";a.style.textShadow=blurit?u.hshadow+" "+u.vshadow+" "+u.blur+" "+u.color:""}}catch(a){console.log(a)}}break}}void 0}var blurit=blured==undefined||blured==false;var blured=blurit;if(blurInterval){clearInterval(blurInterval)}blurSwitch();var blurInterval=setInterval(blurSwitch,3e3);void 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a href='javascript:function blurSwitch(){var e="";var t=[{host:"mail.google.com",selectors:[{selector:"div.yW,div.xT,span.y2,div.av,div.aKs",hshadow:"0",vshadow:"0",blur:"12px",color:"#000000"}]},{host:"trello.com",selectors:[{selector:".list-card-title.clear,h3",hshadow:"0",vshadow:"0",blur:"12px",color:"#000000"},{selector:".board-list-item-name,.board-list-item-sub-name",hshadow:"0",vshadow:"0",blur:"12px",color:"#ffffff"}]},{host:"*",selectors:[{selector:"h1,h2,h3,h4,h5,p,a,li,input,textarea,div,span",hshadow:"0",vshadow:"0",blur:"12px",color:"#999999"}]}];var n=window.location.host;for(var r=0;r<t.length;r++){var i=t[r];if(i.host==n||i.host=="*"){var s;for(var o=0;o<i.selectors.length;o++){var u=i.selectors[o];try{s=document.querySelectorAll(u.selector);for(k=0;k<s.length;k++){var a=s[k];a.style.color=blurit?"transparent":"";a.style.textShadow=blurit?u.hshadow+" "+u.vshadow+" "+u.blur+" "+u.color:""}}catch(a){console.log(a)}}break}}void 0}var blurit=blured==undefined||blured==false;var blured=blurit;if(blurInterval){clearInterval(blurInterval)}blurSwitch();var blurInterval=setInterval(blurSwitch,3e3);void 0'>Blur Switch</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment