optimize scripts

This commit is contained in:
nelle 2024-08-18 01:37:10 -06:00
parent c07fc2070f
commit d0f331f15a
7 changed files with 20 additions and 9 deletions

View file

@ -1,12 +1,12 @@
// both
function send(message) {
let r = new XMLHttpRequest();
const r = new XMLHttpRequest();
r.open("POST", "https://ntfy.ouroboros.group/beep", true);
r.setRequestHeader("Content-Type", "text/plain");
r.send(message);
}
// send notification
let ntfyInput = document.getElementById("ntfy-input");
const ntfyInput = document.getElementById("ntfy-input");
function sendNotification() {
if (ntfyInput.value.length <= 0) return;
send(ntfyInput.value);

View file

@ -0,0 +1,5 @@
<!-- optimized -->
<script src="../scripts/sound.js"></script>
<!-- unoptimized -->
<script is:inline src="/scripts/galactic-font.js"></script>

View file

@ -0,0 +1,9 @@
<!-- optimized -->
<script src="../scripts/lastfm.js"></script>
<script src="../scripts/sound.js"></script>
<!-- unoptimized -->
<script is:inline src="/scripts/ntfy.js"></script>
<script is:inline src="/scripts/fuckchrome.js"></script>
<script is:inline src="/scripts/sga.js"></script>

View file

@ -2,6 +2,7 @@
import Header from "../components/Header.astro";
import Head from "../components/Head.astro";
import Footer from "../components/Footer.astro";
import NochromeScripts from "../components/nochrome-scripts.astro";
interface Props {
title: string;
}
@ -23,7 +24,6 @@ const { title } = Astro.props;
</div>
</section>
<Footer />
<script src="/scripts/rain.js"></script>
<script src="/scripts/galactic-font.js"></script>
<NochromeScripts />
</body>
</html>

View file

@ -2,6 +2,7 @@
import Head from "../components/Head.astro";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import NormalScripts from "../components/normal-scripts.astro";
interface Props {
title: string;
@ -22,11 +23,7 @@ const { title } = Astro.props;
</section>
<slot />
<Footer />
<script src="/scripts/sga.js"></script>
<script src="/scripts/lastfm.js"></script>
<script src="/scripts/sound.js"></script>
<script src="/scripts/ntfy.js"></script>
<script src="/scripts/fuckchrome.js"></script>
<NormalScripts />
<audio
id="clickSound"
src="/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3">