Created
November 29, 2011 10:38
-
-
Save pkqk/1404356 to your computer and use it in GitHub Desktop.
Uncompressed pridegrid.js
This file contains 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
//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%22px%22;grid.style.margin%20=%20%220%20auto%22;grid.style.height%20=%20window.screen.height%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,0,150);addColorStop(0,%20%27rgba(0,255,0,0.2)%27);addColorStop(0,%20%27rgba(0,255,100,0.8)%27);addColorStop(1,%20%27rgba(0,255,0,0.2)%27);ctx.fillStyle%20=%20grad;for%20(var%20x%20=%200;%20x%20*%2080%20<%20grid.width;%20x)%20{ctx.fillRect(10%20x%20*%2080,%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; | |
if (!window.goviasGrid) { | |
var grid = window.goviasGrid = document.createElement("canvas"); | |
var height = window.screen.height; | |
grid.width = 960; | |
grid.style.width = grid.width "px"; | |
grid.style.margin = "0 auto"; | |
grid.style.height = window.screen.height "px"; | |
grid.style.position = "fixed"; | |
grid.style.top = "0"; | |
grid.style.bottom = "0"; | |
grid.style.left = "0"; | |
grid.style.right = "0"; | |
grid.style.display = "none"; | |
grid.style.zIndex = "99999"; | |
grid.onclick = function(el) { | |
grid.style.display = "none"; | |
}; | |
var ctx = grid.getContext("2d"); | |
var grad = ctx.createLinearGradient(0,0,0,150); | |
addColorStop(0, 'rgba(0,255,0,0.2)'); | |
addColorStop(0, 'rgba(0,255,100,0.8)'); | |
addColorStop(1, 'rgba(0,255,0,0.2)'); | |
ctx.fillStyle = grad; | |
for (var x = 0; x * 80 < grid.width; x) { | |
ctx.fillRect(10 x * 80, 0, 60, height); | |
} | |
ctx.fillStyle = "rgba(200,200,200,0.5)"; | |
ctx.fillRect(0, 0, 10, height); | |
ctx.fillRect(950, 0, 10, height); | |
document.getElementsByTagName("body")[0].appendChild(grid); | |
} | |
if(window.goviasGrid.style.display=="none"){window.goviasGrid.style.display="block";}else{window.goviasGrid.style.display = "none";} | |
undefined; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment