40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<style>
|
|
body {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
margin: 0;
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f0f0f0;
|
|
}
|
|
#clock {
|
|
font-size: 48px;
|
|
background: #333;
|
|
color: #fff;
|
|
padding: 20px;
|
|
border-radius: 10px;
|
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="clock">00:00:00</div>
|
|
<script>
|
|
function updateTime() {
|
|
const clock = document.getElementById('clock');
|
|
const now = new Date();
|
|
const hours = String(now.getHours()).padStart(2, '0');
|
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
clock.textContent = `${hours}:${minutes}:${seconds}`;
|
|
}
|
|
setInterval(updateTime, 1000);
|
|
updateTime();
|
|
</script>
|
|
</body>
|
|
|