hour number should not touch the line - Initial Deployment
Browse files- README.md +7 -5
- index.html +246 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: clock
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,246 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Beautiful Analog Clock</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
.clock-face {
|
| 11 |
+
background: radial-gradient(circle at center, #f9f9f9, #e0e0e0);
|
| 12 |
+
box-shadow:
|
| 13 |
+
0 0 0 8px rgba(255,255,255,0.8),
|
| 14 |
+
inset 0 0 15px rgba(0,0,0,0.1),
|
| 15 |
+
0 15px 30px rgba(0,0,0,0.15);
|
| 16 |
+
border: 1px solid rgba(255,255,255,0.5);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.clock-center {
|
| 20 |
+
width: 16px;
|
| 21 |
+
height: 16px;
|
| 22 |
+
position: absolute;
|
| 23 |
+
top: 50%;
|
| 24 |
+
left: 50%;
|
| 25 |
+
transform: translate(-50%, -50%);
|
| 26 |
+
border-radius: 50%;
|
| 27 |
+
background: radial-gradient(circle at 30% 30%, #fff, #c0392b);
|
| 28 |
+
border: 2px solid #2c3e50;
|
| 29 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.3);
|
| 30 |
+
z-index: 10;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.hour-hand, .minute-hand, .second-hand {
|
| 34 |
+
transform-origin: 50% 100%;
|
| 35 |
+
position: absolute;
|
| 36 |
+
top: 50%;
|
| 37 |
+
left: 50%;
|
| 38 |
+
border-radius: 10px;
|
| 39 |
+
transition: transform 0.5s cubic-bezier(0.4, 2.3, 0.3, 1);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.hour-hand {
|
| 43 |
+
width: 8px;
|
| 44 |
+
height: 30%;
|
| 45 |
+
margin-top: -30%;
|
| 46 |
+
margin-left: -4px;
|
| 47 |
+
background: linear-gradient(to top, #2c3e50, #34495e);
|
| 48 |
+
box-shadow: 0 0 5px rgba(0,0,0,0.3);
|
| 49 |
+
border-radius: 8px;
|
| 50 |
+
z-index: 3;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.minute-hand {
|
| 54 |
+
width: 5px;
|
| 55 |
+
height: 40%;
|
| 56 |
+
margin-top: -40%;
|
| 57 |
+
margin-left: -2.5px;
|
| 58 |
+
background: linear-gradient(to top, #34495e, #7f8c8d);
|
| 59 |
+
box-shadow: 0 0 5px rgba(0,0,0,0.2);
|
| 60 |
+
border-radius: 8px;
|
| 61 |
+
z-index: 4;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.second-hand {
|
| 65 |
+
width: 2px;
|
| 66 |
+
height: 45%;
|
| 67 |
+
margin-top: -45%;
|
| 68 |
+
margin-left: -1px;
|
| 69 |
+
background: linear-gradient(to top, #e74c3c, #c0392b);
|
| 70 |
+
box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
|
| 71 |
+
z-index: 5;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.tick {
|
| 75 |
+
position: absolute;
|
| 76 |
+
width: 100%;
|
| 77 |
+
height: 100%;
|
| 78 |
+
text-align: center;
|
| 79 |
+
font-weight: bold;
|
| 80 |
+
color: #333;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.tick::after {
|
| 84 |
+
content: '';
|
| 85 |
+
position: absolute;
|
| 86 |
+
top: 10px;
|
| 87 |
+
left: 50%;
|
| 88 |
+
transform: translateX(-50%);
|
| 89 |
+
width: 3px;
|
| 90 |
+
height: 15px;
|
| 91 |
+
background: linear-gradient(to bottom, #2c3e50, #7f8c8d);
|
| 92 |
+
border-radius: 3px;
|
| 93 |
+
box-shadow: 0 0 3px rgba(0,0,0,0.2);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.tick-number {
|
| 97 |
+
position: absolute;
|
| 98 |
+
width: 30px;
|
| 99 |
+
height: 30px;
|
| 100 |
+
text-align: center;
|
| 101 |
+
font-weight: bold;
|
| 102 |
+
color: #333;
|
| 103 |
+
font-size: 1.2rem;
|
| 104 |
+
transform-origin: center center;
|
| 105 |
+
line-height: 30px;
|
| 106 |
+
left: 50%;
|
| 107 |
+
top: 50%;
|
| 108 |
+
margin-left: -15px;
|
| 109 |
+
margin-top: -15px;
|
| 110 |
+
display: flex;
|
| 111 |
+
align-items: center;
|
| 112 |
+
justify-content: center;
|
| 113 |
+
transform: translate(0, -5px);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
@keyframes rotate {
|
| 117 |
+
100% {
|
| 118 |
+
transform: rotate(360deg);
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.clock-decoration {
|
| 123 |
+
position: absolute;
|
| 124 |
+
width: 100%;
|
| 125 |
+
height: 100%;
|
| 126 |
+
border-radius: 50%;
|
| 127 |
+
background: radial-gradient(circle at center, transparent 60%, rgba(255,255,255,0.1) 60.5%, transparent 61%);
|
| 128 |
+
}
|
| 129 |
+
</style>
|
| 130 |
+
</head>
|
| 131 |
+
<body class="bg-gradient-to-br from-gray-100 to-gray-300 min-h-screen flex items-center justify-center p-4">
|
| 132 |
+
<div class="relative">
|
| 133 |
+
<!-- Clock container -->
|
| 134 |
+
<div class="clock-face bg-white rounded-full shadow-xl relative" style="width: 300px; height: 300px;">
|
| 135 |
+
<!-- Decorative elements -->
|
| 136 |
+
<div class="clock-decoration"></div>
|
| 137 |
+
|
| 138 |
+
<!-- Clock center -->
|
| 139 |
+
<div class="clock-center"></div>
|
| 140 |
+
|
| 141 |
+
<!-- Clock hands -->
|
| 142 |
+
<div class="hour-hand" id="hour-hand"></div>
|
| 143 |
+
<div class="minute-hand" id="minute-hand"></div>
|
| 144 |
+
<div class="second-hand" id="second-hand"></div>
|
| 145 |
+
|
| 146 |
+
<!-- Clock ticks and numbers -->
|
| 147 |
+
<div class="absolute inset-0">
|
| 148 |
+
<!-- Numbers -->
|
| 149 |
+
<div class="tick-number" style="transform: rotate(30deg) translate(0, -110px) rotate(-30deg); transform-origin: center center;">1</div>
|
| 150 |
+
<div class="tick-number" style="transform: rotate(60deg) translate(0, -110px) rotate(-60deg); transform-origin: center center;">2</div>
|
| 151 |
+
<div class="tick-number" style="transform: rotate(90deg) translate(0, -110px) rotate(-90deg); transform-origin: center center;">3</div>
|
| 152 |
+
<div class="tick-number" style="transform: rotate(120deg) translate(0, -110px) rotate(-120deg); transform-origin: center center;">4</div>
|
| 153 |
+
<div class="tick-number" style="transform: rotate(150deg) translate(0, -110px) rotate(-150deg); transform-origin: center center;">5</div>
|
| 154 |
+
<div class="tick-number" style="transform: rotate(180deg) translate(0, -110px) rotate(-180deg); transform-origin: center center;">6</div>
|
| 155 |
+
<div class="tick-number" style="transform: rotate(210deg) translate(0, -110px) rotate(-210deg); transform-origin: center center;">7</div>
|
| 156 |
+
<div class="tick-number" style="transform: rotate(240deg) translate(0, -110px) rotate(-240deg); transform-origin: center center;">8</div>
|
| 157 |
+
<div class="tick-number" style="transform: rotate(270deg) translate(0, -110px) rotate(-270deg); transform-origin: center center;">9</div>
|
| 158 |
+
<div class="tick-number" style="transform: rotate(300deg) translate(0, -110px) rotate(-300deg); transform-origin: center center;">10</div>
|
| 159 |
+
<div class="tick-number" style="transform: rotate(330deg) translate(0, -110px) rotate(-330deg); transform-origin: center center;">11</div>
|
| 160 |
+
<div class="tick-number" style="transform: rotate(0deg) translate(0, -110px) rotate(0deg); transform-origin: center center;">12</div>
|
| 161 |
+
|
| 162 |
+
<!-- Ticks -->
|
| 163 |
+
<div class="tick" style="transform: rotate(0deg);"></div>
|
| 164 |
+
<div class="tick" style="transform: rotate(30deg);"></div>
|
| 165 |
+
<div class="tick" style="transform: rotate(60deg);"></div>
|
| 166 |
+
<div class="tick" style="transform: rotate(90deg);"></div>
|
| 167 |
+
<div class="tick" style="transform: rotate(120deg);"></div>
|
| 168 |
+
<div class="tick" style="transform: rotate(150deg);"></div>
|
| 169 |
+
<div class="tick" style="transform: rotate(180deg);"></div>
|
| 170 |
+
<div class="tick" style="transform: rotate(210deg);"></div>
|
| 171 |
+
<div class="tick" style="transform: rotate(240deg);"></div>
|
| 172 |
+
<div class="tick" style="transform: rotate(270deg);"></div>
|
| 173 |
+
<div class="tick" style="transform: rotate(300deg);"></div>
|
| 174 |
+
<div class="tick" style="transform: rotate(330deg);"></div>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<!-- Digital time display -->
|
| 179 |
+
<div class="mt-8 text-center">
|
| 180 |
+
<div class="text-4xl font-light tracking-wider text-gray-700" id="digital-time">00:00:00</div>
|
| 181 |
+
<div class="text-lg font-medium text-gray-500 mt-3 tracking-wide" id="date-display">Monday, January 1, 2023</div>
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
|
| 185 |
+
<script>
|
| 186 |
+
function updateClock() {
|
| 187 |
+
const now = new Date();
|
| 188 |
+
|
| 189 |
+
// Get time components
|
| 190 |
+
const hours = now.getHours();
|
| 191 |
+
const twelveHourFormat = hours % 12 || 12; // Convert 0 to 12 for 12-hour format
|
| 192 |
+
const minutes = now.getMinutes();
|
| 193 |
+
const seconds = now.getSeconds();
|
| 194 |
+
const milliseconds = now.getMilliseconds();
|
| 195 |
+
|
| 196 |
+
// Announce the hour at the top of each hour
|
| 197 |
+
if (minutes === 0 && seconds === 0) {
|
| 198 |
+
const speech = new SpeechSynthesisUtterance();
|
| 199 |
+
speech.text = `It's ${twelveHourFormat} o'clock`;
|
| 200 |
+
speech.volume = 0.8;
|
| 201 |
+
speech.rate = 0.9;
|
| 202 |
+
speech.pitch = 1;
|
| 203 |
+
window.speechSynthesis.speak(speech);
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
// Calculate angles for clock hands (use twelveHourFormat for display)
|
| 207 |
+
const hourAngle = (twelveHourFormat * 30) + (minutes * 0.5);
|
| 208 |
+
const minuteAngle = (minutes * 6) + (seconds * 0.1);
|
| 209 |
+
const secondAngle = (seconds * 6) + (milliseconds * 0.006);
|
| 210 |
+
|
| 211 |
+
// Update clock hands
|
| 212 |
+
document.getElementById('hour-hand').style.transform = `rotate(${hourAngle}deg)`;
|
| 213 |
+
document.getElementById('minute-hand').style.transform = `rotate(${minuteAngle}deg)`;
|
| 214 |
+
document.getElementById('second-hand').style.transform = `rotate(${secondAngle}deg)`;
|
| 215 |
+
|
| 216 |
+
// Update digital time
|
| 217 |
+
const formattedHours = String(now.getHours()).padStart(2, '0');
|
| 218 |
+
const formattedMinutes = String(minutes).padStart(2, '0');
|
| 219 |
+
const formattedSeconds = String(seconds).padStart(2, '0');
|
| 220 |
+
document.getElementById('digital-time').textContent = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
|
| 221 |
+
|
| 222 |
+
// Update date display
|
| 223 |
+
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
|
| 224 |
+
document.getElementById('date-display').textContent = now.toLocaleDateString('en-US', options);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
// Update clock immediately and then every 50ms for smooth animation
|
| 228 |
+
updateClock();
|
| 229 |
+
setInterval(updateClock, 50);
|
| 230 |
+
|
| 231 |
+
// Add some interactive effects
|
| 232 |
+
const clock = document.querySelector('.clock-face');
|
| 233 |
+
clock.addEventListener('mouseenter', () => {
|
| 234 |
+
clock.classList.add('transform', 'scale-105');
|
| 235 |
+
clock.classList.remove('shadow-xl');
|
| 236 |
+
clock.classList.add('shadow-2xl');
|
| 237 |
+
});
|
| 238 |
+
|
| 239 |
+
clock.addEventListener('mouseleave', () => {
|
| 240 |
+
clock.classList.remove('transform', 'scale-105');
|
| 241 |
+
clock.classList.add('shadow-xl');
|
| 242 |
+
clock.classList.remove('shadow-2xl');
|
| 243 |
+
});
|
| 244 |
+
</script>
|
| 245 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ionel/clock" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 246 |
+
</html>
|