Skip to content

Instantly share code, notes, and snippets.

@elyager
Created May 2, 2019 02:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elyager/f6040ac1be651e631c67ddfe773ff819 to your computer and use it in GitHub Desktop.
Save elyager/f6040ac1be651e631c67ddfe773ff819 to your computer and use it in GitHub Desktop.
Set emojis in the URL address
const emojis = [
'πŸ‘¨πŸ»β€πŸ’»',
'🀯',
'πŸ€“',
'😎',
'πŸ€™πŸΌ',
'πŸ¦„',
'⚑️',
'✨',
'πŸ₯‘',
'🍣',
'πŸ“±',
'βš›οΈ',
'πŸ‡²πŸ‡½',
]
function getRandomInt(min, max) {
min = parseInt(min)
max = parseInt(max)
return Math.floor(Math.random() * (max - min + 1)) + min
}
function setEmojiInURL() {
let position = getRandomInt(0, emojis.length - 1)
console.log(position)
location.hash = emojis[position]
setInterval(setEmojiInURL, 10000)
}
setEmojiInURL()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment