Skip to content

Instantly share code, notes, and snippets.

@manuelgu
Last active March 31, 2016 19:52
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 manuelgu/7fc8d63c257f26f068bd to your computer and use it in GitHub Desktop.
Save manuelgu/7fc8d63c257f26f068bd to your computer and use it in GitHub Desktop.
Highlight most recent messages in a youtube stream chat
// ==UserScript==
// @name Chat Announcer Thingy
// @namespace https://manuelgu.eu
// @version 1.0
// @description Try to take over the world!
// @author manuelgu
// @match https://www.youtube.com/live_chat*
// @grant none
// ==/UserScript==
// Do the magic
addGlobalStyle('.comment-text { -webkit-animation: seconds 1.0s forwards; -webkit-animation-iteration-count: 1; -webkit-animation-delay: 3s; animation: seconds 1.0s forwards; animation-iteration-count: 3; animation-delay: 1s; position: relative; background: #39FF14; padding: 30px 30px 30px 3px; } @-webkit-keyframes seconds { 0% { opacity: 1; } 20% { background-color: #F08080; } 40% { background-color: #39FF14; } 60% { background-color: #F08080; } 80% { background-color: #39FF14; } 100% { opacity: 1; background: white; } } @keyframes seconds { 0% { opacity: 1; } 20% { background-color: #F08080; } 40% { background-color: #39FF14; } 60% { background-color: #F08080; } 80% { background-color: #39FF14; } 100% { opacity: 1; background: white; } }');
// Edit Global CSS
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment