-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (77 loc) · 3.34 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Indian Clock</title>
<link rel="stylesheet" href="style.css">
<script src="confetti.js"></script>
</head>
<body>
<div class="wrapper">
<ul id="clocktext">Time in India</ul>
<div id="date" class="date"></div>
<span class="glow span-1"></span>
<span class="glow span-2"></span>
<span class="glow span-3"></span>
<span class="glow span-4"></span>
<span class="glow span-5"></span>
<span class="glow span-6"></span>
<span class="glow span-7"></span>
<span class="glow span-8"></span>
<span class="glow span-9"></span>
<span class="glow span-10"></span>
<span class="glow span-11"></span>
<span class="glow span-12"></span>
<span class="glow span-13"></span>
<span class="glow span-14"></span>
<span class="glow span-15"></span>
<span class="glow span-16"></span>
<span class="glow span-17"></span>
<span class="glow span-18"></span>
<span class="glow span-19"></span>
<span class="glow span-20"></span>
<ul id="clock">
<li class="numbers"><span>1</span></li>
<li class="numbers"><span>2</span></li>
<li class="numbers"><span>3</span></li>
<li class="numbers"><span>4</span></li>
<li class="numbers"><span>5</span></li>
<li class="numbers"><span>6</span></li>
<li class="numbers"><span>7</span></li>
<li class="numbers"><span>8</span></li>
<li class="numbers"><span>9</span></li>
<li class="numbers"><span>10</span></li>
<li class="numbers"><span>11</span></li>
<li class="numbers"><span>12</span></li>
<li id="hour"></li>
<li id="minute"></li>
<li id="second"></li>
</ul>
</div>
<div id="second-timer">Seconds: <span id="seconds-counter">0</span></div>
<script>
function updateClock() {
const now = new Date();
const hours = now.getUTCHours() - 0.6;
const minutes = now.getUTCMinutes() + 20;
const seconds = now.getUTCSeconds();
document.getElementById('hour').style.transform = `rotate(${360 / 12 * hours + 360 / 12 / 60 * minutes}deg)`;
document.getElementById('minute').style.transform = `rotate(${360 / 60 * minutes}deg)`;
document.getElementById('second').style.transform = `rotate(${360 / 60 * seconds}deg)`;
document.getElementById('seconds-counter').textContent = seconds;
}
function updateDate() {
const now = new Date();
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
const formattedDate = now.toLocaleDateString('en-US', options);
document.getElementById('date').textContent = formattedDate;
}
setInterval(updateClock, 1000);
setInterval(updateDate, 1000);
updateClock();
updateDate();
</script>
</body>
</html>