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";--- -