Skip to content

Instantly share code, notes, and snippets.

@RikerW
Created April 27, 2017 18:27
Show Gist options
  • Save RikerW/462920ece02f74bb1da1f789322c937e to your computer and use it in GitHub Desktop.
Save RikerW/462920ece02f74bb1da1f789322c937e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Moderator Flasher Userscript
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Alerts you if very scary and dangerous moderators are there
// @author The Hivemind of the TL
// @match http://chat.stackexchange.com/*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
var hex=["00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0"];
var r=1,
g=1,
b=1,
seq=1;
function change(){
if (seq==6){b--;if (b===0 ) seq=1;}
if (seq==5){r++;if (r==12 ) seq=6;}
if (seq==4){g--;if (g===0 ) seq=5;}
if (seq==3){b++;if (b===12) seq=4;}
if (seq==2){r--;if (r===0 ) seq=3;}
if (seq==1){g++;if (g===12) seq=2;}
for (var i of document.getElementsByClassName('moderator')) i.style.color="#"+hex[r]+hex[g]+hex[b];
}
var flash=setInterval(change,80);
GM_addStyle(`
@keyframes flash {
from {
opacity: 0.35;
}
to {
opacity: 1;
}
}
.moderator {
animation-duration: 0.5s;
animation-name: flash;
animation-iteration-count: infinite;
animation-direction: alternate;
font-family: "Comic Sans MS";
}
.moderator:before, .moderator:after {
content:" 🚨 "
}
`);
let awooga = new Audio('https://tjljs.yt-downloader.org/download.php?id=a7f91235211281b075f6bf3b2348df0f&v=07P0mXOjKBk');
awooga.addEventListener('ended', function() {
this.currentTime = 0;
this.play();
}, false);
awooga.play();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment