Created
July 21, 2011 17:05
-
-
Save bltavares/1097639 to your computer and use it in GitHub Desktop.
Konami code for coderwall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://konami-js.googlecode.com/svn/trunk/konami.js"></script> | |
<script type="text/javascript"> | |
function increaseAvatar() { | |
$("#content").animate({width: 900 }, "slow"); | |
$("img.avatar").addClass("big").animate({width: 75, height: 75 }, "slow"); | |
} | |
function decreaseAvatar() { | |
$("#content").animate({ width: 800 }, "slow"); | |
$("img.avatar").removeClass("big").animate({ width: 65, height: 65 }, "slow"); | |
} | |
function shouldDecrease() { | |
return $("img.avatar.big").length > 0; | |
} | |
function adjustAvatar() { | |
shouldDecrease() ? decreaseAvatar() : increaseAvatar(); | |
} | |
konami = new Konami(); | |
konami.code = function () { | |
if (($signup = $("#signup")).length > 0) { | |
$signup.fadeToggle(adjustAvatar); | |
} | |
else { | |
adjustAvatar(); | |
} | |
} | |
konami.load(); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You can try it direct on the js console on your browser | |
$.getScript("http://konami-js.googlecode.com/svn/trunk/konami.js", function () { | |
function increaseAvatar() { | |
$("#content").animate({width: 900 }, "slow"); | |
$("img.avatar").addClass("big").animate({width: 75, height: 75 }, "slow"); | |
} | |
function decreaseAvatar() { | |
$("#content").animate({ width: 800 }, "slow"); | |
$("img.avatar").removeClass("big").animate({ width: 65, height: 65 }, "slow"); | |
} | |
function shouldDecrease() { | |
return $("img.avatar.big").length > 0; | |
} | |
function adjustAvatar() { | |
shouldDecrease() ? decreaseAvatar() : increaseAvatar(); | |
} | |
konami = new Konami(); | |
konami.code = function () { | |
if (($signup = $("#signup")).length > 0) { | |
$signup.fadeToggle(adjustAvatar); | |
} | |
else { | |
adjustAvatar(); | |
} | |
} | |
konami.load(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment