Skip to content

avinash201199/stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

464 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โฑ๏ธ Stopwatch by Hector JS ๐ŸŽ‰

Live Demo License: MIT Hacktoberfest 2025

A modern, feature-rich stopwatch with beautiful UI, dark mode support, and advanced functionality. Built with vanilla JavaScript, HTML, and CSS.


๐ŸŽฏ Overview

Time is precious, and tracking it precisely is essential.
This Stopwatch displays time in HH:MM:SS:MS (hour:minute:second:millisecond) format.
It includes Pomodoro timers, custom countdown timers, and persistent dark/light mode.

Stopwatch Preview


๐Ÿ› ๏ธ Tech Stack

  • HTML5 - Semantic markup
  • CSS3 - Modern styling with glassmorphism & animations
  • JavaScript (ES6+) - Vanilla JS for optimal performance
  • Bootstrap 5 - Responsive grid system
  • Font Awesome - Beautiful icons
  • Audio - Start, pause, reset, lap sounds

โœจ Features

Core Stopwatch

  • โฒ๏ธ Precise Time Display: HH:MM:SS:MS
  • โ–ถ๏ธ Start / Pause: Smooth toggle
  • ๐Ÿ”„ Reset: Clear time and laps
  • ๐Ÿ Lap Timer: Record multiple laps
  • ๐Ÿ—‘๏ธ Clear Laps

Dark / Light Mode

  • ๐ŸŒ™ Seamless theme switching
  • ๐Ÿ’พ Persistent Preference saved automatically
  • ๐ŸŒˆ Glassmorphism UI for a modern look

Local Storage & Persistence

  • ๐Ÿ’ฟ Auto-save stopwatch state
  • ๐Ÿ”„ Resume on reload (up to 24 hours)
  • ๐ŸŽฏ Smart Recovery restores recent sessions

Sound & Interactions

  • ๐Ÿ”Š Optional ticking sound
  • ๐ŸŽต Audio feedback for start, pause, reset, laps
  • โŒจ๏ธ Keyboard Shortcuts:
    • Space โ†’ Start/Pause
    • R โ†’ Reset
    • L / Enter โ†’ Record Lap
    • Backspace โ†’ Reset
    • P โ†’ Start/Pause (alternative)
    • Numpad 0 โ†’ Clear Laps

Additional Timers

  • ๐Ÿ… Pomodoro Timer
  • โฒ๏ธ Custom Countdown Timer

Responsive & Modern UI

  • ๐Ÿ“ฑ Mobile & tablet optimized
  • ๐Ÿ’ป Desktop ready with adaptive layout
  • ๐ŸŽจ Touch-friendly buttons
  • ๐ŸŒŸ Rounded buttons with smooth animations
  • ๐Ÿ–ผ๏ธ Optional lofi video background

๐Ÿš€ Quick Start

1๏ธโƒฃ Live Demo

Open Live Site

2๏ธโƒฃ Run Locally

# Clone the repository
git clone https://github.com/avinash201199/stopwatch.git
cd stopwatch

# Open index.html in browser
# Or run a local server
python -m http.server 8000
# Then visit http://localhost:8000


## ๐Ÿš€ Quick Start

### Option 1: Visit the Live Site
Simply visit [https://avinash201199.github.io/stopwatch/](https://avinash201199.github.io/stopwatch/) to use the stopwatch immediately!

### Option 2: Run Locally

1. **Clone the repository**
   ```bash
   git clone https://github.com/avinash201199/stopwatch.git
   cd stopwatch
  1. 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
  2. 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

๐Ÿ“– Usage Guide

Basic Operations

  1. Start/Pause: Click the Start button or press Space
  2. Reset: Click Reset or press R to clear everything
  3. Record Lap: Click Lap or press L while running
  4. Clear Laps: Click Clear Lap to remove all lap records
  5. Dark Mode: Toggle the switch in the top-right corner

Keyboard Shortcuts Cheat Sheet

Key Action
Space Start/Pause
R Reset
L Record Lap
E Export Laps
Ctrl+โ†’ Next Video (NEW!)
Ctrl+โ† Previous Video (NEW!)
Ctrl+1-4 Jump to Video 1-4 (NEW!)
Ctrl+V Toggle Auto-Rotation (NEW!)
Enter Record Lap
Backspace Reset
P Start/Pause
Numpad 0 Clear Laps

๐ŸŽจ Screenshots

Interface of the StopWatch

image

StopWatch Started

image

Dark-Mode On

image

Pomodoro Timer

image

Custom Timer

image

๐Ÿค Contributing

We welcome contributions! Please follow these guidelines:

Note: First create an issue then make a pull request :)

How to be a contributor to the project ๐Ÿ˜Ž

1. Star The Repo ๐ŸŒŸ

  • 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.

2. Fork it ๐Ÿด

  • Then fork this repository by using the Fork button on top-right of your screen.

  • In the forked repository add your changes.

3. Clone it ๐Ÿ‘ฅ

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.git

This 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 stopwatch

Move to this folder for all other commands.

4. Set it up โฌ†๏ธ

  • Run the following commands to see that your local copy has a reference to your forked remote repository in Github :octocat:
$ 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.git

This 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)

5. Sync it โ™ป๏ธ

  • 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

6. Ready Steady Go... ๐Ÿข ๐Ÿ‡

  • Once you have completed these steps, you are ready to start contributing by checking our Help Wanted Issues and creating pull requests.

7. Create a new branch โ€ผ๏ธ

  • 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

8. Pull requests should have screenshots of the changes you have made.

9. Wait for review. โค๏ธ


๐Ÿ“ฆ Project Structure

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

๐ŸŒŸ What's New in This Version

Recent Enhancements (2025)

  • โœ… Enhanced Voice Control - Hands-free operation with natural language commands
  • โœ… Lap Export Functionality - Export lap times to CSV with timestamps
  • โœ… Local Storage Support - Never lose your progress on reload
  • โœ… Enhanced Sound Effects - Start, pause, reset, and lap sounds
  • โœ… Improved Keyboard Shortcuts - Space, R, L, E 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

๐Ÿ’ก Tips & Tricks

  1. Quick Start: Press Space to instantly start the stopwatch
  2. Rapid Laps: Use L key for quick lap recording during activities
  3. Theme Preference: Your dark/light mode choice persists across sessions
  4. Auto-Save: The stopwatch automatically saves your progress every second
  5. Keyboard Master: Learn the shortcuts for a seamless experience

๐Ÿ› Known Issues & Limitations

  • 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)

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Original Creator: Avinash Singh โ€“ for building the foundation of this stopwatch project
  • Enhancements & Contributions: Hector JS and the amazing open-source community
  • Icons & Graphics: Font Awesome โ€“ for the crisp and professional icons
  • Fonts: Google Fonts โ€“ for the modern typography
  • Background Animation: Lofi video animation โ€“ for the relaxing, aesthetic UI
  • Special Thanks: To all contributors who help improve this project and make it Hacktoberfest-ready! ๐ŸŽ‰

๐Ÿ“ž Connect with the Creator

Instagram LinkedIn GitHub

๐Ÿ‘ฅ Our Contributors

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

Releases

No releases published

Packages

 
 
 

Contributors