Fixing attempt for timer position
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 29 Dec 2017 09:04:25 +0000 (10:04 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 29 Dec 2017 09:04:25 +0000 (10:04 +0100)
css/index.css
js/index.js

index 727e212..341c7b8 100644 (file)
@@ -270,20 +270,16 @@ td.score {
        padding-bottom: 10px;
 }
 
-/* Timer */
+/* Timer (dimensions given in javascript) */
 
 #timer {
        position: absolute;
        z-index: 100;
        left: 0;
        top: 0;
-       min-height: 100%;
-       width: 100%;
        background-color: white;
        cursor: pointer;
-       line-height: 100%;
        text-align: center;
-       vertical-align: middle;
 }
 
 .timeout {
index 0d2adad..f58a403 100644 (file)
@@ -193,7 +193,7 @@ new Vue({
                                };
                        },
                        template: `
-                               <div id="timer" :style="{lineHeight: textHeight + 'px', fontSize: 0.66*textHeight + 'px'}">
+                               <div id="timer" :style="{lineHeight: divHeight + 'px', fontSize: 0.66*divHeight + 'px', width: divWidth + 'px', height: divHeight + 'px'}">
                                        <div @click.left="pauseResume()" @click.right.prevent="reset()" :class="{timeout:time==0}">
                                                {{ formattedTime }}
                                        </div>
@@ -206,9 +206,12 @@ new Vue({
                                        let minutes = Math.floor(this.time / 60);
                                        return this.padToZero(minutes) + ":" + this.padToZero(seconds);
                                },
-                               textHeight: function() {
+                               divHeight: function() {
                                        return screen.height;
                                },
+                               divWidth: function() {
+                                       return screen.width;
+                               },
                        },
                        methods: {
                                padToZero: function(a) {