You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Stunning, Feature-Rich Analog & Digital Clock Experience
A beautiful, fully responsive, real-time analog + digital clock built with pure HTML, CSS & JavaScript.No frameworks. No dependencies. Just pure craftsmanship.
Sudhir's Clock isn't just a clock โ it's a visual experience. Built from scratch with zero dependencies, it combines a mesmerizing multi-ring analog clock with powerful utilities like stopwatch, timer, and world clocks โ all wrapped in a gorgeous glassmorphic UI that adapts perfectly to every screen size.
โจ Features
๐ Core Clock
Feature
Description
Multi-Ring Analog Clock
7 concentric rings showing seconds, minutes, hours, days, months, years, and weekdays
Digital Time Display
Large, beautiful digital readout with blinking colons and gradient text
Real-Time Rotation
Smooth CSS transitions with cubic-bezier easing for fluid ring movement
12/24 Hour Format
Toggle between formats instantly โ clock rings adapt dynamically
20% Glass Overlay
Subtle depth effect without hiding the clock โ every number stays visible
Rotating Glow Ring
Animated outer ring with accent-colored conic gradient
Active Number Highlight
Current values glow with accent color and scale animation
โฑ๏ธ Stopwatch
Feature
Description
Millisecond Precision
Accurate to the millisecond with ~31ms refresh rate
Lap Recording
Record unlimited laps with individual timestamps
Start/Pause/Resume
Full playback control with visual state indicators
Lap History
Scrollable list with highlighted best lap
โณ Countdown Timer
Feature
Description
Custom Duration
Set hours, minutes, and seconds independently
Vibration Alert
Haptic feedback on mobile when timer completes
Toast Notification
Visual notification with accent-colored alert
Pause/Resume
Full control without losing countdown state
๐ World Clocks
Feature
Description
8 Major Cities
New York, London, Tokyo, Dubai, Sydney, Paris, Mumbai, Singapore
Screen reader support for all interactive elements
Keyboard Shortcuts
F = Fullscreen, S = Settings, Esc = Close
Focus Visible
Clear focus indicators for keyboard navigation
Reduced Motion
Respects prefers-reduced-motion media query
High Contrast
Enhanced borders and text for prefers-contrast: high
Print Styles
Clean, ink-friendly output when printing
๐ธ Screenshots
๐ฅ๏ธ Desktop View
๐ฑ Mobile View
๐จ Theme Showcase
๐ Quick Start
Option 1: Direct Download
# Clone the repository
git clone https://github.com/SudhirDevOps1/CLOCK.git
# Navigate to directorycd CLOCK
# Open in browser (no build step needed!)
open index.html
Option 2: CDN / Direct Link
<!-- Just drop this single file into your project --><iframesrc="https://sudhir-clock.vercel.app" width="100%" height="600"></iframe>
Each ring's size is controlled by --cd (diameter) and --cf (font-size):
/* Example: Make the seconds ring larger */
.clock>div:nth-of-type(2) {
--cd:calc(var(--clock-size) -60px); /* diameter */--cf:0.8rem; /* font size */
}
Adding a New Clock Ring
<!-- Add inside .clock, before center-btn --><div><divdata-clock="custom" data-numbers="10" class="clock-face"></div></div>
// Add case in drawClockFaces() switch:case'custom':
vals=['A','B','C','D','E','F','G','H','I','J'];cv=someValue;break;// Add case in rotateClockFaces() tick():case'custom':
val=someComputedValue;break;
Adding a New World Clock City
// Add to the cities array:constcities=[// ... existing cities{city: 'Berlin',tz: 'Europe/Berlin',e: '๐ฉ๐ช'},];
Rebuilds all clock ring elements (call after locale/format change)
rotateClockFaces()
Starts the continuous rotation animation loop
updateDigital()
Updates digital display, info cards, and progress bars
updateWorld()
Refreshes all world clock displays
updateGreeting()
Sets greeting based on time of day
toast(msg, icon)
Shows a toast notification
openPanel() / closePanel()
Controls settings panel
openLang() / closeLang()
Controls language dialog
toggleFS()
Toggles fullscreen mode
setFormat(bool)
Sets 12/24 hour format
Keyboard Shortcuts
Key
Action
F
Toggle fullscreen
S
Open settings panel
Esc
Close any open panel/dialog
Events Handled
Event
Handler
scroll
Auto-hide topbar, show scroll-to-top
resize
Debounced clock redraw
orientationchange
Delayed clock redraw
visibilitychange
Refresh data when tab becomes visible
mousemove (buttons)
Radial gradient ripple effect
๐ Supported Languages
๐ธ๐ฆ Arabic
๐จ๐ฟ Czech
๐ฉ๐ฐ Danish
๐ฉ๐ช German
๐ฌ๐ท Greek
๐บ๐ธ English (US)
๐ฌ๐ง English (UK)
๐ช๐ธ Spanish
๐ฒ๐ฝ Spanish (MX)
๐ซ๐ฎ Finnish
๐จ๐ฆ French (CA)
๐ซ๐ท French
๐ฎ๐ฑ Hebrew
๐ฎ๐ณ Hindi
๐ญ๐บ Hungarian
๐ฎ๐น Italian
๐ฏ๐ต Japanese
๐ฐ๐ท Korean
๐ณ๐ฑ Dutch
๐ณ๐ด Norwegian
๐ต๐ฑ Polish
๐ง๐ท Portuguese (BR)
๐ต๐น Portuguese
๐ท๐ด Romanian
๐ท๐บ Russian
๐ธ๐ช Swedish
๐น๐ญ Thai
๐น๐ท Turkish
๐ป๐ณ Vietnamese
๐จ๐ณ Chinese
๐ฑ Browser Support
Browser
Version
Status
Chrome
90+
โ Full Support
Firefox
88+
โ Full Support
Safari
15+
โ Full Support
Edge
90+
โ Full Support
Opera
76+
โ Full Support
Samsung Internet
15+
โ Full Support
iOS Safari
15+
โ Full Support
Chrome Android
90+
โ Full Support
Progressive Enhancement
Feature
Fallback
backdrop-filter
Solid background color
dvh units
Falls back to vh
@starting-style
No animation on dialog open
env(safe-area-inset)
Zero padding
Fullscreen API
Button hidden
Vibration API
Silent fallback
navigator.language
Defaults to en-US
โก Performance Metrics
Metric
Value
First Contentful Paint
~0.4s
Largest Contentful Paint
~0.8s
Total Blocking Time
~10ms
Cumulative Layout Shift
0
Bundle Size
~28KB (single file, no gzip)
Dependencies
0
DOM Nodes
~450 (with all rings)
Animation Frames
Stable 60fps
Memory Usage
~8MB
Lighthouse Score
95+ (Performance)
๐ ๏ธ Development
Prerequisites
Any modern web browser
A text editor (VS Code recommended)
Optional: Live Server extension for hot reload
Local Development
# Clone
git clone https://github.com/SudhirDevOps1/CLOCK.git
cd CLOCK
# Start with VS Code Live Server# Or use any static server:
npx serve .# or
python -m http.server 8080
# or
php -S localhost:8080
Code Style
CSS: BEM-inspired naming, CSS custom properties for theming
JavaScript: IIFE pattern, $() helper for DOM queries, const/let only
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
Contribution Ideas
Area
Ideas
๐จ Themes
New color schemes, light mode, dark OLED mode
๐ Languages
Add more language packs, RTL improvements
๐ World Clocks
Searchable city picker, timezone map
โก Performance
Web Worker for calculations, virtual scrolling
โฟ Accessibility
Screen reader improvements, voice control
๐ฑ Mobile
Gesture controls, haptic feedback improvements
๐งช Testing
Unit tests, E2E tests, visual regression tests
๐ Documentation
Tutorials, video demos, API examples
๐ License
This project is licensed under the MIT License โ see the LICENSE file for details.
MIT License
Copyright (c) 2024 Sudhir Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.