Last active
May 8, 2020 19:58
-
-
Save dillonchr/c4a82d7f9314518eab955a33e40d388a to your computer and use it in GitHub Desktop.
randomly reload your window
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
setInterval(() => { | |
const here = Math.random() * 100; | |
if (85 < here && here < 90) { | |
return window.location.reload(); | |
} | |
const rando = () => ~~(Math.random() * 255); | |
const [r, g, b] = Array(3).fill('').map(rando); | |
const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; | |
const color = [r, g, b].reduce((s, n) => s + n.toString(16), '#'); | |
const textColor = 128 < yiq ? 'black' : 'white'; | |
console.log('%cnaw, waiting ', `background-color: ${color}; color: ${textColor};`); | |
}, 1030); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment