diff --git a/js/jquery.fullscreen.min.js b/js/jquery.fullscreen.min.js
new file mode 100644
index 0000000..de65877
--- /dev/null
+++ b/js/jquery.fullscreen.min.js
@@ -0,0 +1,28 @@
+/*
+ * jquery.fullscreen v0.6.0
+ * https://github.com/private-face/jquery.fullscreen
+ *
+ * Copyright (c) 2012–2016 Vladimir Zhuravlev
+ * Released under the MIT license
+ * https://github.com/private-face/jquery.fullscreen/blob/master/LICENSE
+ *
+ * Date: 2016-08-25
+ **/
+(function(global, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD
+ define(['jquery'], function (jQuery) {
+ return factory(jQuery);
+ });
+ } else if (typeof exports === 'object') {
+ // CommonJS/Browserify
+ factory(require('jquery'));
+ } else {
+ // Global
+ factory(global.jQuery);
+ }
+}(this, function($) {
+
+function defined(a){return"undefined"!=typeof a}function extend(a,b,c){var d=function(){};d.prototype=b.prototype,a.prototype=new d,a.prototype.constructor=a,b.prototype.constructor=b,a._super=b.prototype,c&&$.extend(a.prototype,c)}function native(a,b){var c;"string"==typeof a&&(b=a,a=document);for(var d=0;d
37)&&defined(native("fullscreenElement"))&&(!defined(fsEnabled)||fsEnabled===!0),version=$.fn.jquery.split("."),JQ_LT_17=parseInt(version[0])<2&&parseInt(version[1])<7,FullScreenAbstract=function(){this.__options=null,this._fullScreenElement=null,this.__savedStyles={}};FullScreenAbstract.prototype={native:native,_DEFAULT_OPTIONS:{styles:{boxSizing:"border-box",MozBoxSizing:"border-box",WebkitBoxSizing:"border-box"},toggleClass:null},__documentOverflow:"",__htmlOverflow:"",_preventDocumentScroll:function(){this.__documentOverflow=document.body.style.overflow,this.__htmlOverflow=document.documentElement.style.overflow,$(this._fullScreenElement).is("body, html")||$("body, html").css("overflow","hidden")},_allowDocumentScroll:function(){document.body.style.overflow=this.__documentOverflow,document.documentElement.style.overflow=this.__htmlOverflow},_fullScreenChange:function(){this.__options&&(this.isFullScreen()?(this._preventDocumentScroll(),this._triggerEvents()):(this._allowDocumentScroll(),this._revertStyles(),this._triggerEvents(),this._fullScreenElement=null))},_fullScreenError:function(a){this.__options&&(this._revertStyles(),this._fullScreenElement=null,a&&$(document).trigger("fscreenerror",[a]))},_triggerEvents:function(){$(this._fullScreenElement).trigger(this.isFullScreen()?"fscreenopen":"fscreenclose"),$(document).trigger("fscreenchange",[this.isFullScreen(),this._fullScreenElement])},_saveAndApplyStyles:function(){var a=$(this._fullScreenElement);this.__savedStyles={};for(var b in this.__options.styles)this.__savedStyles[b]=this._fullScreenElement.style[b],this._fullScreenElement.style[b]=this.__options.styles[b];a.is("body")&&(document.documentElement.style.overflow=this.__options.styles.overflow),this.__options.toggleClass&&a.addClass(this.__options.toggleClass)},_revertStyles:function(){var a=$(this._fullScreenElement);for(var b in this.__options.styles)this._fullScreenElement.style[b]=this.__savedStyles[b];a.is("body")&&(document.documentElement.style.overflow=this.__savedStyles.overflow),this.__options.toggleClass&&a.removeClass(this.__options.toggleClass)},open:function(a,b){a!==this._fullScreenElement&&(this.isFullScreen()&&this.exit(),this._fullScreenElement=a,this.__options=$.extend(!0,{},this._DEFAULT_OPTIONS,b),this._saveAndApplyStyles())},exit:null,isFullScreen:null,isNativelySupported:function(){return IS_NATIVELY_SUPPORTED}};var FullScreenNative=function(){FullScreenNative._super.constructor.apply(this,arguments),this.exit=$.proxy(native("exitFullscreen"),document),this._DEFAULT_OPTIONS=$.extend(!0,{},this._DEFAULT_OPTIONS,{styles:{width:"100%",height:"100%"}}),$(document).bind(this._prefixedString("fullscreenchange")+" MSFullscreenChange",$.proxy(this._fullScreenChange,this)).bind(this._prefixedString("fullscreenerror")+" MSFullscreenError",$.proxy(this._fullScreenError,this))};extend(FullScreenNative,FullScreenAbstract,{VENDOR_PREFIXES:["","o","moz","webkit"],_prefixedString:function(a){return $.map(this.VENDOR_PREFIXES,function(b){return b+a}).join(" ")},open:function(a,b){FullScreenNative._super.open.apply(this,arguments);var c=native(a,"requestFullscreen");c.call(a)},exit:$.noop,isFullScreen:function(){return null!==native("fullscreenElement")},element:function(){return native("fullscreenElement")}});var FullScreenFallback=function(){FullScreenFallback._super.constructor.apply(this,arguments),this._DEFAULT_OPTIONS=$.extend({},this._DEFAULT_OPTIONS,{styles:{position:"fixed",zIndex:"2147483647",left:0,top:0,bottom:0,right:0}}),this.__delegateKeydownHandler()};extend(FullScreenFallback,FullScreenAbstract,{__isFullScreen:!1,__delegateKeydownHandler:function(){var a=$(document);a.delegate("*","keydown.fullscreen",$.proxy(this.__keydownHandler,this));var b=JQ_LT_17?a.data("events"):$._data(document).events,c=b.keydown;JQ_LT_17?b.live.unshift(b.live.pop()):c.splice(0,0,c.splice(c.delegateCount-1,1)[0])},__keydownHandler:function(a){return!this.isFullScreen()||27!==a.which||(this.exit(),!1)},_revertStyles:function(){FullScreenFallback._super._revertStyles.apply(this,arguments),this._fullScreenElement.offsetHeight},open:function(a){FullScreenFallback._super.open.apply(this,arguments),this.__isFullScreen=!0,this._fullScreenChange()},exit:function(){this.__isFullScreen&&(this.__isFullScreen=!1,this._fullScreenChange())},isFullScreen:function(){return this.__isFullScreen},element:function(){return this.__isFullScreen?this._fullScreenElement:null}}),$.fullscreen=IS_NATIVELY_SUPPORTED?new FullScreenNative:new FullScreenFallback,$.fn.fullscreen=function(a){var b=this[0];return a=$.extend({toggleClass:null,overflow:"hidden"},a),a.styles={overflow:a.overflow},delete a.overflow,b&&$.fullscreen.open(b,a),this};
+//# sourceMappingURL=jquery.fullscreen.min.js.mapreturn $.fullscreen;
+}));
\ No newline at end of file
diff --git a/js/timekeeper.js b/js/timekeeper.js
index 3406db0..d127071 100644
--- a/js/timekeeper.js
+++ b/js/timekeeper.js
@@ -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
@@ -24,6 +25,7 @@ THE SOFTWARE.
$(function(){
var loadedcss = '';
+ var countdown = 0;
$('#time1').val('15:00');
$('#time2').val('20:00');
$('#time3').val('25:00');
@@ -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();
}
@@ -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);
}
@@ -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();
@@ -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');
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 0000000..bb68dd1
--- /dev/null
+++ b/manifest.json
@@ -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"
+}
\ No newline at end of file
diff --git a/mstile-150x150.png b/mstile-150x150.png
new file mode 100644
index 0000000..689db6e
Binary files /dev/null and b/mstile-150x150.png differ
diff --git a/safari-pinned-tab.svg b/safari-pinned-tab.svg
new file mode 100644
index 0000000..fc58c44
--- /dev/null
+++ b/safari-pinned-tab.svg
@@ -0,0 +1,28 @@
+
+
+
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..7601d6b
Binary files /dev/null and b/screenshot.png differ
diff --git a/theme/default.css b/theme/default.css
index 60d848b..a8a93e3 100644
--- a/theme/default.css
+++ b/theme/default.css
@@ -29,6 +29,9 @@
/* styles for body element */
}
+/* overtime(countdown only) */
+.overtime{
+}
/* classes for states */
.state-stanby{