-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (90 loc) · 2.38 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
<!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">
<title>DIGITAL CLOCK</title>
<style>
*{
margin: 0;
padding: 0;
background: black;
}
.container , .number , span{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
border-radius: 10px;
}
.container{
background:linear-gradient(200deg , rgb(255, 81, 0),#02fa02,#1b1bfa);
width: 253px;
height: 72px;
animation: vaibhav 1.5s linear infinite;
}
.number{
color: white;
background: black;
/* border: 1px solid black; */
width: 238px;
/* height: 40px; */
text-align: center;
font-size: 42px;
z-index: 1;
/* border-radius: 10px; */
padding: 5px 0;
}
#clock{
/* background: transparent; */
/* color: transparent; */
background: linear-gradient(200deg , red,#02fa02,blue);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
span{
width: 100%;
height: 100%;
background: inherit;
filter: blur(14px);
}
@keyframes vaibhav {
100%{
filter: hue-rotate(360deg);
}
}
</style>
</head>
<body>
<div class="container">
<div class="number"><div id="clock">00:00:00 PM</div>
</div>
<span></span>
</div>
</body>
<script>
setInterval(()=>{
let name = document.getElementById('clock');
let time = new Date()
let hours = time.getHours()
let minute = time.getMinutes()
let second = time.getSeconds()
let PM = "AM"
if(second<10){
second = '0'+second
}
if(minute<10){
minute = '0'+minute
}
if(hours<10){
hours = '0'+hours
}
if(hours>12){
hours = hours - 12
PM = "PM"
}
name.textContent = hours + ':' + minute + ':' + second +' '+ PM;
})
</script>
</html>