Pomodoro Clock
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 Paulo Sérgio on 19 November 2022, Saturday.
Pomodoro Clock - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pomodoro Clock</title> <link href='https://fonts.googleapis.com/css?family=Orbitron' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Josefin+Sans' rel='stylesheet' type='text/css'> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container" ng-app="app"> <div class="row" ng-controller="MainController"> <div class="col-md-6"> <div class="col-md-12 custom-gradient header"> <div class="text-center mainHeader"><h1>Pomodoro Clock</h1></div> <div class="col-md-6 body"> <button ng-click="start()" class="btn btn-primary btn-block">Start</button> </div> <div class="col-md-6 body"> <button ng-click="stop()" class="btn btn-danger btn-block">Stop</button> </div> </div> <div class="col-md-12 custom-gradient boder"> <div class="col-md-6 body"> <label>Session: </label><br> <div class="input-group"> <span ng-click="changeSession('-')" class="input-group-addon">-</span> <input type="text" ng-model="session" class="form-control" placeholder="25" readonly> <span ng-click="changeSession('+')" class="input-group-addon">+</span> </div> </div> <div class="col-md-6 body"> <label>Break: </label><br> <div class="input-group"> <span class="input-group-addon" ng-click="changeBreak('-')">-</span> <input type="text" ng-model="break" class="form-control" readonly> <span class="input-group-addon" ng-click="changeBreak('+')">+</span> </div> </div> </div> <div class="col-md-12 text-center custom-gradient footer"> <pg-clock></pg-clock> </div> <div class="pomodoroLabel">{{label}}</div> </div> </div> <!-- end row -->
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Pomodoro Clock - Script Codes CSS Codes
.custom { font-family: 'Orbitron', sans-serif; background-color: transparent; font-size: 140px; min-width: 700px !important; color: white;
}
.mainHeader{ margin-bottom: 60px; color: white;
}
input[readonly]
{ background-color:white !important; text-align: center;
}
.input-group-addon:hover{ background-color: blue; color: white;
}
.custom-gradient{ background: red; /* For browsers that do not support gradients */ /* For Safari 5.1 to 6.0 */ background: -webkit-linear-gradient(left,red,orange,yellow,green,blue,indigo,violet); /* For Opera 11.1 to 12.0 */ background: -o-linear-gradient(left,red,orange,yellow,green,blue,indigo,violet); /* For Fx 3.6 to 15 */ background: -moz-linear-gradient(left,red,orange,yellow,green,blue,indigo,violet); /* Standard syntax */ background: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet)
}
label{ color: white;
}
.header , .boder{ padding: 30px 10px 30px 10px;
}
.header{ border-radius: 20px 20px 0px 0px; margin-top: 40px;
}
.footer{ border-radius: 0px 0px 20px 20px;
}
.body{ padding: 0px 40px 0px 40px;
}
.pomodoroLabel{ position: absolute; top: 95%; right: 100px; color: white;
}
Pomodoro Clock - Script Codes JS Codes
angular.module('app' , [])
.directive('pgClock' , function(){ return { restrict: 'E', template: '<span id="display" class="custom diplay">00:00</span>', }
})
.service('TimeService' , function(){ this.startService = function(current , display , scope){ scope.label = 'Session'; var interval = current*1000*60; var id = setInterval(function(){ if(interval === 0) { clearInterval(id) breakTime(scope.break , display , scope); }; var date = new Date(interval); var myDate = date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, "$1"); console.log(myDate); display.html(myDate); scope.id = id; interval -= 1000; }, 1000); } function breakTime(current , display , scope){ scope.label = 'Break'; scope.$apply(); var interval = current*1000*60; var id = setInterval(function(){ if(interval === 0) { clearInterval(id) }; var date = new Date(interval); var myDate = date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, "$1"); console.log('in breakTime:' + myDate); display.html(myDate); scope.id = id; interval -= 1000; }, 1000); } this.getDisplay = function(){ return $('#display'); }
})
.controller('MainController' , function($scope , TimeService){ $scope.session = 25; $scope.break = 25; $scope.current = 0; $scope.display = TimeService.getDisplay(); $scope.id = 0; $scope.label = ""; //console.log($scope.display); $scope.start = function(){ $scope.current = $scope.session; clearInterval($scope.id); var date = new Date(); date.setHours(0, $scope.current, 0); //set current time //format to min:sec var myDate = date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, "$1"); $scope.display.html(myDate); //set display TimeService.startService($scope.current , $scope.display , $scope); } $scope.stop = function(){ clearInterval($scope.id); $scope.display.html('00:00'); $scope.label = ""; } $scope.changeSession = function(symbol){ //console.log(symbol); if(symbol === '+'){ if($scope.session < 25) $scope.session++; } else { if($scope.session > 1) $scope.session--; } } $scope.changeBreak = function(symbol){ if(symbol === '+'){ if($scope.break < 25) $scope.break++; } else { if($scope.break > 1) $scope.break--; } }
})
Developer | Paulo Sérgio |
Username | paulo101977 |
Uploaded | November 19, 2022 |
Rating | 3 |
Size | 3,306 Kb |
Views | 10,120 |
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 |
Calculator | 3,239 Kb |
Spinner Loader SVG Pure Css Radius Loader | 2,148 Kb |
WeatherMap | 13,360 Kb |
Simon Game | 4,988 Kb |
Spinner pure CSS loader radius | 2,236 Kb |
Donut Chart D3js | 3,246 Kb |
Quote Api | 3,963 Kb |
Game of Life | 6,047 Kb |
Wiki Search | 3,062 Kb |
Tic Tac Toe Game | 6,111 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 |
GLSL Hills | Ykob | 6,991 Kb |
Portfolio page | Bhavya_j | 2,804 Kb |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Caputre Cam with JS | KimmoCommit | 2,795 Kb |
Hovers with popups | Zacharyolson | 2,380 Kb |
Mandelbrot Fractal | _Billy_Brown | 2,706 Kb |
Header | Er40 | 1,542 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!