Created
May 2, 2019 02:27
-
-
Save elyager/f6040ac1be651e631c67ddfe773ff819 to your computer and use it in GitHub Desktop.
Set emojis in the URL address
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 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