Skip to content

Instantly share code, notes, and snippets.

@idiotWu
Last active November 28, 2018 12:45
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 idiotWu/b263dfc220b68160cfeb868465f4d1d5 to your computer and use it in GitHub Desktop.
Save idiotWu/b263dfc220b68160cfeb868465f4d1d5 to your computer and use it in GitHub Desktop.
nyan your reports
// ==UserScript==
// @name Nyanaba
// @namespace https://manaba.kic.kagoshima-u.ac.jp
// @version 0.1
// @description nyan your reports
// @author Dolphin Wood
// @match https://manaba.kic.kagoshima-u.ac.jp/ct/home
// @noframes
// ==/UserScript==
// if any...
const customImage = '';
const zoom = 2.0;
const extraBallons = 20;
const animationDuration = 2000;
const nyans = [
'nyan.gif',
'grumpy.gif',
'nyancoin.gif',
'GB.gif',
'technyancolor.gif',
'jazz.gif',
'mexinyan.gif',
'jacksnyan.gif',
'nyaninja.gif',
'pirate.gif',
'elevator.gif',
'pikanyan.gif',
'zombie.gif',
'mummy.gif',
'pumpkin.gif',
'glitch.gif',
'rasta.gif',
'uhmurica.gif',
'retro.gif',
'vday.gif',
'sadnyan.gif',
'tacnayn.gif',
'dub.gif',
'slomo.gif',
'xmas.gif',
'newyear.gif',
'tacodog.gif',
'easter.gif',
'bday.gif',
'daft.gif',
'paddy.gif',
'breakfast.gif',
'melonbird.gif',
'starsheep.gif',
'balloon.gif',
]
.concat(new Array(extraBallons).fill('balloon.gif'))
.map(s => `http://www.nyan.cat/images/thumbs/${s}`);
[...document.querySelectorAll('img[src="/icon-coursedeadline-on.png"]')].forEach((elem) => {
elem.src = customImage || nyans[Math.random() * nyans.length | 0];
elem.className = 'nyan';
elem.style.animationDelay = `-${Math.random() * 1000 | 0}ms`;
});
const style = document.createElement('style');
document.head.appendChild(style);
style.textContent = `
@keyframes nyan {
0% {
transform: translateX(-150%) scale(${zoom});
}
49.9% {
transform: translateX(350%) scale(${zoom});
}
50% {
transform: translateX(350%) rotateY(180deg) scale(${zoom});
}
99.9% {
transform: translateX(-150%) rotateY(180deg) scale(${zoom});
}
100% {
transform: translateX(-150%) scale(${zoom});
}
}
.nyan {
width: 16px;
animation: nyan linear ${animationDuration}ms infinite;
transform: scale(${zoom});
}
.nyan:hover {
animation-play-state: paused;
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment