aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/z-component.js
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-05-20 17:29:28 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-05-20 17:30:28 +0200
commitc6fb7b4962778c12f786d7d4de96787459a3b4dc (patch)
tree4e21b9a1afd06d7edf5dd87dfffe822c073c6521 /src/frontend/z-component.js
parent755c794883467609e425207f6a543d2e8c6d6b46 (diff)
frontend: add comptime bundler
Diffstat (limited to 'src/frontend/z-component.js')
-rw-r--r--src/frontend/z-component.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/frontend/z-component.js b/src/frontend/z-component.js
new file mode 100644
index 0000000..e9b63ff
--- /dev/null
+++ b/src/frontend/z-component.js
@@ -0,0 +1,17 @@
+customElements.define(
+ "z-component",
+ class extends HTMLElement {
+ constructor() {
+ super();
+ this.attachShadow({ mode: 'open' })
+ }
+
+ connectedCallback() {
+ const type = this.getAttribute('type');
+ const template = document.getElementById(`--${type}`);
+ const node = document.importNode(template.content, true);
+ this.shadowRoot.id = 'root';
+ this.shadowRoot.appendChild(node);
+ }
+ }
+);