Pomodoro Clock

Developer
Size
3,279 Kb
Views
8,096

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 Codoer on 07 December 2022, Wednesday.

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> <div class='container-fluid text-center'> <h1 class='title'>Pomodoro Clock</h1> <div class='container'> <div class='row'> <div class='col-xs-12 col-sm-6 col-md-6 col-lg-6 break'> <h3>BREAK</h3> <button class='br1 small'><span class='minus'>-</span></button> <span class='time1'>5</span> <button class='br2 small'><span class='plus'>+</span></button> </div> <div class='col-xs-12 col-sm-6 col-md-6 col-lg-6 work'> <h3>WORK</h3> <button class='wo1 small'><span class='minus'>-</span></button> <span class='time2'>25</span> <button class='wo2 small'><span class='plus'>+</span></button> </div> </div> </div> <div class='timer'> <div class='bigcir'> <div class='fill'></div> <h1 class='status'></h3> <h1 class='start'>START WORK</h1> </div> </div> <div> <button class='last next'> <span class="small1 glyphicon glyphicon-fast-forward"></span> </button> <button class='last reset'> <span class="small1 glyphicon glyphicon-refresh"></span> </button> </div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Pomodoro Clock - Script Codes CSS Codes

body { background-color: #2E2E2E; background-size: cover;
}
button { border: 1px solid #ccc; outline: none; color: orangered;
}
button:active { border: 1px solid #000;
}
.small { height: 50px; width: 50px; border-radius: 50%; font-size: 30px; margin-bottom: 10px;
}
.small1 { font-size: 25px;
}
.bigcir { height: 300px; width: 300px; border-radius: 50%; cursor: pointer; overflow: hidden; position: relative; margin: 0 auto; display: inline-block;
}
.title { margin-top: 100px; font-size: 60px; font-weight: bold; padding-top: 15px; padding-bottom: 20px; color: white;
}
.last { margin: 50px 100px; height: 50px; width: 50px; border-radius: 50%;
}
.time1,
.time2 { display: inline-block; width: 60px; color: white; font-size: 25px;
}
.start { color: orangered; font-size: 40px; padding-top: 35px;
}
.status { color: orangered; font-size: 60px; padding: 30px;
}
h3 { color: white;
}
.fill { position: absolute; z-index: -1; width: 100%; height: 0%; background-color: lightgray; bottom: 0;
}

Pomodoro Clock - Script Codes JS Codes

function pomodoro() { var alarm = new Audio('http://freesound.org/data/previews/269/269570_5126800-lq.mp3'), breakTime = 5, workTime = 25, startFlag = false, nextFlag = false, pauseWorkFlag = false, pauseBreakFlag = false, workFlag = false, breakFlag = false, $start = $('.start'), $status = $('.status'), $bigcir = $('.bigcir'), $fill = $('.fill'), timer1, timer2, total1, total2, m, s; function counting2() { total2--; m = parseInt(total2 / 60); s = total2 % 60; if (s < 10) { s = '0' + s; } $start.text(m + ':' + s); $status.text('WORK'); if (total2 === 0) { clearInterval(timer2); $bigcir.css('border', ''); $start.text("START BREAK"); $fill.stop(); $fill.css('height', '0%'); $status.text(''); alarm.play(); nextFlag = false; startFlag = true; workFlag = false; } } function counting1() { total1--; m = parseInt(total1 / 60); s = total1 % 60; if (s < 10) { s = '0' + s; } $start.text(m + ':' + s); $status.text('BREAK'); if (total1 === 0) { clearInterval(timer1); $bigcir.css('border', ''); $start.text('START WORK'); $fill.stop(); $fill.css('height', '0%'); $status.text(''); alarm.play(); nextFlag = true; // startFlag = false; breakFlag = false; } } $('.br1').click(function() { if (breakTime > 1) { breakTime--; } $('.time1').text(breakTime); }); $('.br2').click(function() { if (breakTime < 60) { breakTime++; } $('.time1').text(breakTime); }); $('.wo1').click(function() { if (workTime > 1) { workTime--; } $('.time2').text(workTime); }); $('.wo2').click(function() { if (workTime < 60) { workTime++; } $('.time2').text(workTime); }); $bigcir.click(function() { clearInterval(timer2); clearInterval(timer1); if (!startFlag) { if (!workFlag) { $bigcir.css('border', '7px solid green'); alarm.pause(); alarm.currentTime = 0; workFlag = true; timer2 = setInterval(counting2, 1000); total2 = ($('.time2').text()) * 60; $fill.animate({ height: '100%' }, (total2 * 1000)); } else { if (!pauseWorkFlag) { clearInterval(timer2); $fill.stop(); $bigcir.css('border', '7px solid black'); pauseWorkFlag = true; } else { s = Math.floor(s); total2 = (m * 60) + s; $fill.animate({ height: '100%' }, (total2 * 1000)); $bigcir.css('border', '7px solid green'); timer2 = setInterval(counting2, 1000); pauseWorkFlag = false; } } } else { if (!breakFlag) { $bigcir.css('border', '7px solid purple'); alarm.pause(); alarm.currentTime = 0; breakFlag = true; timer1 = setInterval(counting1, 1000); total1 = ($('.time1').text()) * 60; $fill.animate({ height: '100%' }, (total1 * 1000)); } else { if (!pauseBreakFlag) { $bigcir.css('border', '7px solid black'); $fill.stop(); clearInterval(timer1); pauseBreakFlag = true; } else { $bigcir.css('border', '7px solid purple'); s = Math.floor(s); total1 = (m * 60) + s; $fill.animate({ height: '100%' }, (total1 * 1000)); timer1 = setInterval(counting1, 1000); pauseBreakFlag = false; } } } }); $('.next').click(function() { if (!startFlag) { clearInterval(timer2); alarm.pause(); alarm.currentTime = 0; $bigcir.css('border', ''); $fill.stop(); $fill.css('height', '0%'); $start.text("START BREAK"); $status.text(''); startFlag = true; breakFlag = false; pauseWorkFlag = false; workFlag = false; //fixing working click next then run out breaking, then shows negative numbers } else { clearInterval(timer1); alarm.pause(); alarm.currentTime = 0; $bigcir.css('border', ''); $fill.stop(); $fill.css('height', '0%'); $start.text("START WORK"); $status.text(''); startFlag = false; workFlag = false; pauseWorkFlag = false; } }); $('.reset').click(function() { clearInterval(timer1); clearInterval(timer2); alarm.pause(); alarm.currentTime = 0; $bigcir.css('border', ''); $fill.stop(); $fill.css('height', '0%'); $start.text("START WORK"); $status.text(''); $('.time1').text('5'); $('.time2').text('25'); startFlag = false; nextFlag = false; pauseWorkFlag = false; pauseBreakFlag = false; workFlag = false; breakFlag = false; });
}
pomodoro();
Pomodoro Clock - Script Codes
Pomodoro Clock - Script Codes
Home Page Home
Developer Codoer
Username c0d0er
Uploaded December 07, 2022
Rating 3
Size 3,279 Kb
Views 8,096
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!

Codoer (c0d0er) Script Codes
Create amazing web content 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!