home: fix js not being able to load after routing through htmx

This commit is contained in:
Agahnim 2026-03-24 16:10:49 +01:00
parent ec8a28a230
commit c8d03cf709
Signed by: Agahnim
SSH key fingerprint: SHA256:Zj65PJnE0dRYye8Ltk/qDglynyXUxJngQ9qqx/VI+b4
2 changed files with 27 additions and 26 deletions

View file

@ -216,7 +216,6 @@ table {
}
body {
background-image: url(assets/images/tiledbgpink.webp);
background-size: cover;
background-position: center;

View file

@ -91,35 +91,37 @@
<!-- I know I know but I need it for this pretty rainbow flagish animation -->
<script>
<!-- For rainbow text -->
const el = document.querySelector('woopwoop');
const text = el.textContent;
el.innerHTML = text.split('').map((ch, i) =>
`<span style="animation-delay: ${i * 0.08}s">${ch === ' ' ? '&nbsp;' : ch}</span>`
).join('');
(function() {
<!-- For rainbow text -->
const el = document.querySelector('woopwoop');
if (!el) return;
const text = el.textContent;
el.innerHTML = text.split('').map((ch, i) =>
`<span style="animation-delay: ${i * 0.08}s">${ch === ' ' ? '&nbsp;' : ch}</span>`
).join('');
const BIBOU_QUOTES = {{bibou_quotes| tojson | safe }};
const txtEl = document.querySelector('bibou-text');
const ctrEl = document.querySelector('bibou-container');
let intervalRef = null;
const BIBOU_QUOTES = {{bibou_quotes| tojson | safe }};
const ttText = (texte) => {
if (intervalRef) clearInterval(intervalRef);
const txtEl = document.querySelector('bibou-text');
const ctrEl = document.querySelector('bibou-container');
let intervalRef = null;
let accumulated = "";
let index = 0;
const ttText = (texte) => {
if (intervalRef) clearInterval(intervalRef);
let accumulated = "";
let index = 0;
intervalRef = setInterval(() => {
if (index < texte.length) {accumulated += texte.charAt(index); txtEl.textContent = accumulated; index++;} else {
clearInterval(intervalRef); intervalRef = null;
}
}, 40);
}; ctrEl.addEventListener('mouseenter', () => {
const quote = BIBOU_QUOTES[Math.floor(Math.random() * BIBOU_QUOTES.length)];
ttText(quote);
});
intervalRef = setInterval(() => {
if (index < texte.length) {accumulated += texte.charAt(index); txtEl.textContent = accumulated; index++;} else {
clearInterval(intervalRef); intervalRef = null;
}
}, 40);
};
ctrEl.addEventListener('mouseenter', () => {
const quote = BIBOU_QUOTES[Math.floor(Math.random() * BIBOU_QUOTES.length)];
ttText(quote);
});
})();
</script>