From 624716764f2f9bc9097606ad35a7688119ca830a Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 26 Nov 2023 17:10:42 +0100 Subject: Updated includes/fragments/dashboard.inc (automated) --- includes/fragments/dashboard.inc | 95 ++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/includes/fragments/dashboard.inc b/includes/fragments/dashboard.inc index 2a6d905..1e053e6 100644 --- a/includes/fragments/dashboard.inc +++ b/includes/fragments/dashboard.inc @@ -61,49 +61,6 @@ global $use2023UI; ?>! -
@@ -129,6 +86,8 @@ global $use2023UI; Raindrops System

--:--

+ +
@@ -161,7 +120,7 @@ global $use2023UI; hour12: false })).format(new Date()); - document.getElementById("live-time-raindrops").innerText = time1; + document.getElementById("live-time-raindrops").innerText = time1.replace("24:", "00:"); document.getElementById("live-time-raindrops-outer").style.backgroundPositionY = getDayPercentage(time1) + "%"; let time4 = (new Intl.DateTimeFormat('en-US', { @@ -171,7 +130,7 @@ global $use2023UI; hour12: false })).format(new Date()); - document.getElementById("live-time-moonwind").innerText = time4; + document.getElementById("live-time-moonwind").innerText = time4.replace("24:", "00:"); document.getElementById("live-time-moonwind-outer").style.backgroundPositionY = getDayPercentage(time4) + "%"; let time2 = (new Intl.DateTimeFormat('en-US', { @@ -181,7 +140,7 @@ global $use2023UI; hour12: false })).format(new Date()); - document.getElementById("live-time-cloudburst").innerText = time2; + document.getElementById("live-time-cloudburst").innerText = time2.replace("24:", "00:"); document.getElementById("live-time-cloudburst-outer").style.backgroundPositionY = getDayPercentage(time2) + "%"; let time3 = (new Intl.DateTimeFormat('en-US', { @@ -191,8 +150,50 @@ global $use2023UI; hour12: false })).format(new Date()); - document.getElementById("live-time-other").innerText = time3; + document.getElementById("live-time-other").innerText = time3.replace("24:", "00:"); document.getElementById("live-time-other-outer").style.backgroundPositionY = getDayPercentage(time3) + "%"; + + let greeting = "Hi"; + + switch (new Date().getHours()) { + case 22: + case 23: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + greeting = "Good night"; + break; + + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + greeting = "Good morning"; + break; + + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + greeting = "Good afternoon"; + break; + + case 18: + case 19: + case 20: + case 21: + greeting = "Good evening"; + break; + } + + document.getElementById("greeting").innerText = greeting; } updateTime(); -- cgit