Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ultra-retro
( () => {
const expect = [ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65 ];
const pressed = [];
document.addEventListener( 'keyup', e => {
pressed.push( e.keyCode );
for ( let i = 0; i < pressed.length; ++i ) {
if ( pressed[ i ] !== expect[ i ] ) {
pressed.length = 0;
break;
}
}
if ( pressed.length === expect.length ) {
const links = document.getElementsByTagName('link');
[ ...links ].forEach( el => {
if ( el.rel === 'stylesheet' ) {
el.parentElement.removeChild( el );
}
});
pressed.length = 0;
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.