-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (35 loc) · 973 Bytes
/
script.js
File metadata and controls
38 lines (35 loc) · 973 Bytes
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
function updateLiveTime() {
var now = new Date();
var options = {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
timeZone: 'Asia/Kolkata'
};
var formattedTime = now.toLocaleString('en-IN', options);
document.getElementById('timeDate').textContent = formattedTime;
}
setInterval(updateLiveTime, 1000);
updateLiveTime();
var counterElement = document.getElementById('.counter');
var count = 0;
var limit = 6000;
var speed = 100;
function updateCounter() {
count++;
if (count <= limit) {
counterElement.textContent = count;
if (count % 5 === 0) {
speed /= 2;
clearInterval(counterInterval);
counterInterval = setInterval(updateCounter, speed);
}
} else {
clearInterval(counterInterval);
}
}
var counterInterval = setInterval(updateCounter, speed);