Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
lampze committed May 20, 2017
0 parents commit 2d73d78
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小林</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="block">
<div class="font" id="font1">·</div>
<div class="font" id="font2">·</div>
<div class="font" id="font3">·</div>
<div class="font" id="font4">·</div>
<div class="font" id="font5">·</div>
</div>
<audio src="main.mp3" id="main-audio">

</audio>
<script src="main.js"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
html body {
margin: 0;
}
body{
background-color: #faf245;
}
.block {
font-size: 80px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: sans-serif;
}
.font {
text-align: center;
display: inline-block;
width: 80px;
}
37 changes: 37 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var font = Array("( ̄▽ ̄)", "(⌒▽⌒)", "(・∀・)", "( ̄3 ̄)", "(<_<)", "(>_>)", "( ̄へ ̄)", "´・ᆺ・`", "(˘ω˘)", "(ㅎ.ㅎ)", "(◉3◉)", "(=。=)", "(ーー゛)", "(⊙﹏⊙)", "(´Д`)", "○| ̄|_");
var audio = document.getElementById("main-audio");
function chang(arr) {
setTimeout(function() {
audio.play();
document.getElementById("font1").innerHTML=arr[0];
},400);
setTimeout(function() {
audio.play();
document.getElementById("font2").innerHTML=arr[1];
},800);
setTimeout(function() {
audio.play();
document.getElementById("font3").innerHTML=arr[2];
},1200);
setTimeout(function() {
audio.play();
document.getElementById("font4").innerHTML=arr[3];
},1600);
setTimeout(function() {
audio.play();
document.getElementById("font5").innerHTML=arr[4];
},2000);
setTimeout(function() {
document.getElementById("font1").innerHTML="·";
document.getElementById("font2").innerHTML="·";
document.getElementById("font3").innerHTML="·";
document.getElementById("font4").innerHTML="·";
document.getElementById("font5").innerHTML="·";
},3000);
}
function getRandom(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
setInterval(function () {
chang(font[getRandom(0, font.length)])
}, 4000);
Binary file added main.mp3
Binary file not shown.

0 comments on commit 2d73d78

Please sign in to comment.