Repository navigation
Expand file tree
/
Copy pathadvancetask5.html
More file actions
178 lines (162 loc) · 4.04 KB
/
Copy pathadvancetask5.html
File metadata and controls
178 lines (162 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>3D Futuristic Counter</title>
<link
href="https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Orbitron", sans-serif;
}
body {
height: 100vh;
background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
position: relative;
}
/* Particle-style background circles */
body::before {
content: "";
position: absolute;
width: 300%;
height: 300%;
background: radial-gradient(
circle,
rgba(0, 255, 213, 0.2) 1px,
transparent 1px
);
background-size: 50px 50px;
animation: moveBg 60s linear infinite;
z-index: 0;
}
@keyframes moveBg {
from {
transform: translate(0, 0);
}
to {
transform: translate(-500px, -500px);
}
}
.container {
text-align: center;
position: relative;
z-index: 1;
}
#counter {
font-size: 6rem;
color: #00ffd5;
background: rgba(0, 28, 31, 0.9);
padding: 50px 100px;
border-radius: 25px;
box-shadow: 0 0 20px #00ffd5, 0 0 40px rgba(0, 255, 213, 0.4),
inset 0 0 30px rgba(0, 255, 213, 0.3);
animation: float 3s ease-in-out infinite, pulseGlow 2s infinite;
transition: all 0.3s ease;
}
@keyframes float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
@keyframes pulseGlow {
0%,
100% {
box-shadow: 0 0 30px #00ffd5;
}
50% {
box-shadow: 0 0 50px #00fff2;
}
}
button {
font-size: 1.2rem;
margin: 20px 10px;
padding: 14px 36px;
border: none;
border-radius: 30px;
cursor: pointer;
font-weight: bold;
color: #001c1f;
position: relative;
overflow: hidden;
z-index: 1;
background: linear-gradient(135deg, #00ffd5, #00bfa6);
box-shadow: 0 5px 25px rgba(0, 255, 213, 0.4);
transition: all 0.3s ease;
}
button::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(
circle,
rgba(255, 255, 255, 0.2) 10%,
transparent 60%
);
animation: shine 2s linear infinite;
z-index: -1;
}
@keyframes shine {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
button:hover {
transform: scale(1.05);
box-shadow: 0 8px 30px rgba(0, 255, 213, 0.6);
}
button:active {
transform: scale(0.97);
}
</style>
</head>
<body>
<div class="container">
<p id="counter">0</p>
<button onclick="myFunc()">Start</button>
<button onclick="stopFunc()">Stop</button>
<button onclick="resetFunc()">Reset</button>
</div>
<script>
let count = 0;
let intervalId = null;
const counter = document.getElementById("counter");
function myFunc() {
if (intervalId) return;
intervalId = setInterval(() => {
count++;
counter.textContent = count;
}, 1000);
}
function stopFunc() {
clearInterval(intervalId);
intervalId = null;
}
function resetFunc() {
clearInterval(intervalId);
intervalId = null;
count = 0;
counter.textContent = count;
}
</script>
</body>
</html>