-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
109 lines (88 loc) · 3.54 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="fr">
<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">
<meta name="description" content="Montre digital">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.png">
<meta name="google-site-verification" content="9MVcxa4rkcfZPi6VUf40CfGKhPsqgGj4OmedHLIFRQY" />
<title>DIGITAL-CLOCK</title>
</head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-568BTC8B61"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-568BTC8B61');
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XQLC21S86J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XQLC21S86J');
</script>
<body>
<div class="container">
<div class="reg"></div>
<div class="reg2"></div>
<div class="reg3"></div>
<div class="clock">
<div class="circle" id="sc" style=" --clr:#04fc43;"> <i></i></div>
<div class="circle circle2" id="mn" style=" --clr:#fee800;"> <i></i></div>
<div class="circle circle3" id="hr" style=" --clr:#ff2972;"> <i></i></div>
<span style="--i:1;"> <b>1</b></span>
<span style="--i:2;"> <b>2</b></span>
<span style="--i:3;"> <b>3</b></span>
<span style="--i:4;"> <b>4</b></span>
<span style="--i:5;"> <b>5</b></span>
<span style="--i:6;"> <b>6</b></span>
<span style="--i:7;"> <b>7</b></span>
<span style="--i:8;"> <b>8</b></span>
<span style="--i:9;"> <b>9</b></span>
<span style="--i:10;"> <b>10</b></span>
<span style="--i:11;"> <b>11</b></span>
<span style="--i:12;"> <b>12</b></span>
</div>
<div id="time">
<div id="hours" style="--clr:#ff2972;">00</div>
<div id="minutes" style="--clr:#fee800;">00</div>
<div id="seconds" style="--clr:#04fc43;">00</div>
<div id="ampm">AM</div>
</div>
</div>
<script>
let hr = document.querySelector('#hr');
let mn = document.querySelector('#mn');
let sc = document.querySelector('#sc');
setInterval(() => {
let day = new Date();
let hh = day.getHours() * 30;
let mm = day.getMinutes() * 6;
let ss = day.getSeconds() * 6;
hr.style.transform = `rotateZ(${hh + (mm / 12)}deg)`;
mn.style.transform = `rotateZ(${mm}deg)`;
sc.style.transform = `rotateZ(${ss}deg)`;
let hours = document.getElementById('hours');
let minutes = document.getElementById('minutes');
let seconds = document.getElementById('seconds');
let ampm = document.getElementById('ampm');
let h = new Date().getHours();
let m = new Date().getMinutes();
let s = new Date().getSeconds();
let am = h >= 12 ? "PM" : "AM";
h = (h < 10) ? "0" + h : h
m = (m < 10) ? "0" + m : m
s = (s < 10) ? "0" + s : s
hours.innerHTML = h;
minutes.innerHTML = m;
seconds.innerHTML = s;
ampm.innerHTML = am;
})
</script>
</body>
</html>