Last active
June 1, 2018 18:51
-
-
Save indutny/9263351cb7ea1c6abaf1caf03d6566cd to your computer and use it in GitHub Desktop.
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
!function() { | |
// Don't forget to scroll all the way down to load all replies! | |
const elems = document.body.querySelectorAll( | |
'div.original-permalink-page ' + | |
'li.ThreadedConversation:not(.ThreadedConversation--selfThread),' + | |
'li.ThreadedConversation--loneTweet'); | |
for (const elem of elems) { | |
elem.style.border = '2px solid green'; | |
elem.style['transition'] = 'border 1s'; | |
} | |
const index = Math.floor(Math.random() * elems.length); | |
const styles = [ | |
'4px solid red', | |
'4px solid yellow', | |
]; | |
let iteration = 0; | |
function swap() { | |
elems[index].style.border = styles[iteration]; | |
iteration = (iteration + 1) % styles.length; | |
setTimeout(swap, 500); | |
} | |
swap(); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment