Skip to content

Instantly share code, notes, and snippets.

@furball514
Created February 7, 2017 21:14
Show Gist options
  • Save furball514/8a291ed5c2b231f5740a535c91be099d to your computer and use it in GitHub Desktop.
Save furball514/8a291ed5c2b231f5740a535c91be099d to your computer and use it in GitHub Desktop.
Pomodoro Work Clock
<head> <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Bungee+Shade" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Monoton" rel="stylesheet">
</head>
<body>
<h1> <span class="fa fa-clock-o"> <p> Pomodoro Work Clock By </p> <a href="http://codepen.io/furball/" target="_blank"> Karthik </a> </span>
<span class="fa fa-clock-o"> </span> </h1>
<br> </br>
<div class="container text-center jig">
<h2> Work Clock </h2>
<div class="clock">
</div>
<div class="row well">
<button id="start" class="btn"> <span id="spin" class="fa fa-hourglass-start"> </span> Start </button>
<button id="stop" class="btn"> <span class="fa fa-hourglass-start fa-rotate-180"> </span> Stop </button>
<button id="reset" class="btn"> <span class="fa fa-undo"> </span> reset </button>
</div>
</div>
</body>
function main(){
//var time;
var pomo = $(".clock").FlipClock(25*60, {
clockFace: 'MinuteCounter',
countdown: true,
callbacks: {
stop: function() {
}
}
});
$("#reset").click(function(){
pomo.setTime(60 * 25);
pomo.stop();
alert('Finished Session! Great Work!'); $('#spin').removeClass('fa-pulse');
});
$("#stop").click(function(){
pomo.stop();
$('#spin').removeClass('fa-pulse');
// time=pomo.getTime();
});
$("#start").click(function(){
pomo.setTime(60 * 25);
pomo.start();
$('#spin').addClass('fa-pulse');
});
//console.log(pomo.getMinutes);
}
//OPTIONAL AUDIO
/*<audio id="sound" src="http://codingtutorials360.com/14244764.mp3" type="audio/mpeg"></audio>
<!-- AUDIO OWNED BY CODING TUTORIALS 360 USER:PIZZAPOKERGUY
-->*/
$(document).ready(main);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.js"></script>
* {margin:0;
padding:0;
box-sizing:border-box;}
body {background-color:#3D9970;
color:white;}
h1 {text-align:center;
color: white;}
p {font-family: 'Alfa Slab One',cursive;
display:inline;}
a {font-family:'Bungee Shade',cursive;
color:#FFD700;}
.container {font-family:'Monoton';
text-align:center;}
.btn{background-color:#3D9970;
border:1px solid;
padding:5px;
box-shadow: 0 3px 0 0 #222121, inset -1px -3px 10px 1px #515151;
margin-bottom:10px;
font-size:1.5em;
}
#reset{margin-left:10px;}
#stop{margin-left:10px;}
.clock{display:inline-block;;}
.jig{position: absolute;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -0%);
width: auto;}
/*input {font-size:;}*/
button:active {
transform: translate(0, 3px);
box-shadow: none;
}
button,
button:hover,
button:active,
button:visited {
text-decoration: none !important;
outline: none !important;
}
.well{
background-color: rgba(245, 245, 245, 0.18);
}
/*.fa-pulse {
-webkit-animation: fa-pulse 1s infinite linear;
animation: fa-pulse 1s infinite linear;
}*/
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome-animation/0.0.9/font-awesome-animation.min.css" rel="stylesheet" />
<link href="//cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment