From 13de9931b0d3e2b5506977d3d54c822ea6a30e17 Mon Sep 17 00:00:00 2001 From: zyqunix <117040076+zyqunix@users.noreply.github.com> Date: Sun, 11 May 2025 14:54:11 +0200 Subject: [PATCH] fixes --- assets/css/style.css | 5 +++-- assets/js/index.js | 23 ++++++++++++++++++----- index.html | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 285ef18..48d8e7f 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -43,7 +43,8 @@ strong { margin-top: 10px; } -.time { +.time, +.weather { font-size: 18px; margin-bottom: 10px; color: #cccccc; @@ -560,7 +561,7 @@ div[class="cards sitemap shadow"] > h4 { .banan { position: fixed; - left: 30px !important; + right: 30px !important; bottom: 30px !important; width: 64px; cursor: pointer; diff --git a/assets/js/index.js b/assets/js/index.js index 6b66aeb..21e2f5c 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -43,6 +43,7 @@ function lan() { }).then(data => { const statusElem = document.getElementById('status'); const pfpElem = document.getElementById('profile-picture'); + const activity = document.querySelector('.activity'); const activityNameElem = document.getElementById('activity-name'); const activityImageElem = document.getElementById('activity-image'); @@ -73,10 +74,7 @@ function lan() { } else { activityImageElem.style.display = "none"; } - } else { - activityNameElem.innerHTML = "Playing No Game Activity"; - activityImageElem.style.display = "none"; - } + } else activity.style.display = "none"; }); } @@ -213,7 +211,6 @@ function fetchSong() { fetch(url) .then(response => response.json()) .then(data => { - console.log(data); const track = data?.recenttracks?.track?.[0]; if (!track) return; const artist = track.artist["#text"]; @@ -230,6 +227,22 @@ function fetchSong() { }); } +function fetchWeather(location) { + if (!location) { + fetch(`https://wttr.in/muc?format=%t | %C`) + .then(response => response.text()) + .then(data => { + document.getElementById('weather').innerText = data; + }) + } else { + fetch(`https://wttr.in/${location}?format=%t | %C`) + .then(data => { + document.getElementById('weather').innerText = data; + }) + } +} + +fetchWeather(); fetchSong(); setInterval(() => { diff --git a/index.html b/index.html index 4ca6f34..ac2e1a7 100644 --- a/index.html +++ b/index.html @@ -16,8 +16,8 @@ id="profile-picture" />

zyqunix

-
-
+
+
Coding, Listening to Music, Reverse Engineering, Playing Counter-Strike