Skip to content

Instantly share code, notes, and snippets.

@b1nary
Created June 24, 2015 08:35
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 b1nary/d99f59407c2b59d77313 to your computer and use it in GitHub Desktop.
Save b1nary/d99f59407c2b59d77313 to your computer and use it in GitHub Desktop.
Add some hidden games and jokes to your website
$(function(){
function rotate(degrees){
$('html').css({
'-webkit-transform':'rotate(-' + degrees + 'deg)',
'-moz-transform':'rotate(-' + degrees + 'deg)',
'-ms-transform':'rotate(-' + degrees + 'deg)',
'-o-transform':'rotate(-' + degrees + 'deg)',
'transform':'rotate(-' + degrees + 'deg)',
'-webkit-transition':'2s',
'-moz-transition':'2s',
'-ms-transition':'2s',
'-o-transition':'2s',
'transition':'2s',
'-webkit-transform-origin':'50% 50%',
'-moz-transform-origin':'50% 50%',
'-ms-transform-origin':'50% 50%',
'-o-transform-origin':'50% 50%',
'transform-origin':'50% 50%',
'-webkit-backface-visibility':'hidden'
});
}
// Konami
var kkeys = []
var konami = "38,38,40,40,37,39,37,39,66,65";
var bier = "66,73,69,82";
var beer = "66,69,69,82"
var fart = "70,65,82,84";
var kickass = "75,73,67,75,65,83,83"
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
$(document).unbind('keydown',arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js',function(){
cornify_add();
$(document).keydown(cornify_add);
});
kkeys = "";
}
else if(kkeys.toString().indexOf(bier) >= 0 || kkeys.toString().indexOf(beer) >= 0){
$("html").css('display','block')
.css('background','url(http://poemsforkush.files.wordpress.com/2012/04/beer.jpg)')
.css('background-size','cover')
.css('background-position','fixed');
var degrees = 0;
rotate(10);
$("html").mousemove(function(event) {
degrees += 0.1;
rotate(degrees);
});
kkeys = "";
}
else if(kkeys.toString().indexOf(fart) >= 0){
$.getScript("//code.onion.com/fartscroll.js", function(data, textStatus, jqxhr) {
fartscroll();
});
kkeys = "";
}
else if(kkeys.toString().indexOf(kickass) >= 0){
$.getScript("//hi.kickassapp.com/kickass.js");
kkeys = "";
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment