-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
57 lines (50 loc) · 2.22 KB
/
Copy pathindex.html
File metadata and controls
57 lines (50 loc) · 2.22 KB
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
<!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>Document</title>
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
/>
</head>
<body>
<div class="box">
<h1 class="time" id="time">12:12</h1>
<p class="day" id="day">Firday</p>
<p class="date" id="date">June 26</p>
<i class="fas fa-square"></i>
<i class="fas fa-circle"></i>
<i class="fas fa-star"></i>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path
fill="#0099ff"
fill-opacity="1"
d="M0,96L34.3,106.7C68.6,117,137,139,206,154.7C274.3,171,343,181,411,165.3C480,149,549,107,617,80C685.7,53,754,43,823,42.7C891.4,43,960,53,1029,101.3C1097.1,149,1166,235,1234,261.3C1302.9,288,1371,256,1406,240L1440,224L1440,320L1405.7,320C1371.4,320,1303,320,1234,320C1165.7,320,1097,320,1029,320C960,320,891,320,823,320C754.3,320,686,320,617,320C548.6,320,480,320,411,320C342.9,320,274,320,206,320C137.1,320,69,320,34,320L0,320Z"
></path>
</svg>
</div>
<script>
const time = document.getElementById('time');
const day = document.getElementById('day');
const dateVal = document.getElementById('date');
display();
function display(){
let date = new Date();
if(date.getMinutes() < 10){
time.innerText = `${date.getHours()}:0${date.getMinutes()}`;
}else{
time.innerText = `${date.getHours()}:${date.getMinutes()}`;
}
const monthArr = ['Jan', 'Feb', 'Mar', 'April', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'dec'];
let dateValue = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
dateVal.innerText = monthArr[date.getMonth()] + " " + dateValue;
const dayArr = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday',]
day.innerText = dayArr[date.getDay()];
}
</script>
</body>
</html>