Skip to content

Commit

Permalink
Merge pull request #1126 from swayamvasavada/DigitalClock-swayamvasavada
Browse files Browse the repository at this point in the history
Created new project Digital Clock
  • Loading branch information
NitkarshChourasia authored Mar 7, 2024
2 parents e8bc8d9 + 03ba5df commit 6600243
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
File renamed without changes.
13 changes: 13 additions & 0 deletions DigitalClock/swayamvasavada/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Clock</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
<div id="clock-container"></div>
</body>
</html>
9 changes: 9 additions & 0 deletions DigitalClock/swayamvasavada/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const clockContainer = document.getElementById('clock-container');

function updateTime() {
const currentTime = new Date().toLocaleTimeString();

clockContainer.innerText = currentTime;
}

setInterval(updateTime, 1000);
19 changes: 19 additions & 0 deletions DigitalClock/swayamvasavada/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
* {
margin: 0;
padding: 0;
}

body {
background-color: black;
color: white;
}

#clock-container {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
font-size: 4rem;
font-weight: bold;
}

0 comments on commit 6600243

Please sign in to comment.