Pomodoro Focus Timer
A start/pause/reset focus countdown timer.
Requires Bootstrap 5. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><div class="card border-0 shadow-sm text-center" style="max-width:280px"><div class="card-body">
<h6 class="fw-bold">Focus timer</h6>
<div class="display-5 fw-bold my-2" id="ftDisplay">25:00</div>
<div class="d-flex gap-2 justify-content-center"><button class="btn btn-primary btn-sm" id="ftStart">Start</button><button class="btn btn-outline-secondary btn-sm" id="ftReset">Reset</button></div>
</div></div>var t=25*60,iv=null,disp=document.getElementById('ftDisplay');
function show(){disp.textContent=('0'+Math.floor(t/60)).slice(-2)+':'+('0'+(t%60)).slice(-2)}
document.getElementById('ftStart').onclick=function(){if(iv){clearInterval(iv);iv=null;this.textContent='Start';return}this.textContent='Pause';iv=setInterval(function(){if(t>0){t--;show()}else{clearInterval(iv);iv=null}},1000)};
document.getElementById('ftReset').onclick=function(){clearInterval(iv);iv=null;t=25*60;show();document.getElementById('ftStart').textContent='Start'};Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.