diff --git a/10.css b/10.css index 40a1f5a..59c31a8 100644 --- a/10.css +++ b/10.css @@ -1,5 +1,16 @@ body{ - background-color: #e5d4ea; + animation: bgchange 20s ease infinite; +} + +@keyframes bgchange{ + 0% {background:#ffe6e1;} + 60% {background:#cefd9e;} + 100% {background:#e8c7b7;} +} +h1{ + text-align: center; + font-family: serif; + font-size: 8vw; } div.container{ display: flex; @@ -11,6 +22,11 @@ border: 2px solid #312a2a; margin: 1px; } +.container div:hover{ + background-color: #af72c9; + box-shadow: 0px 0px 15px 2px rgba(74, 45, 45, 0.2); + transform: scale(1.2); +} p{ text-align: center; padding-left: 10px; diff --git a/10.js b/10.js index 2369af6..623c9bd 100644 --- a/10.js +++ b/10.js @@ -1,5 +1,5 @@ -function CountDown() { - var count = 4,tmID,infobox = document.getElementById("start"), atari = document.getElementById("true"),finish = document.getElementById("info"); +function main() { + var count = 4,tmID,button = document.getElementById("start"), atari = document.getElementById("true"),finish = document.getElementById("info"); function CountDown(){ if (--count == 0) { finish.innerHTML = "終了"; @@ -10,20 +10,20 @@ } } function startCountDown() { - tmID = setTimeout(CountDown, 1000);/*100ms=1秒*/ - infobox.removeEventListener("click", startCountDown, false); + tmID = setTimeout(CountDown, 1000);/*1000ms=1秒*/ + button.removeEventListener("click", startCountDown, false); atari.addEventListener("click", stopCountDown, false); } function stopCountDown() { if (count >= 0) { clearTimeout(tmID); - infobox.innerHTML = "爆発阻止成功です!"; + button.innerHTML = "爆発阻止成功です!"; } finish.innerHTML = "終了"; atari.innerHTML = "爆弾みーっけ"; atari.removeEventListener("click", stopCountDown, false); } - infobox.addEventListener("click", startCountDown, false); + button.addEventListener("click", startCountDown, false); }; -document.addEventListener("DOMContentLoaded", CountDown, false); \ No newline at end of file +document.addEventListener("DOMContentLoaded", main, false); diff --git a/random.html b/random.html index 57eb0ec..504e244 100644 --- a/random.html +++ b/random.html @@ -4,23 +4,26 @@ 出会って3秒で爆発 - + +

爆弾を探せ!!

STARTを押してから時間内に1~10を選んでね

- +

-

1

-

2

-

3

-

4

-

5

-

6

-

7

-

8

-

9

-

10

+
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+
\ No newline at end of file diff --git a/random.js b/random.js old mode 100644 new mode 100755 index 2369af6..e6302dc --- a/random.js +++ b/random.js @@ -1,29 +1,35 @@ -function CountDown() { - var count = 4,tmID,infobox = document.getElementById("start"), atari = document.getElementById("true"),finish = document.getElementById("info"); +function main() { + var count = 6, + tmID, + button = document.getElementById("start"), + atari = document.getElementById("box"), + finish = document.getElementById("info"); function CountDown(){ if (--count == 0) { finish.innerHTML = "終了"; atari.removeEventListener("click", stopCountDown, false); } else { finish.innerHTML = count + "秒前"; - tmID = setTimeout(CountDown, 1000); + tmID = setTimeout(CountDown, 1000);/*1000ms=1秒*/ } } - function startCountDown() { - tmID = setTimeout(CountDown, 1000);/*100ms=1秒*/ - infobox.removeEventListener("click", startCountDown, false); - atari.addEventListener("click", stopCountDown, false); - } + function stopCountDown() { if (count >= 0) { clearTimeout(tmID); - infobox.innerHTML = "爆発阻止成功です!"; + button.innerHTML = "爆発阻止成功です!"; } - - finish.innerHTML = "終了"; - atari.innerHTML = "爆弾みーっけ"; - atari.removeEventListener("click", stopCountDown, false); + finish.innerHTML = "終了"; + atari.innerHTML = "みっけ!"; + atari.removeEventListener("click", stopCountDown, false); } - infobox.addEventListener("click", startCountDown, false); + + function startCountDown() { + tmID = setTimeout(CountDown, 1000);/*1000ms=1秒*/ + button.removeEventListener("click", startCountDown, false); + atari.addEventListener("click", stopCountDown, false); + } + button.addEventListener("click", startCountDown, false); }; -document.addEventListener("DOMContentLoaded", CountDown, false); \ No newline at end of file +document.addEventListener("DOMContentLoaded", main, false); +