Skip to content

ByteOps02/Stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🏁 Modern Stopwatch

A beautiful, feature-rich stopwatch application built with vanilla JavaScript, featuring a modern glassmorphism design with dark/light theme support.

Stopwatch Preview JavaScript CSS3 HTML5

✨ Features

🕐 Core Functionality

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

🎨 Modern Design

  • 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

⌨️ User Experience

  • Keyboard Shortcuts:
    • Space - Start/Stop timer
    • L - Record lap
    • R - Reset timer
    • T - Toggle theme
  • Visual Feedback: Button states, animations, and hover effects
  • Persistent Settings: Theme preference saved in localStorage

🚀 Getting Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional dependencies required!

Installation

  1. Clone or download this repository
  2. Navigate to the project directory
  3. 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 .

📱 Usage

Basic Controls

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

Lap Features

  • 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

Theme Toggle

  • Click the moon/sun icon in the top-right corner
  • Press T to toggle between light and dark themes
  • Theme preference is automatically saved

🛠️ Technologies Used

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

📁 Project Structure

StopWatch/
├── index.html          # Main HTML file
├── style.css           # CSS styles and animations
├── index.js            # JavaScript functionality
└── README.md           # This file

🎯 Key Features Explained

Timer Precision

The stopwatch uses Date.now() for high-precision timing, updating every 10ms for smooth display while maintaining accuracy.

Glassmorphism Design

Modern glassmorphism effect achieved using:

  • backdrop-filter: blur()
  • Semi-transparent backgrounds
  • Subtle borders and shadows
  • Smooth transitions

Responsive Design

  • Mobile-first approach
  • Flexible layouts using CSS Grid and Flexbox
  • Adaptive font sizes and spacing
  • Touch-friendly button sizes

Theme System

  • CSS custom properties for easy theming
  • Smooth transitions between themes
  • Persistent storage using localStorage
  • Automatic theme detection

🎨 Design Philosophy

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

🔧 Customization

Adding New Themes

You can easily add new themes by:

  1. Adding new CSS custom properties in :root
  2. Creating new [data-theme="your-theme"] rules
  3. Updating the theme toggle logic in JavaScript

Modifying Colors

All colors are defined as CSS custom properties in the :root selector, making it easy to customize the entire color scheme.

📱 Browser Support

  • ✅ Chrome 60+
  • ✅ Firefox 55+
  • ✅ Safari 12+
  • ✅ Edge 79+

🤝 Contributing

Feel free to contribute to this project by:

  • Reporting bugs
  • Suggesting new features
  • Submitting pull requests
  • Improving documentation

📄 License

This project is open source and available under the MIT License.

🙏 Acknowledgments

  • 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! ⏱️✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published