added views

This commit is contained in:
Simon Martens
2024-11-10 00:04:37 +01:00
parent cd108bb5c5
commit dafa217003
131 changed files with 32550 additions and 0 deletions

22
views/assets/scripts.js Normal file
View File

@@ -0,0 +1,22 @@
function a() {
document.querySelectorAll("template[simple]").forEach((l) => {
let s = l.getAttribute("id"), n = l.content;
customElements.define(s, class extends HTMLElement {
constructor() {
super(), this.appendChild(n.cloneNode(!0)), this.slots = this.querySelectorAll("slot");
}
connectedCallback() {
let o = [];
this.slots.forEach((e) => {
let r = e.getAttribute("name"), t = this.querySelector(`[slot="${r}"]`);
t && (e.replaceWith(t.cloneNode(!0)), o.push(t));
}), o.forEach((e) => {
e.remove();
});
}
});
});
}
export {
a as setup
};