Skip to content

Instantly share code, notes, and snippets.

@pkqk
Created August 3, 2011 13:37
Show Gist options
  • Save pkqk/1122647 to your computer and use it in GitHub Desktop.
Save pkqk/1122647 to your computer and use it in GitHub Desktop.
The Pride Grid
javascript:if%20(!window.goviasGrid)%20{var%20grid%20=%20window.goviasGrid%20=%20document.createElement(%22canvas%22);var%20height%20=%20window.screen.height;grid.width%20=%20960;grid.style.width%20=%20grid.width%20+%20%22px%22;grid.style.margin%20=%20%220%20auto%22;grid.style.height%20=%20height%20+%20%22px%22;grid.style.position%20=%20%22fixed%22;grid.style.top%20=%20%220%22;grid.style.bottom%20=%20%220%22;grid.style.left%20=%20%220%22;grid.style.right%20=%20%220%22;grid.style.display%20=%20%22none%22;grid.style.zIndex%20=%20%2299999%22;grid.onclick%20=%20function(el)%20{grid.style.display%20=%20%22none%22;};var%20ctx%20=%20grid.getContext(%222d%22);var%20grad%20=%20ctx.createLinearGradient(0,0,960,0);grad.addColorStop(0,%20%27rgba(255,0,0,0.3)%27);grad.addColorStop(0.2,%20%27rgba(255,165,0,0.3)%27);grad.addColorStop(0.4,%20%27rgba(255,255,0,0.3)%27);grad.addColorStop(0.6,%20%27rgba(0,128,0,0.3)%27);grad.addColorStop(0.8,%20%27rgba(0,0,255,0.3)%27);grad.addColorStop(1,%20%27rgba(128,0,128,0.3)%27);ctx.fillStyle%20=%20grad;for%20(var%20x=0;%20x*80%20<%20grid.width;%20++x)%20{ctx.fillRect(10+x*80,%200,%2060,%20height);}ctx.fillStyle%20=%20%22rgba(200,200,200,0.5)%22;ctx.fillRect(0,%200,%2010,%20height);ctx.fillRect(950,%200,%2010,%20height);document.getElementsByTagName(%22body%22)[0].appendChild(grid);}if(window.goviasGrid.style.display==%22none%22){window.goviasGrid.style.display=%22block%22;}else{window.goviasGrid.style.display%20=%20%22none%22;}undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment