Skip to content

Instantly share code, notes, and snippets.

@matthewdfuller
Created May 7, 2014 18:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matthewdfuller/69f990f58f1e0850443e to your computer and use it in GitHub Desktop.
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
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