Skip to content

Commit

Permalink
WIP site layout changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neonfuz committed Jul 26, 2022
1 parent 3a9d0db commit 3ba21a4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
17 changes: 15 additions & 2 deletions src/lib/ControlPanel.svelte → src/lib/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,18 @@
}
</script>

<InstrumentPanel bind:params="{instrument}"/>
<Piano on:noteUp="{noteUp}" on:noteDown="{noteDown}"/>
<div class="container">
<InstrumentPanel bind:params="{instrument}"/>
<Piano on:noteUp="{noteUp}" on:noteDown="{noteDown}"/>
</div>

<style>
.container {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
align-items: center;
justify-content: space-between;
}
</style>
10 changes: 6 additions & 4 deletions src/lib/piano/Piano.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
on:keyup="{(ev) => handleKey(ev, false)}"
/>

<div id="controlPanel">
<button on:click={scaleUp}>+</button>
<button on:click={scaleDown}>-</button>
</div>

<div id="piano" bind:clientWidth="{elemWidth}">
{#each generateKeys(numKeys) as {isWhite, row, column}, index}
<div
Expand All @@ -108,10 +113,6 @@
</div>
{/each}
</div>
<div id="controlPanel">
<button on:click={scaleUp}>+</button>
<button on:click={scaleDown}>-</button>
</div>

<style>
.whiteKey {
Expand Down Expand Up @@ -161,5 +162,6 @@
grid-template-rows: 60px 50px;
grid-auto-flow: row;
display: grid;
width: 100%;
}
</style>
8 changes: 8 additions & 0 deletions src/routes/__layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<slot></slot>

<style>
:global(body) {
margin: 0;
font-family: sans-serif;
}
</style>
4 changes: 2 additions & 2 deletions src/routes/index.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import ControlPanel from "$lib/ControlPanel.svelte"
import App from "$lib/App.svelte"
</script>

<ControlPanel />
<App />

0 comments on commit 3ba21a4

Please sign in to comment.