Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 58eb81c

Browse files
followed es6
1 parent 2cbdfd1 commit 58eb81c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎Source-Code/PomodoroTimer/script.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ const focusTime = 5 * 60; // 5 minutes in seconds
1010
const breakTime = 5 * 60; // 5 minutes in seconds
1111
let timeRemaining = focusTime;
1212

13-
function updateDisplay() {
13+
const updateDisplay=()=> {
1414
const minutes = Math.floor(timeRemaining / 60);
1515
const seconds = timeRemaining % 60;
1616
minutesDisplay.textContent = String(minutes).padStart(2, '0');
1717
secondsDisplay.textContent = String(seconds).padStart(2, '0');
18-
}
18+
};
1919

20-
function toggleSession() {
20+
const toggleSession=()=> {
2121
isFocusSession = !isFocusSession;
2222
timeRemaining = isFocusSession ? focusTime : breakTime;
2323
statusDisplay.textContent = isFocusSession
2424
? 'Focus Session'
2525
: 'Break Session';
2626
updateDisplay();
27-
}
27+
};
2828

29-
function startTimer() {
29+
const startTimer=()=> {
3030
if (timerInterval) return; // Prevent multiple intervals
3131
timerInterval = setInterval(() => {
3232
if (timeRemaining > 0) {
@@ -38,14 +38,14 @@ function startTimer() {
3838
toggleSession();
3939
}
4040
}, 1000);
41-
}
41+
};
4242

43-
function resetTimer() {
43+
const resetTimer=()=> {
4444
clearInterval(timerInterval);
4545
timerInterval = null;
4646
timeRemaining = isFocusSession ? focusTime : breakTime;
4747
updateDisplay();
48-
}
48+
};
4949

5050
startBtn.addEventListener('click', startTimer);
5151
resetBtn.addEventListener('click', resetTimer);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /