Skip to content

Instantly share code, notes, and snippets.

@yeco
Created October 30, 2013 02:07
Show Gist options
  • Save yeco/7226129 to your computer and use it in GitHub Desktop.
Save yeco/7226129 to your computer and use it in GitHub Desktop.
Tapis.JS Bookmarklet
javascript: (function() {
var docBody = document.body,
pNode = docBody.parentNode,
node = docBody.cloneNode(true);
pNode.appendChild(node);
pNode.style.overflow = 'hidden';
styles = node.style;
styles.width = '100%';
styles.position = 'absolute';
styles.top = 0;
styles.opacity = 0.5;
styles.filter = 'alpha(opacity=50)';
setInterval(function() {
var top = styles.top,
left = styles.left,
newTop = top.substring(0, top.length - 2) * 1 + Math.ceil(Math.random() * 3) - 2,
newLeft = left.substring(0, left.length - 2) * 1 + Math.ceil(Math.random() * 3) - 2,
newTop = (newTop > 5) ? 4 : newTop,
newTop = (newTop < -5) ? -4 : newTop,
newLeft = (newLeft > 5) ? 4 : newLeft,
newLeft = (newLeft < -5) ? -4 : newLeft;
styles.top = newTop + 'px';
styles.left = newLeft + 'px';
}, 10);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment