Skip to content

Instantly share code, notes, and snippets.

@evan-goode
Created October 28, 2018 04:13
Show Gist options
  • Save evan-goode/5bf8867105d6519b08fedf93a64a0dc6 to your computer and use it in GitHub Desktop.
Save evan-goode/5bf8867105d6519b08fedf93a64a0dc6 to your computer and use it in GitHub Desktop.
TSA Randomizer
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);
});
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