Pomodoro Clock

Developer
Size
2,384 Kb
Views
12,144

How do I make an pomodoro clock?

What is a pomodoro clock? How do you make a pomodoro clock? This script and codes were developed by Jimmy Lin on 11 December 2022, Sunday.

Pomodoro Clock Previews

Pomodoro Clock - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pomodoro Clock</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<div class=text-center> <h1 class=text-center id="title">Pomodoro Clock</h1> <div class="timeDiv"> <h1 id="title1">Session Time</h1> <a href="#" class="btn btn-primary" id="minus5Clock">-</a> <h2 id="timeType"></h2> <h2 id="num">5</h2> <a href="#" class="btn btn-primary" id="add5Clock">+</a> <a href="#" class="btn btn-primary" id="reset">Reset</a> </div> <div id="breakDiv"> <h1 id="title2">Break Time</h1> <a href="#" class="btn btn-primary" id="minus5Break">-</a> <h2 id="breakNum">5</h2> <a href="#" class="btn btn-primary" id="add5Break">+</a>
</div> <a href="#" class="btn btn-primary" id="start">Start</a>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Pomodoro Clock - Script Codes CSS Codes

#title { font-family: lobster; font-size: 45px;
}
h2 { display:inline;
}
#start{ margin:10px;
}

Pomodoro Clock - Script Codes JS Codes

$(document).ready(function(){ var buzzer = $("#buzzer")[0]; var count = parseInt($("#num").html()); var breakTime = parseInt($("#breakNum").html()); $("#reset").hide(); $("#start").click(function(){ var counter = setInterval(timer,1000); count*=60; function timer(){ //hide variables $("#start, #minus5Clock, #add5Clock, #minus5Break, #add5Break, #breakNum, #title1, #title2").hide(); $("#timeType").html("Session Time: "); count -=1; if(count===0){ clearInterval(counter); var startBreak = setInterval(breakTimer, 1000); $("#num").hide(); } if(count%60>=10){ $("#num").html(Math.floor(count/60)+":"+count%60); } else { $("#num").html(Math.floor(count/60)+":"+"0"+count%60); } function breakTimer(){ $("#timeType").html("Break Time: "); $("#breakNum").show(); breakTime*=60; $("#timeType").show(); breakTime -=1; if(breakTime ===0){ clearInterval(startBreak); $("#reset").show(); $("#breakNum").hide(); $("#timeType").hide(); } if(breakTime%60>=10){ $("#breakNum").html(Math.floor(breakTime/60)+":"+breakTime%60); } else { $("#breakNum").html(Math.floor(breakTime/60)+":"+"0"+breakTime%60); } } } }); $("#reset").click(function(){ count = 25; breakTime= 25; $("#num").html(count); $("#breakNum").html(breakTime); $("#start, #minus5Clock, #add5Clock, #minus5Break, #add5Break, #breakNum, #num, #title1, #title2").show(); $("#reset").hide(); }); $("#minus5Clock").click(function(){ if(count>5){ count -=5; $("#num").html(count); } }); $("#add5Clock").click(function(){ count += 5; $("#num").html(count); }); $("#minus5Break").click(function(){ if(breakTime>5){ breakTime -=5; $("#breakNum").html(breakTime); } }); $("#add5Break").click(function(){ breakTime += 5; $("#breakNum").html(breakTime); });
});
Pomodoro Clock - Script Codes
Pomodoro Clock - Script Codes
Home Page Home
Developer Jimmy Lin
Username odylic
Uploaded December 11, 2022
Rating 3
Size 2,384 Kb
Views 12,144
Do you need developer help for Pomodoro Clock?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jimmy Lin (odylic) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!