added alpine ajax - started conversion of the proj

This commit is contained in:
Simon Martens
2025-05-28 23:14:01 +02:00
parent fb8ac1b723
commit 168a733af1
24 changed files with 1412 additions and 1451 deletions

View File

@@ -0,0 +1,27 @@
export class IntLink extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
// Basic styling to mimic a link.
this.style.cursor = "pointer";
this.addEventListener("click", this.handleClick);
}
disconnectedCallback() {
this.removeEventListener("click", this.handleClick);
}
handleClick(event) {
const selector = this.getAttribute("data-jump");
if (selector) {
const target = document.querySelector(selector);
if (target) {
target.scrollIntoView({ behavior: "smooth" });
} else {
console.warn(`No element found for selector: ${selector}`);
}
}
}
}