Created
November 10, 2014 11:42
-
-
Save mayth/4ad0a7e56c89499d0405 to your computer and use it in GitHub Desktop.
あぁ^〜心がぴょんぴょんするんじゃぁ^〜(あぁ^〜Canvas使わずにぴょんぴょんするんじゃぁ^〜)
This file contains 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
#pyonpyon-container { | |
position: relative; | |
width: 100px; | |
height: 120px; | |
} | |
#kokoro { | |
position: absolute; | |
left: 0; | |
top: 0; | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>あぁ^〜心がぴょんぴょんするんじゃぁ^〜</title> | |
<script src="gochiusa2.js"></script> | |
<link rel="stylesheet" href="gochiusa2.css"> | |
</head> | |
<body> | |
<div id="pyonpyon-container"> | |
<div id="kokoro">心</div> | |
</div> | |
</body> | |
</html> |
This file contains 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
var kokoro, y; | |
document.addEventListener("DOMContentLoaded", function(event) { | |
kokoro = document.getElementById("kokoro"); | |
y = -9; | |
setInterval(function () { | |
++y; | |
kokoro.style.top = "" + y * y + "px"; | |
if (y == 9) { | |
y = -y; | |
} | |
}, 50); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment