-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
55 lines (50 loc) · 1.71 KB
/
script.js
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
// (c) 2022 Ayush Agnihotri
const now = new Date()
const c1 = document.querySelector('.c1');
const c2 = document.querySelector('.c2');
const c3 = document.querySelector('.c3');
const C1 = document.querySelector('.C1');
const Q1 = document.querySelector('.Q1');
const C2 = document.querySelector('.C2');
const Q2 = document.querySelector('.Q2');
const C3 = document.querySelector('.C3');
const Q3 = document.querySelector('.Q3');
c1.addEventListener('click', () => {
C1.classList.toggle('C1');
Q1.classList.toggle('Q1');
C3.classList.add('C3');
Q3.classList.add('Q3');
C2.classList.add('C2');
Q2.classList.add('Q2');
const now = new Date().getHours()
const min = new Date().getMinutes()
const distance = now + ":" + min;
const blogList = document.querySelector(".time1");
blogList.innerHTML = distance;
});
c2.addEventListener('click', () => {
C2.classList.toggle('C2');
Q2.classList.toggle('Q2');
C1.classList.add('C1');
Q1.classList.add('Q1');
C3.classList.add('C3');
Q3.classList.add('Q3');
const now = new Date().getHours()
const min = new Date().getMinutes()
const distance = now + ":" + min;
const blogList = document.querySelector(".time2");
blogList.innerHTML = distance;
});
c3.addEventListener('click', () => {
C3.classList.toggle('C3');
Q3.classList.toggle('Q3');
C1.classList.add('C1');
Q1.classList.add('Q1');
C2.classList.add('C2');
Q2.classList.add('Q2');
const now = new Date().getHours()
const min = new Date().getMinutes()
const distance = now + ":" + min;
const blogList = document.querySelector(".time3");
blogList.innerHTML = distance;
});