Skip to content

Commit f031e0a

Browse files
stopwatch
1 parent 6fc15be commit f031e0a

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# ⏱️ Stopwatch Web Application
1+
2+
# Task 2 :- ⏱️ Stopwatch Web Application
23

34
Welcome to the Stopwatch Web Application! This advanced-level, interactive stopwatch is built using HTML, CSS, and JavaScript—completely on the frontend with no backend or database involved. Developed as part of the Skill Craft Internship, this app offers lap tracking, CSV export, theme toggling, and persistent session features.
45

@@ -35,14 +36,16 @@ This project helps users measure time intervals with precision. You can start, p
3536
├── README.md # 📘 Project documentation
3637
├── output.pdf # 🖨️ Output snapshots in PDF format
3738
├── images/ # 🖼️ UI screenshots for documentation
38-
│ ├── light-mode.png
39-
│ └── dark-mode.png
39+
│ ├── img1.jpg #bright mode
40+
│ └── img2.jpg #dark mode
41+
├── sounds/
42+
│ └── beep.mp3
4043
4144
```
4245

4346
## 🚀 Live Demo
4447

45-
Once you push this to a public GitHub repository and enable GitHub Pages, your game will be live at:
48+
Once you push this to a public GitHub repository and enable GitHub Pages, your stop watch will be live at:
4649

4750
```
4851
https://<your-github-username>.github.io/<repository-name>/
@@ -79,6 +82,7 @@ Example for your profile:
7982
10. Switch between light/dark modes using the toggle
8083

8184
## 🖼️ Screenshots
85+
8286
* ☀️ Light Mode -- img1.jpg
8387

8488
* 🌙 Dark Mode -- img2.jpg

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ <h1>⏱️ Stopwatch</h1>
3333

3434
<script src="/home/rgukt/Documents/Laptop-data/CAREER/Skill craft intern/SCT_WD_2/script.js"></script>
3535
</body>
36-
</html>
36+
</html>

script.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,15 @@ themeToggle.addEventListener("change", () => {
112112
});
113113

114114
// Beep sound
115+
const beepAudio = new Audio("/home/rgukt/Documents/Laptop-data/CAREER/Skill craft intern/SCT_WD_2/sounds/beep-01a.mp3");
116+
beepAudio.preload = "auto";
117+
115118
function playBeep() {
116-
const audio = new Audio("https://www.soundjay.com/buttons/sounds/beep-07.mp3");
117-
audio.play();
119+
beepAudio.currentTime = 0;
120+
beepAudio.play().catch(err => console.warn("Audio play failed:", err));
118121
}
119122

123+
120124
// Add export button
121125
const exportBtn = document.createElement("button");
122126
exportBtn.textContent = "Export CSV";
@@ -128,4 +132,4 @@ document.querySelector(".container").appendChild(exportBtn);
128132
startBtn.addEventListener("click", startTimer);
129133
pauseBtn.addEventListener("click", pauseTimer);
130134
resetBtn.addEventListener("click", resetTimer);
131-
lapBtn.addEventListener("click", recordLap);
135+
lapBtn.addEventListener("click", recordLap);

sounds/beep-01a.mp3

15.6 KB
Binary file not shown.

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ body.dark #csv-output {
154154
color: #004d40; /* Pure white text */
155155
border-color: #00bfa5; /* Bright teal border */
156156
box-shadow: 0 4px 14px rgba(0, 191, 165, 0.9);
157-
}
157+
}

0 commit comments

Comments
 (0)