Skip to content

Commit ce1b939

Browse files
author
Sebastian Schürmann
committed
feature(banira): docs page layout improv
1 parent ba101c4 commit ce1b939

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

packages/banira/src/formatter/doc-page.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,22 @@ export class FormatterDocPage {
3434
<link
3535
rel="stylesheet"
3636
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
37-
>
37+
/>
3838
</head>
3939
<body>
40-
<header>
40+
<header class="container">
41+
<hgroup>
4142
<h1>${title}</h1>
43+
</hgroup>
4244
</header>
43-
<main>
45+
<main class="container">
46+
<section id="preview">
4447
<${tagName}></${tagName}>
48+
</section>
4549
</main>
50+
<footer class="container">
51+
<small>Built with banira</small>
52+
</footer>
4653
</body>
4754
</html>`
4855
}

packages/component-webaudio/src/wa-knob.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class WAKnob extends HTMLElement {
1414

1515
constructor() {
1616
super();
17-
this.attachShadow({ mode: 'open' });
18-
this.render();
1917
}
2018

2119
get value() {
@@ -105,6 +103,8 @@ class WAKnob extends HTMLElement {
105103
}
106104

107105
connectedCallback() {
106+
this.attachShadow({ mode: 'open' });
107+
108108
// Initialize from attributes if present
109109
if (this.hasAttribute('min')) {
110110
this.min = parseFloat(this.getAttribute('min') || '0');
@@ -130,6 +130,7 @@ class WAKnob extends HTMLElement {
130130
this.setAttribute('min', this._min.toString());
131131
this.setAttribute('max', this._max.toString());
132132
this.setAttribute('default', this._default.toString());
133+
this.render();
133134
}
134135

135136
private render() {
@@ -168,7 +169,7 @@ class WAKnob extends HTMLElement {
168169
text-align: center;
169170
}
170171
</style>
171-
<div class='knob-body'>
172+
<div class="knob-body">
172173
<svg class="knob-svg" viewBox="0 0 60 60">
173174
<circle class="knob-base" cx="30" cy="30" r="25"/>
174175
<line class="knob-indicator"

0 commit comments

Comments
 (0)