Skip to content

Divyesh-20/Stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Stopwatch

Introduction

Welcome to the Stopwatch project! This is a straightforward yet fully functional web-based stopwatch application that showcases basic web development skills. Built with HTML, CSS, and JavaScript, the application provides a user-friendly interface for tracking time, recording laps, and resetting the stopwatch. Whether you're looking to track your workout times, manage cooking durations, or simply explore web development techniques, this stopwatch project offers a practical example of how to create interactive web applications.

Features

  • Start/Stop Button: Toggle between starting and stopping the stopwatch.
  • Reset Button: Reset the stopwatch to 00:00:00.
  • Lap Button: Record lap times, with a maximum of 10 laps.
  • Lap Times Display: List recorded lap times with timestamps.

Project Structure

  • index.html: The main HTML file for the stopwatch application.
  • styles.css: Contains the CSS styling for the stopwatch.
  • script.js: Includes the JavaScript code for stopwatch functionality.

Usage

Open index.html in a Web Browser to view and interact with the stopwatch.

How It Works

  • HTML: Provides the structure of the stopwatch interface, including the display, buttons, and lap list.
  • CSS: Styles the stopwatch with a dark theme, centered content, and responsive design.
  • JavaScript: Manages stopwatch operations such as start/stop, reset, and lap recording. It also updates the display with the elapsed time.

HTML Structure

The HTML file defines the layout for the stopwatch, including:

  • A display area for showing elapsed time.
  • Buttons for starting/stopping, resetting, and recording laps.
  • A lapsList to display recorded lap times.

CSS Styling

The styles.css file applies the following styles:

  • A dark background for the body and stopwatch container.
  • Centered content and a modern, clean look.
  • Button styles with hover effects for better user interaction.

JavaScript Functionality

The script.js file includes:

  • formatTime(ms): Converts milliseconds to MM:SS:MS format.
  • updateDisplay(time): Updates the stopwatch display.
  • startStop(): Starts or stops the stopwatch based on the current state.
  • reset(): Resets the stopwatch and clears lap times.
  • addLap(): Adds a lap time to the list with a maximum of 10 laps.

Contributing

  1. Fork the Repository.

  2. Create a New Branch:

    git checkout -b feature/your-feature
  3. Make Your Changes.

  4. Commit Your Changes:

    git add .
    git commit -m "Add your message here"
  5. Push to the Branch:

    git push origin feature/your-feature
  6. Open a Pull Request.

]

Acknowledgements

  • HTML, CSS, and JavaScript for creating the stopwatch application.
  • Inspiration from various stopwatch implementations and UI/UX design principles.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published