Skip to content

Commit ec3cd7b

Browse files
committed
solve linter error
1 parent eb3cdaf commit ec3cd7b

File tree

2 files changed

+58
-59
lines changed

2 files changed

+58
-59
lines changed

Diff for: Source-Code/StopWatch/script.js

+12-15
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ let seconds = 0;
33
let minutes = 0;
44
let timer;
55

6-
const startButton = document.getElementById("start");
7-
const stopButton = document.getElementById("stop");
8-
const resetButton = document.getElementById("reset");
6+
const startButton = document.getElementById('start');
7+
const stopButton = document.getElementById('stop');
8+
const resetButton = document.getElementById('reset');
99

1010
const updateTime = () => {
1111
milliseconds += 1;
@@ -17,12 +17,9 @@ const updateTime = () => {
1717
seconds = 0;
1818
minutes += 1;
1919
}
20-
document.getElementById("milliseconds").innerText =
21-
milliseconds < 10 ? `0${milliseconds}` : milliseconds;
22-
document.getElementById("seconds").innerText =
23-
seconds < 10 ? `0${seconds}` : seconds;
24-
document.getElementById("minutes").innerText =
25-
minutes < 10 ? `0${minutes}` : minutes;
20+
document.getElementById('milliseconds').innerText = milliseconds < 10 ? `0${milliseconds}` : milliseconds;
21+
document.getElementById('seconds').innerText = seconds < 10 ? `0${seconds}` : seconds;
22+
document.getElementById('minutes').innerText = minutes < 10 ? `0${minutes}` : minutes;
2623
};
2724

2825
const startTimer = () => {
@@ -39,11 +36,11 @@ const resetTimer = () => {
3936
milliseconds = 0;
4037
seconds = 0;
4138
minutes = 0;
42-
document.getElementById("milliseconds").innerText = "00";
43-
document.getElementById("seconds").innerText = "00";
44-
document.getElementById("minutes").innerText = "00";
39+
document.getElementById('milliseconds').innerText = '00';
40+
document.getElementById('seconds').innerText = '00';
41+
document.getElementById('minutes').innerText = '00';
4542
};
4643

47-
startButton.addEventListener("click", startTimer);
48-
stopButton.addEventListener("click", stopTimer);
49-
resetButton.addEventListener("click", resetTimer);
44+
startButton.addEventListener('click', startTimer);
45+
stopButton.addEventListener('click', stopTimer);
46+
resetButton.addEventListener('click', resetTimer);

Diff for: Source-Code/StopWatch/style.css

+46-44
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
body {
2-
display: flex;
3-
justify-content: center;
4-
align-items: center;
5-
height: 100vh;
6-
background-color: #2e2a2a;
7-
margin: 0;
8-
font-family: Arial, sans-serif;
9-
}
10-
11-
.container {
12-
display: flex;
13-
flex-direction: column;
14-
justify-items: center;
15-
align-items: center;
16-
}
17-
18-
.stopwatch, h1, span{
19-
color: aliceblue;
20-
}
21-
.stopwatch {
22-
font-size: 48px;
23-
margin-bottom: 20px;
24-
}
25-
26-
.buttons {
27-
display: flex;
28-
justify-content: center;
29-
gap: 10px;
30-
}
31-
32-
button {
33-
padding: 10px 20px;
34-
font-size: 16px;
35-
cursor: pointer;
36-
border: none;
37-
border-radius: 5px;
38-
background-color: #007BFF;
39-
color: #fff;
40-
}
41-
42-
button:active {
43-
background-color: #0056b3;
44-
}
45-
2+
display: flex;
3+
justify-content: center;
4+
align-items: center;
5+
height: 100vh;
6+
background-color: #2e2a2a;
7+
margin: 0;
8+
font-family: Arial, sans-serif;
9+
}
10+
11+
.container {
12+
display: flex;
13+
flex-direction: column;
14+
justify-items: center;
15+
align-items: center;
16+
}
17+
18+
.stopwatch,
19+
h1,
20+
span {
21+
color: aliceblue;
22+
}
23+
24+
.stopwatch {
25+
font-size: 48px;
26+
margin-bottom: 20px;
27+
}
28+
29+
.buttons {
30+
display: flex;
31+
justify-content: center;
32+
gap: 10px;
33+
}
34+
35+
button {
36+
padding: 10px 20px;
37+
font-size: 16px;
38+
cursor: pointer;
39+
border: none;
40+
border-radius: 5px;
41+
background-color: #007bff;
42+
color: #fff;
43+
}
44+
45+
button:active {
46+
background-color: #0056b3;
47+
}

0 commit comments

Comments
 (0)