Skip to content

Instantly share code, notes, and snippets.

@myobie
Last active August 2, 2019 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myobie/82fc0a85361dc9b999d9b2d8138ccc35 to your computer and use it in GitHub Desktop.
Save myobie/82fc0a85361dc9b999d9b2d8138ccc35 to your computer and use it in GitHub Desktop.
How the color changing works on nathanherald.com
function sorter () { return 0.5 - Math.random() }
var styles = [ 'blaze', 'sunshine', 'dusk', 'blood', 'puce' ]
function colorize () {
var style = styles.sort(sorter)[0]
document.body.className = style
}
colorize()
setInterval(colorize, 10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment