Created
May 7, 2014 18:31
-
-
Save matthewdfuller/69f990f58f1e0850443e to your computer and use it in GitHub Desktop.
Demonstrate what a loss of net neutrality could mean for users by adding this simple script to your website
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 SPEED = 40; | |
var TEXT = 'Site loading slowly? Without net neutrality, this could become the norm. Learn more at <a href="http://www.theopeninter.net/">theopeninter.net/</a>.' | |
var overlay = document.createElement('div'); | |
overlay.innerHTML = '<p>' + TEXT + '</p>'; | |
var docHeight = document.body.scrollHeight; | |
overlay.style.display = 'block'; | |
overlay.style.position = "fixed"; | |
overlay.style.left = "0px"; | |
overlay.style.bottom = "0px"; | |
overlay.style.zIndex = "100"; | |
overlay.style.backgroundColor = 'white'; | |
overlay.style.width="100%"; | |
overlay.style.height = docHeight + "px"; | |
overlay.style.textAlign = "center"; | |
overlay.style.padding = "30px"; | |
overlay.style.fontFamily = "sans-serif"; | |
document.body.appendChild(overlay); | |
var newHeight = docHeight; | |
var interval = window.setInterval(function(){ | |
newHeight = newHeight - 5; | |
overlay.style.height = newHeight + "px"; | |
overlay.style.bottom = "0px"; | |
if (newHeight < 1) { | |
clearInterval(interval); | |
} | |
}, SPEED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment