-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspinning.html
More file actions
78 lines (66 loc) · 1.5 KB
/
spinning.html
File metadata and controls
78 lines (66 loc) · 1.5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spinning Wheel with Countdown</title>
<style>
.container-sp {
position: relative;
width: 300px;
height: 300px;
}
.wheel {
width: 100%;
height: 100%;
border-radius: 50%;
border: 15px solid transparent;
border-top: 15px solid darkblue;
animation: spin 20s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.countdown {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 2em;
font-family: Arial, sans-serif;
color: #000;
}
</style>
</head>
<body>
<div class="container-sp">
<div class="wheel"></div>
<div class="countdown" id="countdown" style="font-size:5em;"></div>
</div>
<script>
function startCountdown()
{
let countdown = 20; // Start from 10 seconds
const countdownElement = document.getElementById("countdown");
let countback=false;
const interval = setInterval(() => {
countdownElement.textContent = countdown;
if (countdown <= 0 || countback) {
/*clearInterval(interval);
countdownElement.textContent = "Time's up!";*/
countback=true;
countdown++;
}else
{
countdown--;
}
}, 1000);
}
</script>
</body>
</html>