Skip to content

Welcome to my fourth coding project! πŸš€ In this beginner-friendly endeavor, I've built a sleek countdown timer using Vanilla JavaScript, HTML, and CSS. This timer is not just about ticking seconds; it's about mastering core web technologies.

License

Notifications You must be signed in to change notification settings

KwaziiMedia/CountDownTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Countdown Timer Project πŸ•’

Description πŸ“

This is a simple countdown timer project built using HTML, CSS, and JavaScript. The timer allows users to input the desired duration in hours, minutes, and seconds, and it counts down to zero. The project includes features such as starting, restarting, and stopping the countdown.

Features πŸš€

  • Input Validation: Ensures that only valid positive integers are accepted for hours, minutes, and seconds.
  • Dynamic Display: The countdown is displayed dynamically, updating every second.
  • Start, Restart, Stop Buttons: Users can start, restart, and stop the countdown using the corresponding buttons.
  • Consistent Time Format: The time is formatted to always display two digits for hours, minutes, and seconds.

How to Use πŸ› οΈ

  • Open the HTML file in a web browser.
  • Enter the desired countdown duration in the input fields for hours, minutes, and seconds.
  • Click the "Start" button to begin the countdown.
  • Use the "Restart" button to reset the countdown, and the "Stop" button to halt it.
  • Enjoy your countdown experience! 😊

Code Explanation πŸ’»

  • DOMContentLoaded: Ensures the script runs after the HTML document is fully loaded.
  • Event Listeners: Listen for button clicks (start, restart, stop) and execute corresponding functions.
  • setInterval: Used to repeatedly update the countdown every second.
  • clearInterval: Stops the repetition of setInterval.
  • Input Validation: Ensures valid input for hours, minutes, and seconds.
  • Formatting Time: The formatTime function ensures consistent display with two digits.

Challenges & Solutions 🧠

  • Input Validation: Used parseInt to convert input to numbers and provided default values.
  • Consistent Time Format: Implemented the formatTime function to ensure two-digit display.

About

Welcome to my fourth coding project! πŸš€ In this beginner-friendly endeavor, I've built a sleek countdown timer using Vanilla JavaScript, HTML, and CSS. This timer is not just about ticking seconds; it's about mastering core web technologies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published