From 22fe5d001410d5164ecf6ded9458ee256356c80c Mon Sep 17 00:00:00 2001 From: p0wen Date: Fri, 18 Sep 2020 20:26:49 +0000 Subject: [PATCH] fix routing of images --- assets/js/scripts/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/scripts/app.js b/assets/js/scripts/app.js index 86979c4..46bdf99 100644 --- a/assets/js/scripts/app.js +++ b/assets/js/scripts/app.js @@ -5,11 +5,11 @@ const currentHour = new Date().getHours(); if (currentHour > 0 && currentHour < 12) { // after Midnight and before 12:00PM document.getElementById("myDiv").style.backgroundImage = - "url('../assets/media/img/sunrise.jpg')"; + "url('assets/media/img/sunrise.jpg')"; } else if (currentHour >= 12) { // after 12:00PM document.getElementById("myDiv").style.backgroundImage = - "url('../assets/media/img/afternoon.jpg')"; + "url('assets/media/img/afternoon.jpg')"; } let changeBackgroundBTN = document.querySelectorAll(".changebackground button"); @@ -21,11 +21,11 @@ function changeBackground() { bgimage = this.getAttribute("background-img"); if (bgimage == "morning") { // Use Morning Background - document.getElementById("myDiv").style.backgroundImage = "url('../assets/media/img/sunrise.jpg')"; + document.getElementById("myDiv").style.backgroundImage = "url('assets/media/img/sunrise.jpg')"; } else if (bgimage == "afternoon") { // after 12:00PM - document.getElementById("myDiv").style.backgroundImage = "url('../assets/media/img/afternoon.jpg')"; + document.getElementById("myDiv").style.backgroundImage = "url('assets/media/img/afternoon.jpg')"; } else if (bgimage == "random") { // use random background from unsplash