Web link - https://avinash201199.github.io/stopwatch/
A modern, feature-rich stopwatch application with a beautiful UI, dark mode support, and advanced functionality. Built with vanilla JavaScript, HTML, and CSS.
Time is the most essential part of everyone's life and keeping track of this time is equally important. This stopwatch represents the time in HH:MM:SS:MS (hour:minute:second:millisecond) format, making it easy to keep track of your time with precision.
- HTML5 - Semantic markup
- CSS3 - Modern styling with glassmorphism effects
- JavaScript (ES6+) - Vanilla JS for optimal performance
- Bootstrap 5 - Responsive grid system
- Font Awesome - Beautiful icons
- β²οΈ Precise Time Display - Shows time in HH:MM:SS:MS format
βΆοΈ Start/Pause - Toggle stopwatch with smooth animations- π Reset - Clear all time and lap records
- π Lap Timer - Record multiple lap times with differences
- ποΈ Clear Laps - Remove all lap records
- π¨ Theme Switching - Seamlessly switch between dark and light themes
- πΎ Persistent Preference - Your theme choice is saved automatically
- π Glassmorphism UI - Beautiful frosted glass effects in both modes
- πΏ Auto-Save - Stopwatch state is saved automatically
- π Resume on Reload - Continue where you left off (24-hour persistence)
- π― Smart Recovery - Only restores recent sessions
- π΅ Start Sound - Plays when stopwatch starts
- βΈοΈ Pause Beep - Confirmation sound on pause
- π΄ Reset Beep - Audio feedback on reset
- π Lap Beep - Sound when recording laps
- π Optional Ticking - Enable/disable ticking sound
- Space - Start/Pause the stopwatch
- R - Reset the stopwatch
- L - Record a lap
- Enter - Record a lap (alternative)
- Backspace - Reset (alternative)
- P - Start/Pause (alternative)
- Numpad 0 - Clear all laps
- π± Mobile Optimized - Perfect on phones and tablets
- π» Desktop Ready - Beautiful on large screens
- π Adaptive Layout - Adjusts to any screen size
- π¨ Touch Friendly - Large, easy-to-tap buttons
- π Rounded Buttons - Smooth, modern button design
- π Shadow Effects - Depth and dimension
- π¬ Smooth Animations - Polished transitions
- πΌοΈ Video Background - Ambient lofi video backdrop
- β¨ Glassmorphism - Frosted glass aesthetic
- π Pomodoro Timer - Focus with the classic Pomodoro technique
- β²οΈ Custom Timer - Set your own countdown with alerts
Simply visit https://avinash201199.github.io/stopwatch/ to use the stopwatch immediately!
-
Clone the repository
git clone https://github.com/avinash201199/stopwatch.git cd stopwatch -
Open in browser
# Simply open index.html in your browser # Or use a local server: python -m http.server 8000 # Then visit http://localhost:8000
-
Start using!
- Click Start or press Space to begin
- Press L to record laps
- Press R to reset
- Toggle dark mode with the switch in the navbar
- Start/Pause: Click the Start button or press
Space - Reset: Click Reset or press
Rto clear everything - Record Lap: Click Lap or press
Lwhile running - Clear Laps: Click Clear Lap to remove all lap records
- Dark Mode: Toggle the switch in the top-right corner
| Key | Action |
|---|---|
Space |
Start/Pause |
R |
Reset |
L |
Record Lap |
Enter |
Record Lap |
Backspace |
Reset |
P |
Start/Pause |
Numpad 0 |
Clear Laps |
Interface of the StopWatch
StopWatch Started
Dark-Mode On
Pomodoro Timer
Custom Timer
We welcome contributions! Please follow these guidelines:
- Star this repository by pressing the top-rightmost button to start your incredible journey.
- Create an issue describing how you want to contribute to this project.
-
Then fork this repository by using the Fork button on top-right of your screen.
-
In the forked repository add your changes.
NOTE: commands are to be executed on Linux, Mac, and Windows(using Powershell)
- You need to clone (download) it to a local machine using
$ git clone https://github.com/Your_Username/stopwatch.gitThis makes a local copy of the repository in your machine.
- Then make a pull request with the issue number.
- Once you have cloned the stopwatch repository in Github, move to that folder first using the change directory command on Linux, Mac, and Windows(PowerShell to be used).
# This will change the directory to a folder stopwatch
$ cd stopwatchMove to this folder for all other commands.
- Run the following commands to see that your local copy has a reference to your forked remote repository in Github

$ git remote -v
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git (push)Now, let's add a reference to the original stopwatch repository using
$ git remote add upstream https://github.com/avinash201199/stopwatch.gitThis adds a new remote named upstream.
See the changes using
$ git remote -v
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git (push)
upstream https://github.com/Remote_Username/stopwatch.git (fetch)
upstream https://github.com/Remote_Username/stopwatch.git (push)In your case, you will see
$ git remote -V
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git(push)
upstream https://github.com/ietebitmesra/stopwatch.git (fetch)
upstream https://github.com/ietebitmesra/stopwatch.git (push)- Always keep your local copy of the repository updated with the original repository. Before making any changes and/or in an appropriate interval, run the following commands carefully to update your local repository.
# Fetch all remote repositories and delete any deleted remote branches ``
$ git fetch --all --prune# Switch to `master` branch
$ git checkout master# Reset local `master` branch to match the `upstream` repository's `master` branch
$ git reset --hard upstream/master# Push changes to your forked `stopwatch` repo
$ git push origin master- Once you have completed these steps, you are ready to start contributing by checking our Help Wanted Issues and creating pull requests.
- Whenever you are going to contribute. Please create a separate branch using command and keep your master branch clean (i.e. synced with remote branch).
# It will create a new branch with name Branch_Name and switch to branch Folder_Name
$ git checkout -b BranchName- Create a separate branch for contribution and try to use the same name of the branch as of folder.
To switch to the desired branch
# To switch from one folder to other
$ git checkout BranchName
To add the changes to the branch. Use# To add all files to branch Folder_Name
$ git add .
Type in a message relevant for the code reviewer using# This message gets associated with all files you have changed
$ git commit -m 'relevant message'Now, Push your awesome work to your remote repository using
# To push your work to your remote repository
$ git push -u origin BranchName- Finally, go to your repository in the browser and click on compare and pull requests. Then add a title and description to your pull request that explains your precious efforts
stopwatch/
βββ index.html # Main stopwatch page
βββ script.js # Core stopwatch logic with localStorage
βββ style.css # Styling with glassmorphism effects
βββ audio/ # Sound effects
β βββ beep_cut.mp3
β βββ sound_trim.mp3
β βββ ticking.mp3
βββ img/ # Images and screenshots
βββ pomodoro/ # Pomodoro timer feature
βββ custom_timer/ # Custom countdown timer
βββ README.md # This file
- β Local Storage Support - Never lose your progress on reload
- β Enhanced Sound Effects - Start, pause, reset, and lap sounds
- β Improved Keyboard Shortcuts - Space, R, L for quick actions
- β Code Cleanup - Better organization and comments
- β Modern UI Updates - Enhanced glassmorphism and animations
- β Persistent Dark Mode - Your theme preference is saved
- β Updated Documentation - Comprehensive README with usage guide
- Quick Start: Press
Spaceto instantly start the stopwatch - Rapid Laps: Use
Lkey for quick lap recording during activities - Theme Preference: Your dark/light mode choice persists across sessions
- Auto-Save: The stopwatch automatically saves your progress every second
- Keyboard Master: Learn the shortcuts for a seamless experience
- Video background may not load on slower connections (graceful fallback)
- Audio may require user interaction on some browsers due to autoplay policies
- LocalStorage limited to 24-hour persistence (by design)
This project is licensed under the MIT License - see the LICENSE file for details.
- Original creator: Avinash Singh
- Enhanced by: Hector JS and the open-source community
- Icons: Font Awesome
- Fonts: Google Fonts
- Video: Lofi background animation
Thank you to all the amazing contributors who have helped make this project better! π
β If you like this project, please give it a star! β
Made with β€οΈ by the open-source community





