Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Time Keeper
HTML5 and JavaScript based timer with notification chime for academic conference.

![Screenshot](screenshot.png)

### How to Use?
Access
http://maruta.github.io/timekeeper/
Expand Down
Binary file added android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android-chrome-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#f2f2f2</TileColor>
</tile>
</msapplication>
</browserconfig>
4 changes: 4 additions & 0 deletions css/timekeeper.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ html,body{
text-align: center;
}

.overtime #time{
color: red;
}

#info{
font-weight: bold;
color: white;
Expand Down
Binary file added favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added favicon.ico
Binary file not shown.
12 changes: 11 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
<title>Time Keeper</title>
<script type="text/javascript" src="./js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="./js/jquery.timer.js"></script>
<script type="text/javascript" src="./js/jquery.fullscreen.min.js"></script>
<script type="text/javascript" src="./bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/timekeeper.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="manifest.json">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#f2f2f2">
<meta name="theme-color" content="#ffffff">
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/timekeeper.css" rel="stylesheet">

Expand All @@ -23,6 +31,8 @@
<li id="standby" class="active"><a href="#standby"><span class="glyphicon glyphicon-stop" aria-hidden="true"></span> <span class="hidden-xs">Standby</span></a></li>
<li id="start"><a href="#start"><span class="glyphicon glyphicon-play" aria-hidden="true"></span> <span class="hidden-xs">Start</span></a></li>
<li id="pause"><a href="#pause"><span class="glyphicon glyphicon-pause" aria-hidden="true"></span> <span class="hidden-xs">Pause</span></a></li>
<li id="reset"><a href="#reset"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> <span class="hidden-xs">Reset</span></a></li>
<li id="fs"><a href="#fullscreen"><span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span> <span class="hidden-xs">Fullscreen</span></a></li>
</ul>
<form class="navbar-form navbar-left" action="">
<div class="form-group">
Expand All @@ -36,7 +46,7 @@
</ul>
</div><!-- /.container-fluid -->
</nav>
<div id="time">
<div id="time" data-toggle="tooltip" title="Click to change timer type">
00:00
</div>
<div id="state">
Expand Down
28 changes: 28 additions & 0 deletions js/jquery.fullscreen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 66 additions & 3 deletions js/timekeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Ichiro Maruta
Copyright (c) 2018 TakamiChie

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,6 +25,7 @@ THE SOFTWARE.

$(function(){
var loadedcss = '';
var countdown = 0;
$('#time1').val('15:00');
$('#time2').val('20:00');
$('#time3').val('25:00');
Expand All @@ -49,6 +51,10 @@ $(function(){
if(params.t2 !== undefined) $('#time2').val(params.t2);
if(params.t3 !== undefined) $('#time3').val(params.t3);
if(params.m !== undefined) $('#info').html(params.m);
if(params.cd !== undefined){
countdown = parseInt(params.cd);
if(isNaN(countdown) || countdown > 3){ countdown = 0; }
}
if(loadedcss !== ''){
location.reload();
}
Expand All @@ -64,7 +70,8 @@ $(function(){
var hashstr = '#t1=' + $('#time1').val()
+ '&t2=' + $('#time2').val()
+ '&t3=' + $('#time3').val()
+ '&m=' + encodeURIComponent($('#info').html());
+ '&m=' + encodeURIComponent($('#info').html())
+ '&cd=' + countdown;
if(loadedcss !== 'default'){
hashstr = hashstr + '&th=' + encodeURIComponent(loadedcss);
}
Expand Down Expand Up @@ -157,6 +164,37 @@ $(function(){
changeStateClass('paused');
});

$('.nav #reset').click(function (event){
event.preventDefault();
if(!$('.nav li#start').hasClass('active')){
return;
}
changeStateClass('standby');
changePhaseClass('0');
time_inner=(new Date('2011/1/1 00:00:00'));
show_time();
changeStateClass('start');
start_time = new Date((new Date()).getTime() - (time_inner-(new Date('2011/1/1 00:00:00'))));
last_time = null;
$('.nav #reset').blur();
});

$('.nav #fs').click(function (event){
event.preventDefault();
if(!$.fullscreen.isFullScreen()){
$('body').fullscreen();
}else{
$.fullscreen.exit();
}
$('.nav #fs').blur();
});

// change countdown method
$('#time').click(function (event){
countdown = (countdown + 1) % 4;
updateHash();
});

function resize_display() {
var height=$('body').height();
var width=$('body').width();
Expand All @@ -183,9 +221,34 @@ $(function(){
});

function show_time(){
var time_str= ('00' + time_inner.getMinutes() ).slice(-2) + ':'
+ ('00' + time_inner.getSeconds() ).slice(-2);
var time_str= "";
var overtime = false;
if(countdown > 0){
var count_time = time_inner.getMinutes() * 60 + time_inner.getSeconds();
var time = new Date('2011/1/1 00:'+$('#time' + countdown).val());
var end_time = time.getMinutes() * 60 + time.getSeconds();
var rest_time = end_time - count_time;
if(isNaN(rest_time)){
// inputting?
time_str = "00:00";
time_color = "white";
}else{
var arest_time = Math.abs(rest_time);
var ms = [Math.floor(arest_time / 60), arest_time % 60];
time_str= ('00' + ms[0] ).slice(-2) + ':'
+ ('00' + ms[1] ).slice(-2);
overtime = rest_time <= 0;
}
}else{
time_str= ('00' + time_inner.getMinutes() ).slice(-2) + ':'
+ ('00' + time_inner.getSeconds() ).slice(-2);
}
$('#time').html(time_str);
if(overtime){
$('body').addClass('overtime');
}else{
$('body').removeClass('overtime');
}
}

var time_inner = new Date('2011/1/1 00:00:00');
Expand Down
21 changes: 21 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"short_name": "TimeKeeper",
"name": "TimeKeeper",
"description": "HTML5 Presentation Timer",
"icons": [
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"start_url": "index.html",
"background_color": "#808080",
"theme_color": "#808080",
"display": "standalone"
}
Binary file added mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions theme/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
/* styles for body element */
}

/* overtime(countdown only) */
.overtime{
}

/* classes for states */
.state-stanby{
Expand Down