From cd18f3d7dcdeec31cd12edd42f487bc25f687c82 Mon Sep 17 00:00:00 2001 From: Brittany Chiang Date: Mon, 25 Dec 2017 20:10:29 -0500 Subject: [PATCH] build --- js/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index 84115ee..3c06e67 100644 --- a/js/main.js +++ b/js/main.js @@ -1,13 +1,12 @@ $(function() { - const d = new Date(); const hours = d.getHours(); - const nighttime = (hours >= 19) || (hours <= 7); // 7pm <= hours <= 7am + const night = (hours >= 19) || (hours <= 7); // between 7pm and 7am const body = document.querySelector('body'); const toggle = document.getElementById('toggle'); const input = document.getElementById('switch'); - if (nighttime) { + if (night) { input.checked = true; body.classList.add('night'); }