Skip to content

Instantly share code, notes, and snippets.

@indutny
Last active June 1, 2018 18:51
Show Gist options
  • Save indutny/9263351cb7ea1c6abaf1caf03d6566cd to your computer and use it in GitHub Desktop.
Save indutny/9263351cb7ea1c6abaf1caf03d6566cd to your computer and use it in GitHub Desktop.
!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