A Pen by Evan Goode on CodePen.
Created
October 28, 2018 04:13
-
-
Save evan-goode/5bf8867105d6519b08fedf93a64a0dc6 to your computer and use it in GitHub Desktop.
TSA Randomizer
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
const arrows = { | |
right: 'https://upload.wikimedia.org/wikipedia/commons/1/12/Right_arrow.svg', | |
left: 'https://upload.wikimedia.org/wikipedia/commons/1/18/Left_arrow.svg' | |
} | |
let timeout; | |
document.addEventListener('click', () => { | |
document.body.style.backgroundImage = `url(${Math.round(Math.random()) ? arrows.left : arrows.right})`; | |
clearTimeout(timeout); | |
timeout = setTimeout(() => { | |
document.body.style.backgroundImage = ''; | |
}, 1024); | |
}); |
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
html, body { | |
height: 100%; | |
margin: 0; | |
} | |
body { | |
cursor: pointer; | |
background-repeat: no-repeat; | |
background-position: center center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment