diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 10a95fc..cce7ec7 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -27,7 +27,11 @@ - Tee + + Tee + Status + + diff --git a/public/index.html b/public/index.html index a1dcc8b..9f1646b 100644 --- a/public/index.html +++ b/public/index.html @@ -28,7 +28,11 @@ - Tee + + Tee + Status + + diff --git a/public/projects/index.html b/public/projects/index.html index 81d640f..72f49f8 100644 --- a/public/projects/index.html +++ b/public/projects/index.html @@ -27,7 +27,11 @@ - Tee + + Tee + Status + + diff --git a/public/salad/index.html b/public/salad/index.html index 57a7f0c..b9d3660 100644 --- a/public/salad/index.html +++ b/public/salad/index.html @@ -38,6 +38,7 @@
  • Discord
  • Pages
  • Blog
  • + diff --git a/static/assets/imgs/away.png b/static/assets/imgs/away.png new file mode 100644 index 0000000..9b39ef2 Binary files /dev/null and b/static/assets/imgs/away.png differ diff --git a/static/assets/imgs/dnd.png b/static/assets/imgs/dnd.png new file mode 100644 index 0000000..077ac34 Binary files /dev/null and b/static/assets/imgs/dnd.png differ diff --git a/static/assets/imgs/offline.png b/static/assets/imgs/offline.png new file mode 100644 index 0000000..c760bd1 Binary files /dev/null and b/static/assets/imgs/offline.png differ diff --git a/static/assets/imgs/online.png b/static/assets/imgs/online.png new file mode 100644 index 0000000..339ecbe Binary files /dev/null and b/static/assets/imgs/online.png differ diff --git a/static/assets/js/lanyard.js b/static/assets/js/lanyard.js new file mode 100644 index 0000000..862ef73 --- /dev/null +++ b/static/assets/js/lanyard.js @@ -0,0 +1,19 @@ +const dcstat = document.getElementById("dcstat"); +const apiEndpoint = `https://api.lanyard.rest/v1/users/1050531216589332581`; +fetch(apiEndpoint) + .then(response => response.json()) + .then(data => { + const dcStatus = data.data.discord_status; + if (dcStatus === "offline") { + dcstat.src = "/assets/imgs/offline.png"; + } else if (dcStatus === "online") { + dcstat.src = "/assets/imgs/online.png"; + } else if (dcStatus === "idle") { + dcstat.src = "/assets/imgs/away.png"; + } else if (dcStatus === "dnd") { + dcstat.src = "/assets/imgs/dnd.png"; + } + }) + .catch(error => { + console.error('Error fetching Discord status:', error); + }); diff --git a/static/assets/js/timezone.js b/static/assets/js/timezone.js index bbbf22e..76f207b 100644 --- a/static/assets/js/timezone.js +++ b/static/assets/js/timezone.js @@ -6,8 +6,11 @@ function displayDateTime() { }; const currentTime = new Date().toLocaleString('en-US', options); - document.getElementById('date-time').innerHTML = `It is ${currentTime} for Tee`; + + const now = new Date(); + const timeZoneOffset = now.getTimezoneOffset() / -60; + const gmtOffset = timeZoneOffset >= 0 ? `GMT+${timeZoneOffset}` : `GMT${timeZoneOffset}`; + document.getElementById('date-time').innerHTML = `It is ${currentTime} (${gmtOffset}) for Tee`; } - setInterval(displayDateTime, 1000); window.onload = displayDateTime;