-
Notifications
You must be signed in to change notification settings - Fork 0
/
aclock.html
67 lines (63 loc) · 2.33 KB
/
aclock.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AClock</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
*{
font-family: monospace;
}
</style>
</head>
<body class="bg-light">
<div class="container">
<div class="row vh-100">
<div class="col-12 text-center my-auto">
<div class="card col-8 col-md-6 mx-auto">
<h5 class="card-header text-center">
<i class="fa-solid fa-clock-rotate-left"></i>
Aclock
</h5>
<div class="card-body">
<h3 id="clock">Aadil Mugal</h3>
</div>
<div class="card-footer pt-4">
<div class="blockquote-footer mb-0">
Made by
<strong>Aadil Mugal</strong>
made with <span class="text-danger">🎔</span>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script>
console.log("This is a simple clock");
let clock = ()=>{
let date = new Date();
let h = date.getHours();
let m = date.getMinutes();
let s = date.getSeconds();
let peroid = "AM";
if(h==0) h = 12;
if(h>12){
h = h-12;
peroid = "PM";
}
h = h<10?`0${h}`:h;
m = m<10?`0${m}`:m;
s = s<10?`0${s}`:s;
let time = `${h} : ${m} : ${s} ${peroid}`;
document.getElementById("clock").innerHTML = time;
}
clock();
// console.log(clock())
setInterval(clock,1000);
</script>
</body>
</html>