MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
Mostknown663 (talk | contribs) No edit summary Tag: Reverted |
Mostknown663 (talk | contribs) No edit summary Tag: Reverted |
||
| Line 181: | Line 181: | ||
(function() { | (function() { | ||
var | var typed = ''; | ||
document.addEventListener('keypress', function(e) { | |||
if (['INPUT','TEXTAREA'].includes(document.activeElement.tagName)) return; | |||
typed += e.key; if (typed.length > 4) typed = typed.slice(-4); | |||
if (typed.toLowerCase() !== 'nyan') return; | |||
typed = ''; | |||
var nyan = document.createElement('div'); | |||
nyan.textContent = '🌈🐱'; | |||
nyan.style.cssText = 'position:fixed;top:' + (20 + Math.random()*60) + 'vh;left:-100px;font-size:2em;' + | |||
'z-index:9999;pointer-events:none;transition:left 2s linear;'; | |||
document.body.appendChild(nyan); | |||
setTimeout(function() { nyan.style.left = '110vw'; }, 50); | |||
setTimeout(function() { nyan.remove(); }, 2200); | |||
}); | |||
})(); | })(); | ||