Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
window.onload = function() {
const dvd = document.getElementById("access-counter");

function showCounter(num, length) {
const numstr = (num + '').padStart(length, '0');
var html = "";
numstr.split("").forEach(n => {
html += "<img src=\"img/e" + n + ".gif\">";
});
dvd.innerHTML = html;
}
Comment on lines +4 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innerHTMLこわいので、createElementしてattribute設定してappendする処理にした方がいいかも


const count = 4200; // TODO API TATAKU

showCounter(count, 8);

}
Binary file added img/e0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e5.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e6.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e7.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e8.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/e9.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
color: #d8eaf5;
}

div#access-counter {
margin-top: 1em;
text-align: center;
}
div#access-counter > img {
margin: 0;
padding: 0;
}

#particles-js {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -80,6 +89,9 @@
<body>
<h1>Serviver Agent</h1>
<div class="description">サバイバーエージェントはベンチャースピリットを持ったEitherT集団です</div>
<div id="access-counter">
<img src="img/e0.gif"><img src="img/e1.gif"><img src="img/e2.gif"><img src="img/e3.gif"><img src="img/e4.gif"><img src="img/e5.gif"><img src="img/e6.gif"><img src="img/e7.gif"><img src="img/e8.gif"><img src="img/e9.gif">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここを動的に追加したいので直接書かずにjsから追加したい!

</div>
<div id="particles-js"></div>
<div id="dvd-field"></div>
<svg xmlns="http://www.w3.org/2000/svg" id="dvd">
Expand All @@ -92,6 +104,7 @@ <h1>Serviver Agent</h1>
<script src="particles.js" defer></script>
<script src="set.js" defer></script>
<script src="clock.js" defer></script>
<script src="counter.js" defer></script>
</script>
</body>
</html>