Ajout d'une page a propos

This commit is contained in:
EpicKiwi 2026-06-29 23:02:53 +02:00
parent 7e654b4640
commit cb10cc189c
Signed by: epickiwi
GPG key ID: C4B28FD2729941CE
6 changed files with 156 additions and 2 deletions

25
js/components/html.js Normal file
View file

@ -0,0 +1,25 @@
class HTMLImportElement extends HTMLTemplateElement {
get src(){
return new URL(this.getAttribute("src"), this.baseURI).toString();
}
connectedCallback(){
this.load()
}
async load(){
let res = await fetch(this.src);
if(!res.ok){
console.error(`Server responded with code ${res.status} ${res.statusText}`)
return
}
let htmlStr = await res.text()
let html = new DOMParser().parseFromString(htmlStr, "text/html");
this.content.replaceChildren(...Array.from(html.querySelector("body").childNodes))
}
}
customElements.define("camp-html", HTMLImportElement, {extends: "template"})

View file

@ -223,6 +223,15 @@ bindButtonToCategory(document.getElementById("explore-on-schedule"), "on-schedul
bindButtonToCategory(document.getElementById("explore-dodo"), "dodo")
bindButtonToCategory(document.getElementById("explore-bin"), "bin")
document.getElementById("logo").addEventListener("click", e => {
openFeature()
let panel = document.getElementById("result-panel")
panel.replaceChildren(document.getElementById("about-template").content.cloneNode(true));
requestAnimationFrame(() => {
panel.setActiveChildrenIndex(0, {behavior: "instant"})
})
})
{
const RESULT_PANEL = document.getElementById("result-panel")
/** @type {HTMLDialogElement} */