<!DOCTYPE html>
<!--
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<html lang="de" manifest="manifest.appcache">
<head>
    <title>Fastforward bärneruhr.ch</title>
    <meta charset="utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="apple-mobile-web-app-title" content="Bärneruhr"/>
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr.min.css"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-black.min.css" data-class="black" data-name="Schwarz"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-white.min.css" data-class="white" data-name="Weiss"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-red.min.css" data-class="red" data-name="Rot"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-yellow.min.css" data-class="yellow" data-name="Gelb"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-green.min.css" data-class="green" data-name="Grün"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-blue.min.css" data-class="blue" data-name="Blau"/>
    <link rel="stylesheet" type="text/css" href="../dist/uhr-pink.min.css" data-class="pink" data-name="Pink"/>
    <link rel="shortcut icon" type="image/png" href="../resources/favicon.png"/>
    <link rel="apple-touch-icon-precomposed" href="../resources/apple-touch-icon-precomposed.png"/>
    <script type="text/javascript" src="../dist/libs.min.js"></script>
    <script type="text/javascript" src="../dist/jquery.uhr.complete.min.js"></script>
</head>
<body>
<div id="uhr"></div>
<button id="timer">Start</button>
<button id="reset">Reset</button>
<script type="text/javascript">
    (function ($) {
        var time = new Date(2000, 0, 1, 0, 0, 0, 0);
        var timer = null;
        $('#timer').on('click', function () {
            if (timer == null) {
                timer = window.setInterval(function () {
                    var minutes = time.getMinutes();
                    var hours = time.getHours();
                    minutes = (minutes + 1) % 60;
                    if (minutes == 0) {
                        hours = (hours + 1) % 24;
                        time.setHours(hours);
                    }
                    time.setMinutes(minutes);
                    $('#uhr').uhr('time', time);
                }, 200);
                $('#timer').html('Pause');
            } else {
                window.clearInterval(timer);
                timer = null;
                $('#timer').html('Start');
            }
        });
        $('#reset').on('click', function () {
            time = new Date(2000, 0, 1, 0, 0, 0, 0);
            $('#uhr').uhr('time', time);
        });
        $('#uhr').uhr({
            width: '200px',
            time: time
        });
    })(jQuery);
</script>
</body>
</html>