Skip to content

Instantly share code, notes, and snippets.

@jaredallard
Last active February 3, 2016 06:36
Show Gist options
  • Save jaredallard/06acc12e7a3d2f862ab7 to your computer and use it in GitHub Desktop.
Save jaredallard/06acc12e7a3d2f862ab7 to your computer and use it in GitHub Desktop.
Dank up Discord
// ==UserScript==
// @name Discord Dank-ified.
// @namespace https://discordapp.com/
// @version 1.3
// @description Make it dank memes
// @require http://code.jquery.com/jquery-latest.js
// @author Jared Allard <[email protected]>
// @match https://discordapp.com/channels/*
// @downloadURL https://gist.githack.com/jaredallard/06acc12e7a3d2f862ab7/raw/dankit.js
// @updateURL https://gist.githack.com/jaredallard/06acc12e7a3d2f862ab7/raw/dankit.js
// @grant none
// ==/UserScript=='
// I'm sorry, I tried to use ECMAScript 6 + Vanilla. But it became painful to not use jQuery wih the
// harsh enviroment of Discord.
var ci = document.getElementsByClassName('quote')[0];
var ci_parent = ci.parentNode;
// shove in some rotation
var sheet = window.document.styleSheets[0]
sheet.insertRule("@-webkit-keyframes rotate { \
from { -webkit-transform: rotate(0deg); } \
to { -webkit-transform: rotate(360deg); } \
}", sheet.cssRules.length);
// make this stuff roate. DO THE DRILLLLlllll
sheet.insertRule(".rotate \
{ \
-webkit-animation-name: rotate; \
-webkit-animation-duration: 0.27s; \
-webkit-animation-iteration-count: infinite; \
-webkit-animation-timing-function: linear; \
}", sheet.cssRules.length);
$('.connecting-inner video').hide();
console.log(ci_parent.childNodes);
// remove image after doge
function nodeInsertedCallback(event) {
if(event.relatedNode.className === 'connecting-inner') {
$('.connecting-inner img')[0].style='display:none;';
}
};
document.addEventListener('DOMNodeInserted', nodeInsertedCallback);
ci.innerText = 'ENSURING THE DANKEST OF MEMES'; // dank it.
// oh yea, ECMAScript 6 + vanilla JS
var img = document.createElement('img');
img.src = 'http://vignette1.wikia.nocookie.net/mugen/images/0/00/Doge-head.png/revision/latest?cb=20140518092211';
img.className = 'rotate';
img.style = 'margin-bottom:10px;height:130px;width:auto;z-index:10000;';
// insert the doge
ci_parent.insertBefore(img, ci);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment