<html lang="en-US">
<head>
<title>Loncat</title>
</head>
<body>
<div class="container">
<canvas id="canvas">
Aduh, browsermu enggak support HTML5!
</canvas>
<div id="mainMenu">
<h1>doodle jump</h1>
<h3>using HTML5,</h3>
<h3>...by <a href="http://twitter.com/solitarydesigns/" target="_blank">Angga and Kushagra Agarwal</a></h3>
<h3>and <a href="http://cssdeck.com" target="_blank">CSSDeck</a></h3>
<p class="info">
gunakan
<span class="key left">←</span>
<span class="key right">→</span>
untuk loncat ke kiri dan ke kanan
</p>
<a class="button" href="javascript:init()">Mainkan</a>
</div>
<div id="gameOverMenu">
<h1>Jatoh deh :(</h1>
<h3 id="go_score">Scoremu 0 points</h3>
<a class="button" href="javascript:reset()">Mulai lagi</a>
<a id="tweetBtn" target="_blank" class="button tweet" href="#">Tweet score</a>
<a id="fbBtn" target="_blank" class="button fb" href="#">Post on FB</a>
</div>
<!-- Preloading image ;) -->
<img id="sprite" src="http://i.imgur.com/2WEhF.png"/>
<div id="scoreBoard">
<p id="score">0</p>
</div>
</div>
</body>
</html>
@import url(http://fonts.googleapis.com/css?family=Gloria+Hallelujah);
@import url(http://fonts.googleapis.com/css?family=Gloria+Hallelujah);
*{box-sizing: border-box;}
body {
margin: 0; padding: 0;
font-family: 'cartoon', cursive;
}
.container {
height: 552px;
width: 422px;
position: relative;
margin: 20px auto 0;
overflow: hidden;
}
canvas {
height: 552px;
width: 422px;
display: block;
background: url(http://i.imgur.com/Y0BMP.png) top left;
}
#scoreBoard {
width: 420px;
height: 50px;
background: rgba(182, 200, 220, 0.7);
position: absolute;
top: -3px;
left: 0;
z-index: -1;
border-image: url(http://i.imgur.com/5BBsR.png) 100 5 round;
}
#scoreBoard p {
font-size: 20px;
padding: 0;
line-height: 47px;
margin: 0px 0 0 5px;
}
img {display: none}
#mainMenu, #gameOverMenu {
height: 100%;
width: 100%;
text-align: center;
position: absolute;
top: 0;
left: 0;
z-index: 2;
}
#gameOverMenu {
visibility: hidden;
}
h2, h3, h1 {font-weight: normal}
h1 {
font-size: 60px;
color: #5a5816;
transform: rotate(-10deg);
margin: 0px;
}
h3 {text-align: right; margin: -10px 20px 0 0; color: #5e96be}
h3 a {color: #5a5816}
.button {
width: 105px;
height: 31px;
background: url(http://i.imgur.com/2WEhF.png) 0 0 no-repeat;
display: block;
color: #000;
font-size: 12px;
line-height: 31px;
text-decoration: none;
position: absolute;
left: 50%;
bottom: 50px;
margin-left: -53px;
}
.button.tweet {bottom: 100px; background-position: 0 -90px}
.but