Fix flashing of unset time and styles.
This commit is contained in:
parent
ccc2d6a9c7
commit
ea72877840
|
|
@ -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 () {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
<title>Analog Clock</title>
|
||||
<script src="./app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="clock">
|
||||
|
|
@ -35,6 +36,5 @@
|
|||
<footer>
|
||||
2021 © <a href="https://johnespiritu.dev" target="_blank">John Espiritu</a>
|
||||
</footer>
|
||||
<script src="./app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue