-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30d0ef0
commit dc21301
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
|
||
<title>Home</title> | ||
<style type="text/css" media="screen"> | ||
body { | ||
background-color: #f5f5f5; | ||
margin: 0px; | ||
} | ||
|
||
.container { | ||
width: 100%; | ||
height: 100vh; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
} | ||
|
||
#clock { | ||
font-family: monospace; | ||
font-size: 5rem; | ||
font-weight: 600; | ||
color: #000000; | ||
margin-bottom: 0.25em; | ||
} | ||
|
||
.inline { | ||
display: inline-block; | ||
} | ||
|
||
@media only screen and (max-width: 960px) { | ||
.container { | ||
height: auto; | ||
} | ||
|
||
#clock { | ||
margin-top: 1em; | ||
} | ||
|
||
.container > .bookmark-container { | ||
flex-direction: column; | ||
width: 60%; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div id="clock"></div> | ||
</div> | ||
|
||
<script> | ||
// Get current time and format | ||
getTime = () => { | ||
let date = new Date(), | ||
min = date.getMinutes(), | ||
sec = date.getSeconds(), | ||
hour = date.getHours(); | ||
|
||
return ( | ||
"" + | ||
(hour < 10 ? "0" + hour : hour) + | ||
":" + | ||
(min < 10 ? "0" + min : min) + | ||
":" + | ||
(sec < 10 ? "0" + sec : sec) | ||
); | ||
}; | ||
|
||
window.onload = () => { | ||
// Set up the clock | ||
document.getElementById("clock").innerHTML = getTime(); | ||
// Set clock interval to tick clock | ||
setInterval(() => { | ||
document.getElementById("clock").innerHTML = getTime(); | ||
}, 500); | ||
}; | ||
</script> | ||
</body> | ||
</html> |