Last active
October 19, 2018 14:34
-
-
Save ddrscott/a367b46dbda5ffb36d4f14c698375d4f to your computer and use it in GitHub Desktop.
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
| (function(){ | |
| function handleClick(e) { | |
| const r = Math.random(); | |
| if (r > 0.1) { | |
| console.log("not yet: ", r); | |
| return true; | |
| } | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| s = document.body.style; | |
| if (s.transform === "rotate(180deg)") { | |
| s.transform = ""; | |
| } else { | |
| s.transform = "rotate(180deg)"; | |
| console.log("flip! ", r); | |
| } | |
| return false; | |
| } | |
| document.querySelectorAll('a').forEach((a) => a.onclick = handleClick); | |
| document.body.style.transition = 'all .2s ease' | |
| })(); |
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
| { | |
| "manifest_version": 2, | |
| "name": "Flip", | |
| "description": "(╯°□°)╯︵ ┻━┻", | |
| "version": "0.1", | |
| "content_scripts": [ | |
| { | |
| "matches": [ | |
| "*://*/*" | |
| ], | |
| "js": [ | |
| "flip.js" | |
| ], | |
| "run_at": "document_end" | |
| } | |
| ] | |
| } |
Author
ddrscott
commented
Oct 19, 2018

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment