From ea7287784058846c20aad1e21470f84238358d5b Mon Sep 17 00:00:00 2001 From: johnillo Date: Sun, 8 Aug 2021 19:51:56 +0800 Subject: [PATCH] Fix flashing of unset time and styles. --- dist/app.js | 12 ++++++------ dist/index.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/app.js b/dist/app.js index a283b51..0b5e269 100644 --- a/dist/app.js +++ b/dist/app.js @@ -1,9 +1,4 @@ -var second = document.getElementById('second'); -var minute = document.getElementById('minute'); -var hour = document.getElementById('hour'); -var dow = document.getElementById('dow'); -var day = document.getElementById('day'); - +var second, minute, hour, dow, day; var DAY_OF_WEEK = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']; function getRotation60Deg(value) { @@ -35,6 +30,11 @@ function render() { } window.onload = function () { + second = document.getElementById('second'); + minute = document.getElementById('minute'); + hour = document.getElementById('hour'); + dow = document.getElementById('dow'); + day = document.getElementById('day'); render(); setInterval(render, 16); setTimeout(function () { diff --git a/dist/index.html b/dist/index.html index 939fcd7..6faa860 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,6 +6,7 @@ Analog Clock +
@@ -35,6 +36,5 @@ - \ No newline at end of file