From 074dbb14c4ecb2e61c214002d5ab9c47562e0683 Mon Sep 17 00:00:00 2001 From: limepotato Date: Wed, 30 Oct 2024 21:06:25 -0600 Subject: [PATCH] oh the js just wasnt working anywhere lmfao lmao lol rofl --- frontend/public/scripts/main.js | 14 ++++++++++---- frontend/src/components/Header.astro | 15 ++------------- frontend/src/layouts/BlogPost.astro | 2 +- frontend/src/layouts/Layout.astro | 2 +- frontend/src/pages/blog/index.astro | 4 ++-- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/frontend/public/scripts/main.js b/frontend/public/scripts/main.js index f9f7ae5..8d6ecb5 100644 --- a/frontend/public/scripts/main.js +++ b/frontend/public/scripts/main.js @@ -2,6 +2,7 @@ const meowEndpoint = "https://nelle.observer/api/meow"; const beepEndpoint = "https://nelle.observer/api/beep"; const kaomojiEndpoint = "https://nelle.observer/api/kaomoji"; var colorBool = Math.random() < 0.5; +var is_root = location.pathname == "/"; // loads all the functions to be loaded on load, pretty simple, it loads shit on load. function onLoad() { @@ -18,15 +19,20 @@ function onLoad() { // if javascript is enabled, this script will load, enabling all site elements that use javascript, by default these are all hidden. function jsEnabled() { + // if on main page, activate widgets + if (is_root) { + const lastFmWidget = document.getElementById("lastfm-widget"); + const ntfyWidgetContainer = document.getElementById("ntfyWidgetContainer"); + + + lastFmWidget.style.display = "initial"; + ntfyWidgetContainer.style.display = "initial"; + } // Get JS required element ids - const lastFmWidget = document.getElementById("lastfm-widget"); - const ntfyWidgetContainer = document.getElementById("ntfyWidgetContainer"); const sgaButton = document.getElementById("sgaButton"); const incrementButton = document.getElementById("incrementButton"); // enable js required element ids - lastFmWidget.style.display = "initial"; - ntfyWidgetContainer.style.display = "initial"; sgaButton.style.display = "initial"; incrementButton.style.display = "initial"; } diff --git a/frontend/src/components/Header.astro b/frontend/src/components/Header.astro index b551dd4..af3cdb9 100644 --- a/frontend/src/components/Header.astro +++ b/frontend/src/components/Header.astro @@ -1,10 +1,8 @@ --- ---- +import NormalScripts from "./scripts/normal-scripts.astro"; +import Head from "./Head.astro";--- -