Skip to content

Commit 99a276d

Browse files
committed
Two-column layout: controls left, sticky visualisation right
Wraps the envelope and sound panels in a controls column and puts the visualisation in a sticky right column so it stays in view while tweaking parameters. Stacks vertically with viz on top below 1024px. Bumps the page max-width from 960 to 1400 to give both columns room.
1 parent 9ba21d4 commit 99a276d

2 files changed

Lines changed: 50 additions & 25 deletions

File tree

index.html

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,39 @@ <h1>BBC Micro <code>ENVELOPE</code> editor</h1>
1515
</p>
1616
</header>
1717

18-
<section class="panel" id="envelope-panel">
19-
<h2>Envelope (N=1)</h2>
20-
<h3>Pitch envelope</h3>
21-
<div class="grid" id="pitch-grid"></div>
22-
<h3>Amplitude envelope</h3>
23-
<div class="grid" id="amp-grid"></div>
24-
<div class="basic-row">
25-
<input type="text" class="basic-line" id="envelope-line" spellcheck="false" autocomplete="off" />
26-
<button class="copy-btn" data-copy="envelope-line" title="Copy ENVELOPE statement" aria-label="Copy ENVELOPE statement"></button>
27-
</div>
28-
</section>
18+
<div class="layout">
19+
<div class="controls">
20+
<section class="panel" id="envelope-panel">
21+
<h2>Envelope (N=1)</h2>
22+
<h3>Pitch envelope</h3>
23+
<div class="grid" id="pitch-grid"></div>
24+
<h3>Amplitude envelope</h3>
25+
<div class="grid" id="amp-grid"></div>
26+
<div class="basic-row">
27+
<input type="text" class="basic-line" id="envelope-line" spellcheck="false" autocomplete="off" />
28+
<button class="copy-btn" data-copy="envelope-line" title="Copy ENVELOPE statement" aria-label="Copy ENVELOPE statement"></button>
29+
</div>
30+
</section>
2931

30-
<section class="panel">
31-
<h2>Sound parameters</h2>
32-
<div class="grid" id="sound-grid"></div>
33-
<div class="basic-row">
34-
<input type="text" class="basic-line" id="sound-line" spellcheck="false" autocomplete="off" />
35-
<button class="copy-btn" data-copy="sound-line" title="Copy SOUND statement" aria-label="Copy SOUND statement"></button>
32+
<section class="panel">
33+
<h2>Sound parameters</h2>
34+
<div class="grid" id="sound-grid"></div>
35+
<div class="basic-row">
36+
<input type="text" class="basic-line" id="sound-line" spellcheck="false" autocomplete="off" />
37+
<button class="copy-btn" data-copy="sound-line" title="Copy SOUND statement" aria-label="Copy SOUND statement"></button>
38+
</div>
39+
<button id="play">Play</button>
40+
<button id="stop">Stop</button>
41+
</section>
3642
</div>
37-
<button id="play">Play</button>
38-
<button id="stop">Stop</button>
39-
</section>
4043

41-
<section class="panel">
42-
<h2>Visualisation</h2>
43-
<canvas id="viz" width="900" height="320"></canvas>
44-
</section>
44+
<div class="viz-col">
45+
<section class="panel viz-panel">
46+
<h2>Visualisation</h2>
47+
<canvas id="viz" width="900" height="320"></canvas>
48+
</section>
49+
</div>
50+
</div>
4551
</main>
4652
<script type="module" src="/src/main.ts"></script>
4753
</body>

src/style.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,30 @@
88
body { margin: 0; }
99

1010
main {
11-
max-width: 960px;
11+
max-width: 1400px;
1212
margin: 0 auto;
1313
padding: 24px 16px 64px;
1414
}
1515

16+
.layout {
17+
display: grid;
18+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
19+
grid-template-areas: "controls viz";
20+
gap: 16px;
21+
align-items: start;
22+
}
23+
.controls { grid-area: controls; }
24+
.viz-col { grid-area: viz; }
25+
.viz-panel { position: sticky; top: 16px; }
26+
27+
@media (max-width: 1024px) {
28+
.layout {
29+
grid-template-columns: 1fr;
30+
grid-template-areas: "viz" "controls";
31+
}
32+
.viz-panel { position: static; }
33+
}
34+
1635
h1 { font-size: 1.4rem; margin: 0 0 4px; }
1736
h2 { font-size: 1rem; margin: 0 0 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.05em; }
1837
h3 { font-size: 0.8rem; margin: 14px 0 8px; color: #58a6ff; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

0 commit comments

Comments
 (0)