Skip to content

Instantly share code, notes, and snippets.

@qodirovshohijahon
Created July 16, 2020 05:01
Show Gist options
  • Save qodirovshohijahon/9d2f33284fa0caba87df4466ee7d44bf to your computer and use it in GitHub Desktop.
Save qodirovshohijahon/9d2f33284fa0caba87df4466ee7d44bf to your computer and use it in GitHub Desktop.
You can see current time
<!DOCTYPE html>
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Montserrat', sans-serif;
}
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: O1b1919;
}
p {
width: 400px;
height: 100px;
line-height: 100px;
text-align: center;
border-radius: 50px;
color: #00fff2;
font-size: 48px;
box-shadow: inset 2px 3px 4px rgba(255, 255, 255, .1), 2px 3px 4px rgba(e, e, e,4);
}
</style>
</head>
<script>
setInterval (() => {
let time = document.querySelector('p');
let half = document.querySelector('p span');
let h = new Date().getHours ();
let m = new Date().getMinutes();
let s = new Date().getSeconds();
if(h < 10)
h = "0" + h;
if(m < 10)
m = "0" + m;
if(s < 10)
s = "0" + s;
if(h >= 12)
time.innerText = `${h} : ${m} : ${s} PM`;
if(h < 12)
time.innerText = `${h} : ${m} : ${s} AM`;
}, 1000);
</script>
</html>
<body>
<p><span>Загрузка</span></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment