Highlight most recent messages in a youtube stream chat
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
// ==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