<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Analog Clock</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: 'Arial', sans-serif;
overflow: hidden;
}
.clock-container {
position: relative;
width: min(80vmin, 400px);
height: min(80vmin, 400px);
}
.clock {
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
background: #ffffff;
box-shadow:
0 0 30px rgba(0, 0, 0, 0.3),
inset 0 0 20px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: center;
align-items: center;
}
.clock::before {
content: '';
position: absolute;
width: 15px;
height: 15px;
background: #333;
border-radius: 50%;
z-index: 10;
}
.number {
position: absolute;
font-size: calc(1.2em + 1vw);
font-weight: bold;
color: #333;
transform: translate(-50%, -50%);
}
.number:nth-child(1) { top: 5%; left: 50%; }
.number:nth-child(2) { top: 12%; left: 85%; }
.number:nth-child(3) { top: 50%; left: 95%; }
.number:nth-child(4) { top: 88%; left: 85%; }
.number:nth-child(5) { bottom: 5%; left: 50%; }
.number:nth-child(6) { top: 88%; left: 15%; }
.number:nth-child(7) { top: 50%; left: 5%; }
.number:nth-child(8) { top: 12%; left: 15%; }
.number:nth-child(9) { top: 15%; left: 50%; }
.number:nth-child(10) { top: 25%; left: 25%; }
.number:nth-child(11) { top: 25%; left: 75%; }
.number:nth-child(12) { top: 35%; left: 50%; }
.hand {
position: absolute;
bottom: 50%;
left: 50%;
transform-origin: 50% 100%;
border-radius: 10px;
}
.hour-hand {
width: 6px;
height: 30%;
background: #333;
margin-left: -3px;
z-index: 3;
}
.minute-hand {
width: 4px;
height: 40%;
background: #555;
margin-left: -2px;
z-index: 2;
}
.second-hand {
width: 2px;
height: 45%;
background: #e74c3c;
margin-left: -1px;
z-index: 1;
animation: tick 1s steps(60) infinite;
}
@keyframes tick {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.clock-face {
position: absolute;
width: 100%;
height: 100%;
}
.tick {
position: absolute;
width: 2px;
height: 10px;
background: #999;
left: 50%;
transform-origin: 50% 100%;
}
.tick.major {
height: 20px;
width: 3px;
background: #666;
}
.tick:nth-child(1) { transform: translateX(-50%) rotate(0deg); top: 0; }
.tick:nth-child(2) { transform: translateX(-50%) rotate(6deg); top: 0; }
.tick:nth-child(3) { transform: translateX(-50%) rotate(12deg); top: 0; }
.tick:nth-child(4) { transform: translateX(-50%) rotate(18deg); top: 0; }
.tick:nth-child(5) { transform: translateX(-50%) rotate(24deg); top: 0; }
.tick:nth-child(6) { transform: translateX(-50%) rotate(30deg); top: 0; }
.tick:nth-child(7) { transform: translateX(-50%) rotate(36deg); top: 0; }
.tick:nth-child(8) { transform: translateX(-50%) rotate(42deg); top: 0; }
.tick:nth-child(9) { transform: translateX(-50%) rotate(48deg); top: 0; }
.tick:nth-child(10) { transform: translateX(-50%) rotate(54deg); top: 0; }
.tick:nth-child(11) { transform: translateX(-50%) rotate(60deg); top: 0; }
.tick:nth-child(12) { transform: translateX(-50%) rotate(66deg); top: 0; }
.tick:nth-child(13) { transform: translateX(-50%) rotate(72deg); top: 0; }
.tick:nth-child(14) { transform: translateX(-50%) rotate(78deg); top: 0; }
.tick:nth-child(15) { transform: translateX(-50%) rotate(84deg); top: 0; }
.tick:nth-child(16) { transform: translateX(-50%) rotate(90deg); top: 0; }
.tick:nth-child(17) { transform: translateX(-50%) rotate(96deg); top: 0; }
.tick:nth-child(18) { transform: translateX(-50%) rotate(102deg); top: 0; }
.tick:nth-child(19) { transform: translateX(-50%) rotate(108deg); top: 0; }
.tick:nth-child(20) { transform: translateX(-50%) rotate(114deg); top: 0; }
.tick:nth-child(21) { transform: translateX(-50%) rotate(120deg); top: 0; }
.tick:nth-child(22) { transform: translateX(-50%) rotate(126deg); top: 0; }
.tick:nth-child(23) { transform: translateX(-50%) rotate(132deg); top: 0; }
.tick:nth-child(24) { transform: translateX(-50%) rotate(138deg); top: 0; }
.tick:nth-child(25) { transform: translateX(-50%) rotate(144deg); top: 0; }
.tick:nth-child(26) { transform: translateX(-50%) rotate(150deg); top: 0; }
.tick:nth-child(27) { transform: translateX(-50%) rotate(156deg); top: 0; }
.tick:nth-child(28) { transform: translateX(-50%) rotate(162deg); top: 0; }
.tick:nth-child(29) { transform: translateX(-50%) rotate(168deg); top: 0; }
.tick:nth-child(30) { transform: translateX(-50%) rotate(174deg); top: 0; }
.tick:nth-child(31) { transform: translateX(-50%) rotate(180deg); top: 0; }
.tick:nth-child(32) { transform: translateX(-50%) rotate(186deg); top: 0; }
.tick:nth-child(33) { transform: translateX(-50%) rotate(192deg); top: 0; }
.tick:nth-child(34) { transform: translateX(-50%) rotate(198deg); top: 0; }
.tick:nth-child(35) { transform: translateX(-50%) rotate(204deg); top: 0; }
.tick:nth-child(36) { transform: translateX(-50%) rotate(210deg); top: 0; }
.tick:nth-child(37) { transform: translateX(-50%) rotate(216deg); top: 0; }
.tick:nth-child(38) { transform: translateX(-50%) rotate(222deg); top: 0; }
.tick:nth-child(39) { transform: translateX(-50%) rotate(228deg); top: 0; }
.tick:nth-child(40) { transform: translateX(-50%) rotate(234deg); top: 0; }
.tick:nth-child(41) { transform: translateX(-50%) rotate(240deg); top: 0; }
.tick:nth-child(42) { transform: translateX(-50%) rotate(246deg); top: 0; }
.tick:nth-child(43) { transform: translateX(-50%) rotate(252deg); top: 0; }
.tick:nth-child(44) { transform: translateX(-50%) rotate(258deg); top: 0; }
.tick:nth-child(45) { transform: translateX(-50%) rotate(264deg); top: 0; }
.tick:nth-child(46) { transform: translateX(-50%) rotate(270deg); top: 0; }
.tick:nth-child(47) { transform: translateX(-50%) rotate(276deg); top: 0; }
.tick:nth-child(48) { transform: translateX(-50%) rotate(282deg); top: 0; }
.tick:nth-child(49) { transform: translateX(-50%) rotate(288deg); top: 0; }
.tick:nth-child(50) { transform: translateX(-50%) rotate(294deg); top: 0; }
.tick:nth-child(51) { transform: translateX(-50%) rotate(300deg); top: 0; }
.tick:nth-child(52) { transform: translateX(-50%) rotate(306deg); top: 0; }
.tick:nth-child(53) { transform: translateX(-50%) rotate(312deg); top: 0; }
.tick:nth-child(54) { transform: translateX(-50%) rotate(318deg); top: 0; }
.tick:nth-child(55) { transform: translateX(-50%) rotate(324deg); top: 0; }
.tick:nth-child(56) { transform: translateX(-50%) rotate(330deg); top: 0; }
.tick:nth-child(57) { transform: translateX(-50%) rotate(336deg); top: 0; }
.tick:nth-child(58) { transform: translateX(-50%) rotate(342deg); top: 0; }
.tick:nth-child(59) { transform: translateX(-50%) rotate(348deg); top: 0; }
.tick:nth-child(60) { transform: translateX(-50%) rotate(354deg); top: 0; }
@media (max-width: 600px) {
.number {
font-size: 1em;
}
}
</style>
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: 'Arial', sans-serif;
overflow: hidden;
}
.clock-container {
position: relative;
width: min(80vmin, 400px);
height: min(80vmin, 400px);
}
.clock {
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
background: #ffffff;
box-shadow:
0 0 30px rgba(0, 0, 0, 0.3),
inset 0 0 20px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: center;
align-items: center;
}
.clock::before {
content: '';
position: absolute;
width: 15px;
height: 15px;
background: #333;
border-radius: 50%;
z-index: 10;
}
.number {
position: absolute;
font-size: calc(1.2em + 1vw);
font-weight: bold;
color: #333;
transform: translate(-50%, -50%);
}
.number:nth-child(1) { top: 5%; left: 50%; }
.number:nth-child(2) { top: 12%; left: 85%; }
.number:nth-child(3) { top: 50%; left: 95%; }
.number:nth-child(4) { top: 88%; left: 85%; }
.number:nth-child(5) { bottom: 5%; left: 50%; }
.number:nth-child(6) { top: 88%; left: 15%; }
.number:nth-child(7) { top: 50%; left: 5%; }
.number:nth-child(8) { top: 12%; left: 15%; }
.number:nth-child(9) { top: 15%; left: 50%; }
.number:nth-child(10) { top: 25%; left: 25%; }
.number:nth-child(11) { top: 25%; left: 75%; }
.number:nth-child(12) { top: 35%; left: 50%; }
.hand {
position: absolute;
bottom: 50%;
left: 50%;
transform-origin: 50% 100%;
border-radius: 10px;
}
.hour-hand {
width: 6px;
height: 30%;
background: #333;
margin-left: -3px;
z-index: 3;
}
.minute-hand {
width: 4px;
height: 40%;
background: #555;
margin-left: -2px;
z-index: 2;
}
.second-hand {
width: 2px;
height: 45%;
background: #e74c3c;
margin-left: -1px;
z-index: 1;
animation: tick 1s steps(60) infinite;
}
@keyframes tick {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.clock-face {
position: absolute;
width: 100%;
height: 100%;
}
.tick {
position: absolute;
width: 2px;
height: 10px;
background: #999;
left: 50%;
transform-origin: 50% 100%;
}
.tick.major {
height: 20px;
width: 3px;
background: #666;
}
.tick:nth-child(1) { transform: translateX(-50%) rotate(0deg); top: 0; }
.tick:nth-child(2) { transform: translateX(-50%) rotate(6deg); top: 0; }
.tick:nth-child(3) { transform: translateX(-50%) rotate(12deg); top: 0; }
.tick:nth-child(4) { transform: translateX(-50%) rotate(18deg); top: 0; }
.tick:nth-child(5) { transform: translateX(-50%) rotate(24deg); top: 0; }
.tick:nth-child(6) { transform: translateX(-50%) rotate(30deg); top: 0; }
.tick:nth-child(7) { transform: translateX(-50%) rotate(36deg); top: 0; }
.tick:nth-child(8) { transform: translateX(-50%) rotate(42deg); top: 0; }
.tick:nth-child(9) { transform: translateX(-50%) rotate(48deg); top: 0; }
.tick:nth-child(10) { transform: translateX(-50%) rotate(54deg); top: 0; }
.tick:nth-child(11) { transform: translateX(-50%) rotate(60deg); top: 0; }
.tick:nth-child(12) { transform: translateX(-50%) rotate(66deg); top: 0; }
.tick:nth-child(13) { transform: translateX(-50%) rotate(72deg); top: 0; }
.tick:nth-child(14) { transform: translateX(-50%) rotate(78deg); top: 0; }
.tick:nth-child(15) { transform: translateX(-50%) rotate(84deg); top: 0; }
.tick:nth-child(16) { transform: translateX(-50%) rotate(90deg); top: 0; }
.tick:nth-child(17) { transform: translateX(-50%) rotate(96deg); top: 0; }
.tick:nth-child(18) { transform: translateX(-50%) rotate(102deg); top: 0; }
.tick:nth-child(19) { transform: translateX(-50%) rotate(108deg); top: 0; }
.tick:nth-child(20) { transform: translateX(-50%) rotate(114deg); top: 0; }
.tick:nth-child(21) { transform: translateX(-50%) rotate(120deg); top: 0; }
.tick:nth-child(22) { transform: translateX(-50%) rotate(126deg); top: 0; }
.tick:nth-child(23) { transform: translateX(-50%) rotate(132deg); top: 0; }
.tick:nth-child(24) { transform: translateX(-50%) rotate(138deg); top: 0; }
.tick:nth-child(25) { transform: translateX(-50%) rotate(144deg); top: 0; }
.tick:nth-child(26) { transform: translateX(-50%) rotate(150deg); top: 0; }
.tick:nth-child(27) { transform: translateX(-50%) rotate(156deg); top: 0; }
.tick:nth-child(28) { transform: translateX(-50%) rotate(162deg); top: 0; }
.tick:nth-child(29) { transform: translateX(-50%) rotate(168deg); top: 0; }
.tick:nth-child(30) { transform: translateX(-50%) rotate(174deg); top: 0; }
.tick:nth-child(31) { transform: translateX(-50%) rotate(180deg); top: 0; }
.tick:nth-child(32) { transform: translateX(-50%) rotate(186deg); top: 0; }
.tick:nth-child(33) { transform: translateX(-50%) rotate(192deg); top: 0; }
.tick:nth-child(34) { transform: translateX(-50%) rotate(198deg); top: 0; }
.tick:nth-child(35) { transform: translateX(-50%) rotate(204deg); top: 0; }
.tick:nth-child(36) { transform: translateX(-50%) rotate(210deg); top: 0; }
.tick:nth-child(37) { transform: translateX(-50%) rotate(216deg); top: 0; }
.tick:nth-child(38) { transform: translateX(-50%) rotate(222deg); top: 0; }
.tick:nth-child(39) { transform: translateX(-50%) rotate(228deg); top: 0; }
.tick:nth-child(40) { transform: translateX(-50%) rotate(234deg); top: 0; }
.tick:nth-child(41) { transform: translateX(-50%) rotate(240deg); top: 0; }
.tick:nth-child(42) { transform: translateX(-50%) rotate(246deg); top: 0; }
.tick:nth-child(43) { transform: translateX(-50%) rotate(252deg); top: 0; }
.tick:nth-child(44) { transform: translateX(-50%) rotate(258deg); top: 0; }
.tick:nth-child(45) { transform: translateX(-50%) rotate(264deg); top: 0; }
.tick:nth-child(46) { transform: translateX(-50%) rotate(270deg); top: 0; }
.tick:nth-child(47) { transform: translateX(-50%) rotate(276deg); top: 0; }
.tick:nth-child(48) { transform: translateX(-50%) rotate(282deg); top: 0; }
.tick:nth-child(49) { transform: translateX(-50%) rotate(288deg); top: 0; }
.tick:nth-child(50) { transform: translateX(-50%) rotate(294deg); top: 0; }
.tick:nth-child(51) { transform: translateX(-50%) rotate(300deg); top: 0; }
.tick:nth-child(52) { transform: translateX(-50%) rotate(306deg); top: 0; }
.tick:nth-child(53) { transform: translateX(-50%) rotate(312deg); top: 0; }
.tick:nth-child(54) { transform: translateX(-50%) rotate(318deg); top: 0; }
.tick:nth-child(55) { transform: translateX(-50%) rotate(324deg); top: 0; }
.tick:nth-child(56) { transform: translateX(-50%) rotate(330deg); top: 0; }
.tick:nth-child(57) { transform: translateX(-50%) rotate(336deg); top: 0; }
.tick:nth-child(58) { transform: translateX(-50%) rotate(342deg); top: 0; }
.tick:nth-child(59) { transform: translateX(-50%) rotate(348deg); top: 0; }
.tick:nth-child(60) { transform: translateX(-50%) rotate(354deg); top: 0; }
@media (max-width: 600px) {
.number {
font-size: 1em;
}
}
</style>
</head>
<body>
<div class="clock-container">
<div class="clock">
<div class="clock-face">
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick major"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
<div class="tick"></div>
</div>
<div class="number">1</div>
<div class="number">2</div>
<div class="number">3</div>
<div class="number">4</div>
<div class="number">5</div>
<div class="number">6</div>
<div class="number">7</div>
<div class="number">8</div>
<div class="number">9</div>
<div class="number">10</div>
<div class="number">11</div>
<div class="number">12</div>
<div class="hand hour-hand" id="hourHand"></div>
<div class="hand minute-hand" id="minuteHand"></div>
<div class="hand second-hand" id="secondHand"></div>
</div>
</div>
<script>
// Set the time to 3:45:20
const hours = 3;
const minutes = 45;
const seconds = 20;
// Calculate rotations
const hourRotation = (hours % 12) * 30 + minutes * 0.5;
const minuteRotation = minutes * 6 + seconds * 0.1;
const secondRotation = seconds * 6;
// Apply rotations
document.getElementById('hourHand').style.transform = `rotate(${hourRotation}deg)`;
document.getElementById('minuteHand').style.transform = `rotate(${minuteRotation}deg)`;
document.getElementById('secondHand').style.transform = `rotate(${secondRotation}deg)`;
// Add continuous minute and hour hand updates
setInterval(() => {
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
const hourRotation = (hours % 12) * 30 + minutes * 0.5;
const minuteRotation = minutes * 6 + seconds * 0.1;
document.getElementById('hourHand').style.transform = `rotate(${hourRotation}deg)`;
document.getElementById('minuteHand').style.transform = `rotate(${minuteRotation}deg)`;
}, 1000);
</script>
<script>
// Set the time to 3:45:20
const hours = 3;
const minutes = 45;
const seconds = 20;
// Calculate rotations
const hourRotation = (hours % 12) * 30 + minutes * 0.5;
const minuteRotation = minutes * 6 + seconds * 0.1;
const secondRotation = seconds * 6;
// Apply rotations
document.getElementById('hourHand').style.transform = `rotate(${hourRotation}deg)`;
document.getElementById('minuteHand').style.transform = `rotate(${minuteRotation}deg)`;
document.getElementById('secondHand').style.transform = `rotate(${secondRotation}deg)`;
// Add continuous minute and hour hand updates
setInterval(() => {
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
const hourRotation = (hours % 12) * 30 + minutes * 0.5;
const minuteRotation = minutes * 6 + seconds * 0.1;
document.getElementById('hourHand').style.transform = `rotate(${hourRotation}deg)`;
document.getElementById('minuteHand').style.transform = `rotate(${minuteRotation}deg)`;
}, 1000);
</script>