Skip to content

Commit 03ba5df

Browse files
Created new project Digital Clock
1 parent e8bc8d9 commit 03ba5df

File tree

6 files changed

+41
-0
lines changed

6 files changed

+41
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Digital Clock</title>
7+
<link rel="stylesheet" href="style.css">
8+
<script src="script.js" defer></script>
9+
</head>
10+
<body>
11+
<div id="clock-container"></div>
12+
</body>
13+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const clockContainer = document.getElementById('clock-container');
2+
3+
function updateTime() {
4+
const currentTime = new Date().toLocaleTimeString();
5+
6+
clockContainer.innerText = currentTime;
7+
}
8+
9+
setInterval(updateTime, 1000);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
6+
body {
7+
background-color: black;
8+
color: white;
9+
}
10+
11+
#clock-container {
12+
display: flex;
13+
justify-content: center;
14+
align-items: center;
15+
width: 100vw;
16+
height: 100vh;
17+
font-size: 4rem;
18+
font-weight: bold;
19+
}

0 commit comments

Comments
 (0)