Pomodoro
How do I make an pomodoro?
What is a pomodoro? How do you make a pomodoro? This script and codes were developed by Steven on 31 July 2022, Sunday.
Pomodoro - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pomodoro</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<h1 class="text-center">Pomodoro</h1>
<div class="container controlcon"> <div class="row"> <div class="col-md-5 but"> <p class="controlTitle">Break Length(mins)</p> <p class="timerControl"> <span id="breakMinus" class="timerChange">-</span> <span id="breakTime" class="timerNum">1</span> <span id="breakPlus" class="timerChange">+</span> </p> </div> <div class="col-md-2"><button class="btn btn-danger" id="resetTimer" style="height:100">Reset</button></div> <div class="col-md-5 but"> <p class="controlTitle">Session Length</p> <p class="timerControl"> <span id="sessionMinus" class="timerChange">-</span> <span id="sessionTime" class="timerNum">1</span> <span id="sessionPlus" class="timerChange">+</span> </p> </div> </div>
</div>
<div class="container timercon"> <div class="timer greenBack"> <p class="promptDisplay">Start</p> <p class="timeDisplay">0:00</p> <p class="sessionDisplay">Start</p> </div>
</div>
<p style="margin-top:30px;">
<a id="homesite" href="http://www.volv.org">My Portfolio - Volv.org</a>
</pp> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Pomodoro - Script Codes CSS Codes
body { background: #a0a0f0; color: black;
}
h1 { text-align: center; font-family: 'Lobster', cursive; font-size: 60px; color:black; margin-bottom:40px;
}
@media (max-width: 600px) { .controlcon { width:300px !important; }
}
.controlcon { text-align: center; margin-top:0px; margin-bottom:30px; width:600px; padding: 5px 50px; /* Here */
}
.but { text-align: center; padding: 5px 5px; /* Here */ background: #5a5a5a; border: solid; /* border-radius: 50%; */ box-shadow: 5px 5px 20px 5px black;
}
.timercon { width:300px; padding: 50px; /* Here */ background: #5a5a5a; border: solid; border-radius: 50%; box-shadow: 0px 0px 20px 5px black;
}
.timercon:hover { box-shadow: 0px 0px 10px 5px green;
}
.timercon:active { box-shadow: 0px 0px 10px 5px white;
}
.redBack { background: url("http://volv.org/images/red.png") no-repeat;
}
.greenBack { background: url("http://volv.org/images/green.png") no-repeat;
}
.timer { background-position: 0px 300px; height:200px; width:200px; border-radius: 50%; padding: 10px;
}
.timer:before { content: ""; position:absolute; margin: -18px; /* Magic */ height:216px; width:216px; border: 5px solid limegreen; border-radius: 50%;
}
.promptDisplay { text-align: center; color: black; font-size: 30px; font-weight: 700; padding-top: 0px;
}
.timeDisplay { text-align: center; color: black; font-size: 50px; font-weight: 700; letter-spacing: 10px padding-top: 0px;
}
.sessionDisplay { text-align: center; color: black; font-size: 30px; font-weight: 700; padding-top: 0px;
}
.timerChange { padding: 0px 10px; font-size:40px; cursor: pointer;
}
.timerChange:hover { color: green;
}
.timerChange:active { color: white;
}
.timerNum { padding: 0px; font-size:40px;
}
.controlTitle { font-size:20px; font-weight: bold;
}
#homesite { font-size:30px;
}
p { text-align: center;
}
Pomodoro - Script Codes JS Codes
reset();
$(".timer").one("click", start);
$("#resetTimer").on("click", reset);
var TIMER_SIZE = 200;
var fillPos; // 200 = empty. 0 = full.
var secondsElapsed;
var secondsFull;
var timer;
var lap; //Session time in minutes
var gap; //Gap time in minutes
var isSession = true;
function toggleGap() { //starts at green $(".timer").toggleClass("greenBack"); $(".timer").toggleClass("redBack");
}
function updateTimer() { fillPos = 200 - ((secondsElapsed / secondsFull) * TIMER_SIZE); $(".timer").css({"background-position": "0px " +fillPos+ "px"}); $(".timeDisplay").html(formatTime(secondsFull-secondsElapsed));
}
function formatTime(secs) { var hours = Math.floor(secs / 3600); var mins = Math.floor((secs / 60) % 60); var secs = secs % 60; var startOfResult = (hours > 0) ? "" +hours+ ":" : ""; var midResult = (mins < 10) ? "0" : ""; var endOfResult = (secs > 9) ? "" +mins+ ":" +secs : "" +mins+ ":0" +secs; result = startOfResult + midResult + endOfResult; return result;
}
function timerTick(time) { if (secondsElapsed < secondsFull) { secondsElapsed += 1; } else { isSession = !isSession; toggleGap(); updateLengths(); secondsElapsed = 0; if (isSession) { $(".sessionDisplay").css("color", "green"); $(".sessionDisplay").html("Session"); } else { $(".sessionDisplay").css("color", "white"); $(".sessionDisplay").html("Gap"); } } updateTimer(); timer = setTimeout(timerTick, 1000);
}
function start() { timerTick(); $(".promptDisplay").css("color", "white"); $(".promptDisplay").html("Pause"); $( ".controlcon" ).slideToggle( "slow", function() { // Animation complete. }); $(".timer").one("click", stop)
}
function stop() { if (timer) { clearTimeout(timer); timer = 0; } $( ".controlcon" ).slideToggle( "slow", function() { // Animation complete. }); $(".promptDisplay").css("color", "green"); $(".promptDisplay").html("Start"); $(".timer").one("click", start)
}
function reset() { fillPos = 200; // 200 = empty. 0 = full. secondsElapsed = 0; timer = 0; lap = $("#sessionTime").html(); gap = $("#breakTime").html(); if (isSession == false) toggleGap(); // Puts back to green back. isSession = true; secondsFull = (isSession) ? lap*60 : gap*60; $(".promptDisplay").css("color", "green"); $(".promptDisplay").html("Start"); $(".timeDisplay").html(formatTime(secondsFull-secondsElapsed)); $(".sessionDisplay").css("color", "green"); $(".sessionDisplay").html("Session"); updateLengths(); updateTimer();
}
function updateLengths() { $("#breakTime").html(gap); $("#sessionTime").html(lap); secondsFull = (isSession) ? lap*60 : gap*60; $(".timeDisplay").html(formatTime(secondsFull-secondsElapsed)); updateTimer();
}
$("#breakMinus").on("click", function() { if (timer != 0) { //If not paused return; } if (gap > 1) { gap--; } updateLengths();
});
$("#breakPlus").on("click", function() { if (timer != 0) { //If not paused return; } if (gap < 999) { gap++; } updateLengths();
});
$("#sessionMinus").on("click", function() { if (timer != 0) { //If not paused return; } if (lap > 1) { lap--; } updateLengths();
});
$("#sessionPlus").on("click", function() { if (timer != 0) { //If not paused return; } if (lap < 999) { lap++; } updateLengths();
});
Developer | Steven |
Username | volv |
Uploaded | July 31, 2022 |
Rating | 3 |
Size | 3,539 Kb |
Views | 34,408 |
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!
Name | Size |
JQuery Ajax | 1,690 Kb |
Pet Stats | 10,939 Kb |
Beer Event - Remaining Rewards | 2,537 Kb |
Camper News | 3,013 Kb |
Zelda | 15,850 Kb |
Tic Tac Toe | 4,862 Kb |
Reddit Spoiler Markdown | 2,077 Kb |
Heavy Snake | 6,358 Kb |
Midas Points | 19,443 Kb |
Promises | 2,516 Kb |
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!
Name | Username | Size |
Boom | Mhrjnsa1 | 1,794 Kb |
Vue.js Starter | Andymerskin | 1,268 Kb |
Modal Dialog | Gigaleet | 2,251 Kb |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
A simple log in form made with css | Mayurelbhar | 2,160 Kb |
AngularJS Datalist Directive | M-e-conroy | 2,366 Kb |
Z-index demo | Kblh | 1,534 Kb |
Touch Carousel - last, no gaps. | Berkin | 4,332 Kb |
Em Test | Rodesco | 1,784 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!