-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added timer feature to analog clock and improved UI (#437)
Added a count down timer feature to the analog clock project, also improved the UI. Allows users to set a timer in hrs, min, and sec. Plays audio when the timer is up and displays a time's up text. ![image](https://github.com/user-attachments/assets/1066f213-ae8b-4b55-9f8e-a0d0012b6c54)
- Loading branch information
Showing
4 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Analog Clock</title> | ||
<link rel="stylesheet" href="index.css"> | ||
<script src="index.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="clockContainer"> | ||
<div id="hour"></div> | ||
<div id="minute"></div> | ||
<div id="second"></div> | ||
</div> | ||
|
||
<div id="timerContainer"> | ||
<div id="timeInput"> | ||
<input type="number" id="hours" placeholder="HH" min="0" max="23" /> | ||
<input type="number" id="minutes" placeholder="MM" min="0" max="59" /> | ||
<input type="number" id="seconds" placeholder="SS" min="0" max="59" /> | ||
</div> | ||
<button onclick="startCountdown()">Start Countdown</button> | ||
<div id="countdownDisplay">00:00:00</div> | ||
|
||
<div id="timerUpMsg" style="display: none;"> | ||
<p><b>Time's Up!</b></p> | ||
</div> | ||
</div> | ||
|
||
<!-- Audio Element --> | ||
<audio id="timerSound" src="timer.mp3"></audio> | ||
|
||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.