Spaces:
Running
Running
Update index.html
Browse files- index.html +98 -19
index.html
CHANGED
@@ -1,19 +1,98 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ja">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>鐚伄銈广儓銉冦儣銈︺偐銉冦儊</title>
|
6 |
+
<style>
|
7 |
+
body {
|
8 |
+
font-family: Arial, sans-serif;
|
9 |
+
text-align: center;
|
10 |
+
padding: 50px;
|
11 |
+
background-color: #f0f8ff;
|
12 |
+
}
|
13 |
+
.container {
|
14 |
+
background-color: white;
|
15 |
+
padding: 20px;
|
16 |
+
border-radius: 10px;
|
17 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
18 |
+
display: inline-block;
|
19 |
+
}
|
20 |
+
#timer {
|
21 |
+
font-size: 48px;
|
22 |
+
margin: 20px 0;
|
23 |
+
color: #ff69b4;
|
24 |
+
}
|
25 |
+
button {
|
26 |
+
padding: 10px 20px;
|
27 |
+
margin: 5px;
|
28 |
+
font-size: 16px;
|
29 |
+
border: none;
|
30 |
+
border-radius: 5px;
|
31 |
+
cursor: pointer;
|
32 |
+
background-color: #ffb6c1;
|
33 |
+
color: white;
|
34 |
+
}
|
35 |
+
button:hover {
|
36 |
+
background-color: #ff89a1;
|
37 |
+
}
|
38 |
+
.cat {
|
39 |
+
font-size: 60px;
|
40 |
+
margin: 20px 0;
|
41 |
+
}
|
42 |
+
</style>
|
43 |
+
</head>
|
44 |
+
<body>
|
45 |
+
<div class="container">
|
46 |
+
<div class="cat">馃惐</div>
|
47 |
+
<h1>鐚伄銈广儓銉冦儣銈︺偐銉冦儊</h1>
|
48 |
+
<div id="timer">00:00:00</div>
|
49 |
+
<div>
|
50 |
+
<button onclick="startTimer()">闁嬪</button>
|
51 |
+
<button onclick="stopTimer()">鍋滄</button>
|
52 |
+
<button onclick="resetTimer()">銉偦銉冦儓</button>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<script>
|
57 |
+
let timer;
|
58 |
+
let time = 0;
|
59 |
+
let running = false;
|
60 |
+
|
61 |
+
function startTimer() {
|
62 |
+
if (!running) {
|
63 |
+
running = true;
|
64 |
+
timer = setInterval(() => {
|
65 |
+
time++;
|
66 |
+
updateDisplay();
|
67 |
+
}, 1000);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
function stopTimer() {
|
72 |
+
if (running) {
|
73 |
+
running = false;
|
74 |
+
clearInterval(timer);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
function resetTimer() {
|
79 |
+
running = false;
|
80 |
+
clearInterval(timer);
|
81 |
+
time = 0;
|
82 |
+
updateDisplay();
|
83 |
+
}
|
84 |
+
|
85 |
+
function updateDisplay() {
|
86 |
+
let hours = Math.floor(time / 3600);
|
87 |
+
let minutes = Math.floor((time % 3600) / 60);
|
88 |
+
let seconds = time % 60;
|
89 |
+
|
90 |
+
hours = String(hours).padStart(2, '0');
|
91 |
+
minutes = String(minutes).padStart(2, '0');
|
92 |
+
seconds = String(seconds).padStart(2, '0');
|
93 |
+
|
94 |
+
document.getElementById('timer').textContent = `${hours}:${minutes}:${seconds}`;
|
95 |
+
}
|
96 |
+
</script>
|
97 |
+
</body>
|
98 |
+
</html>
|