From 8d4d23009371e7ca83e0793185f0ae8485190007 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Fri, 29 Dec 2017 10:04:25 +0100 Subject: [PATCH] Fixing attempt for timer position --- css/index.css | 6 +----- js/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/css/index.css b/css/index.css index 727e212..341c7b8 100644 --- a/css/index.css +++ b/css/index.css @@ -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 { diff --git a/js/index.js b/js/index.js index 0d2adad..f58a403 100644 --- a/js/index.js +++ b/js/index.js @@ -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) { -- 2.44.0