oh the js just wasnt working anywhere lmfao lmao lol rofl

This commit is contained in:
nelle 2024-10-30 21:06:25 -06:00
parent 67e58504ad
commit 074dbb14c4
5 changed files with 16 additions and 21 deletions

View file

@ -2,6 +2,7 @@ const meowEndpoint = "https://nelle.observer/api/meow";
const beepEndpoint = "https://nelle.observer/api/beep"; const beepEndpoint = "https://nelle.observer/api/beep";
const kaomojiEndpoint = "https://nelle.observer/api/kaomoji"; const kaomojiEndpoint = "https://nelle.observer/api/kaomoji";
var colorBool = Math.random() < 0.5; 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. // loads all the functions to be loaded on load, pretty simple, it loads shit on load.
function onLoad() { 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. // if javascript is enabled, this script will load, enabling all site elements that use javascript, by default these are all hidden.
function jsEnabled() { 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 // Get JS required element ids
const lastFmWidget = document.getElementById("lastfm-widget");
const ntfyWidgetContainer = document.getElementById("ntfyWidgetContainer");
const sgaButton = document.getElementById("sgaButton"); const sgaButton = document.getElementById("sgaButton");
const incrementButton = document.getElementById("incrementButton"); const incrementButton = document.getElementById("incrementButton");
// enable js required element ids // enable js required element ids
lastFmWidget.style.display = "initial";
ntfyWidgetContainer.style.display = "initial";
sgaButton.style.display = "initial"; sgaButton.style.display = "initial";
incrementButton.style.display = "initial"; incrementButton.style.display = "initial";
} }

View file

@ -1,10 +1,8 @@
--- ---
--- import NormalScripts from "./scripts/normal-scripts.astro";
import Head from "./Head.astro";---
<!--
onmouseover="PlaySound('hoverSound')"
onmouseout="StopSound('hoverSound')" -->
<section class="center nav"> <section class="center nav">
<nav class="menu"> <nav class="menu">
<button <button
@ -13,15 +11,6 @@
onclick="location.href='/'"> onclick="location.href='/'">
<span>home</span> <span>home</span>
</button> </button>
<!--
<button
class="custom-btn btn-1"
type="button"
onclick="location.href='/projects'"
>
<span>Projects</span>
</button>
-->
<button <button
class="custom-btn btn-1" class="custom-btn btn-1"
type="button" type="button"

View file

@ -31,8 +31,8 @@ const { title, description, pubDate, updatedDate } = Astro.props;
<div class="content"> <div class="content">
<slot /> <slot />
</div> </div>
</div>
</article> </article>
</div> </div>
</main> </main>
</Layout> </Layout>

View file

@ -16,7 +16,7 @@ const { title } = Astro.props;
<head> <head>
<Head title={title} /> <Head title={title} />
</head> </head>
<body onload="onLoad()" id="green"> <body onload="onLoad()">
<Header /> <Header />
<section class="content center"> <section class="content center">
<h1 class="title">{title}</h1> <h1 class="title">{title}</h1>

View file

@ -8,15 +8,15 @@ const posts = (await getCollection("blog")).sort(
--- ---
<Layout title="blog"> <Layout title="blog">
<div class="content">
<main> <main>
<section class="content">
<h3 class="subtitle" style="text-align: center;"> <h3 class="subtitle" style="text-align: center;">
This is where I post things and stuff This is where I post things and stuff
</h3> </h3>
<h4 style="text-align: center;"> <h4 style="text-align: center;">
This list is in chronological order oldest first, newest last. This list is in chronological order oldest first, newest last.
</h4> </h4>
</div> </section>
<section class="content"> <section class="content">
<hr /> <hr />
<a href="/rss.xml"><h3 style="text-align: center;">RSS Feed</h3></a> <a href="/rss.xml"><h3 style="text-align: center;">RSS Feed</h3></a>