Created
October 11, 2023 22:43
-
-
Save djramones/6c05a0f69d9397245c09accae757c0dc to your computer and use it in GitHub Desktop.
Simple clock page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Clock</title> | |
<style> | |
body, div { | |
margin: 0; | |
padding: 0; | |
width: 100dvw; | |
height: 100dvh; | |
background-color: #123; | |
} | |
div { | |
display: grid; | |
place-items: center; | |
} | |
#time { | |
font-family: 'Roboto Mono', 'Segoe UI', monospace; | |
font-size: 10dvw; | |
font-weight: 700; | |
color: #ddd; | |
} | |
</style> | |
</head> | |
<body> | |
<div> | |
<span id="time"></span> | |
</div> | |
<script> | |
setTime = () => { | |
document.getElementById("time").textContent = | |
new Date().toLocaleTimeString() | |
} | |
setTime() | |
setInterval(setTime, 1000) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment