Skip to content

Instantly share code, notes, and snippets.

@magalhini
Last active August 29, 2015 14:26
Show Gist options
  • Save magalhini/cd7c3bd0a7bb4906ec0c to your computer and use it in GitHub Desktop.
Save magalhini/cd7c3bd0a7bb4906ec0c to your computer and use it in GitHub Desktop.
Flux in Browser
javascript:(function()%7B(function(doc)%20%7Bvar%20css%20%3D%20document.createElement('style')%3Bcss.appendChild(doc.createTextNode(''))%3Bdoc.head.appendChild(css)%3Bvar%20styles%20%3D%20%22body%3Abefore%20%7Bcontent%3A%20''%3B%20z-index%3A%20999%3B%20background%3A%20%23C1AE34%3B%20left%3A%200%3B%20right%3A%200%3B%20pointer-events%3A%20none%3B%20top%3A%200%3B%20bottom%3A%200%3B%20position%3A%20fixed%3B%20opacity%3A%20.4%3B%20width%3A%20100%25%3B%7D%22%3Bcss.sheet.insertRule(styles%2C%200)%3B%7D(document))%7D)()
/**
* Add a layer on top of the content to make the text easy on the eyes
* (simulates Flux)
*
* 0.0.1
*/
(function(doc) {
var css = document.createElement('style');
css.appendChild(doc.createTextNode(''));
doc.head.appendChild(css);
var styles = "body:before {content: ''; z-index: 999; background: #C1AE34; left: 0; right: 0; pointer-events: none; top: 0; bottom: 0; position: fixed; opacity: .4; width: 100%;} p {z-index: 9999;}";
css.sheet.insertRule(styles, 0);
}(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment