From ce1b9394c6668bf2afed398a4526a924aace7eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Sch=C3=BCrmann?= Date: Sat, 4 Jan 2025 22:11:41 +0100 Subject: [PATCH] feature(banira): docs page layout improv --- packages/banira/src/formatter/doc-page.ts | 13 ++++++++++--- packages/component-webaudio/src/wa-knob.ts | 7 ++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/banira/src/formatter/doc-page.ts b/packages/banira/src/formatter/doc-page.ts index 4d1f7e5..0b68a4d 100644 --- a/packages/banira/src/formatter/doc-page.ts +++ b/packages/banira/src/formatter/doc-page.ts @@ -34,15 +34,22 @@ export class FormatterDocPage { + /> -
+
+

${title}

+
-
+
+
<${tagName}> +
+
+ Built with banira +
` } diff --git a/packages/component-webaudio/src/wa-knob.ts b/packages/component-webaudio/src/wa-knob.ts index c6f8cb5..0f7d90f 100644 --- a/packages/component-webaudio/src/wa-knob.ts +++ b/packages/component-webaudio/src/wa-knob.ts @@ -14,8 +14,6 @@ class WAKnob extends HTMLElement { constructor() { super(); - this.attachShadow({ mode: 'open' }); - this.render(); } get value() { @@ -105,6 +103,8 @@ class WAKnob extends HTMLElement { } connectedCallback() { + this.attachShadow({ mode: 'open' }); + // Initialize from attributes if present if (this.hasAttribute('min')) { this.min = parseFloat(this.getAttribute('min') || '0'); @@ -130,6 +130,7 @@ class WAKnob extends HTMLElement { this.setAttribute('min', this._min.toString()); this.setAttribute('max', this._max.toString()); this.setAttribute('default', this._default.toString()); + this.render(); } private render() { @@ -168,7 +169,7 @@ class WAKnob extends HTMLElement { text-align: center; } -
+