Skip to content

Instantly share code, notes, and snippets.

@bltavares
Created July 21, 2011 17:05
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 bltavares/1097639 to your computer and use it in GitHub Desktop.
Save bltavares/1097639 to your computer and use it in GitHub Desktop.
Konami code for coderwall
<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>
//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