fix: reset does not make button pause into start

This commit is contained in:
tx 2025-07-04 17:32:31 +00:00
parent e73815c79b
commit 7df3f7f41c

View file

@ -1,59 +1,59 @@
<html>
<head>
<title>a simple pomodoro huhu ba-ka!</title>
<style>
body {
background-color: #222222;
color: #ffffff;
font-family: monospace;
}
<title>a simple pomodoro huhu ba-ka!</title>
<style>
body {
background-color: #222222;
color: #ffffff;
font-family: monospace;
}
button {
font-family: monospace;
font-size: 24px;
border-radius: none;
border: none;
padding: 5px 10px;
}
button {
font-family: monospace;
font-size: 24px;
border-radius: none;
border: none;
padding: 5px 10px;
}
.box-pomodoro {
width: 320px;
padding: 10px;
margin: auto;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
text-align: center;
background-color: #555555;
}
.box-pomodoro {
width: 320px;
padding: 10px;
margin: auto;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
text-align: center;
background-color: #555555;
}
#type {
font-size: 36pt;
margin: 0;
}
#type {
font-size: 36pt;
margin: 0;
}
#timer {
margin-top: 15px;
font-size: 48pt;
}
</style>
<script async="" defer="" src="https://xa.ba-ka.org/tracker.js" data-website-id="cm9iohk0l025fmqg5xf2gxhy4">
</script>
#timer {
margin-top: 15px;
font-size: 48pt;
}
</style>
<script async="" defer="" src="https://xa.ba-ka.org/tracker.js" data-website-id="cm9iohk0l025fmqg5xf2gxhy4">
</script>
</head>
<body>
<div class="box-pomodoro">
<h3>pomodoro</h3>
<h2 id="type">focus</h2>
<h1 id="timer">25:00</h1>
<button id="startpause" onclick="startpause()">pause</button>
<button id="reset" onclick="reset()">reset</button>
<div style="margin-bottom: 20px;"></div>
</div>
<script>
let isRunning = false;
<div class="box-pomodoro">
<h3>pomodoro</h3>
<h2 id="type">focus</h2>
<h1 id="timer">25:00</h1>
<button id="startpause" onclick="startpause()">start</button>
<button id="reset" onclick="reset()">reset</button>
<div style="margin-bottom: 20px;"></div>
</div>
<script>
let isRunning = false;
let buttonStartPause = document.getElementById("startpause");
let buttonReset = document.getElementById("reset");
let textTimer = document.getElementById("timer");
@ -117,6 +117,8 @@
function reset()
{
buttonStartPause.innerHTML = "start";
clearInterval(timerInterval);
isRunning = false;
isFocusSession = true;
@ -125,7 +127,7 @@
updateDisplayTimer();
console.log("reset pomodoro");
}
</script>
</script>
</body>