A beautiful, feature-rich stopwatch application built with vanilla JavaScript, featuring a modern glassmorphism design with dark/light theme support.
- Precise Timing: Accurate stopwatch with millisecond precision
- Start/Stop/Reset: Full control over timer operations
- Lap Recording: Record and track multiple lap times
- Lap Analysis: Compare lap times with visual indicators (faster/slower)
- Glassmorphism UI: Beautiful frosted glass effect design
- Dark/Light Theme: Toggle between themes with persistent storage
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Smooth Animations: Fluid transitions and hover effects
- Running Animation: Visual feedback when timer is active
- Keyboard Shortcuts:
Space
- Start/Stop timerL
- Record lapR
- Reset timerT
- Toggle theme
- Visual Feedback: Button states, animations, and hover effects
- Persistent Settings: Theme preference saved in localStorage
- A modern web browser (Chrome, Firefox, Safari, Edge)
- No additional dependencies required!
- Clone or download this repository
- Navigate to the project directory
- Open
index.html
in your web browser
# If you have a local server, you can also run:
python -m http.server 8000
# or
npx serve .
- Start: Click the green "Start" button or press
Space
- Stop: Click the red "Stop" button or press
Space
again - Reset: Click the orange "Reset" button or press
R
- Lap: Click the purple "Lap" button or press
L
(only when running)
- Record lap times while the timer is running
- View lap history with timing comparisons
- See visual indicators for faster/slower laps
- Lap count is displayed in the header
- Click the moon/sun icon in the top-right corner
- Press
T
to toggle between light and dark themes - Theme preference is automatically saved
- HTML5: Semantic markup structure
- CSS3:
- Glassmorphism design
- CSS Grid and Flexbox
- CSS Variables for theming
- Responsive design with media queries
- Smooth animations and transitions
- Vanilla JavaScript:
- ES6+ features
- DOM manipulation
- Event handling
- Local storage for persistence
- Timer precision with
Date.now()
StopWatch/
├── index.html # Main HTML file
├── style.css # CSS styles and animations
├── index.js # JavaScript functionality
└── README.md # This file
The stopwatch uses Date.now()
for high-precision timing, updating every 10ms for smooth display while maintaining accuracy.
Modern glassmorphism effect achieved using:
backdrop-filter: blur()
- Semi-transparent backgrounds
- Subtle borders and shadows
- Smooth transitions
- Mobile-first approach
- Flexible layouts using CSS Grid and Flexbox
- Adaptive font sizes and spacing
- Touch-friendly button sizes
- CSS custom properties for easy theming
- Smooth transitions between themes
- Persistent storage using localStorage
- Automatic theme detection
This stopwatch emphasizes:
- Simplicity: Clean, uncluttered interface
- Functionality: All essential features without bloat
- Aesthetics: Modern design that's pleasing to use
- Accessibility: Keyboard shortcuts and clear visual feedback
- Performance: Lightweight and fast
You can easily add new themes by:
- Adding new CSS custom properties in
:root
- Creating new
[data-theme="your-theme"]
rules - Updating the theme toggle logic in JavaScript
All colors are defined as CSS custom properties in the :root
selector, making it easy to customize the entire color scheme.
- ✅ Chrome 60+
- ✅ Firefox 55+
- ✅ Safari 12+
- ✅ Edge 79+
Feel free to contribute to this project by:
- Reporting bugs
- Suggesting new features
- Submitting pull requests
- Improving documentation
This project is open source and available under the MIT License.
- Font Awesome for the beautiful icons
- Google Fonts for the Inter font family
- The glassmorphism design community for inspiration
Enjoy timing your activities with style! ⏱️✨