aboutsummaryrefslogtreecommitdiff
path: root/src/view/sequencer/addRemoveBeat.ts
diff options
context:
space:
mode:
authorJoris2022-06-11 16:42:33 +0200
committerJoris2022-06-11 16:42:33 +0200
commit03197b1ab992540b951fcbc6f841cfcd42a757f3 (patch)
tree2eb5277462b8dfef41e901a945f251725fb7ad8f /src/view/sequencer/addRemoveBeat.ts
parent70c672535f36edaeaf1d63d4637830b564271c34 (diff)
Add kick sequencer
Diffstat (limited to 'src/view/sequencer/addRemoveBeat.ts')
-rw-r--r--src/view/sequencer/addRemoveBeat.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/view/sequencer/addRemoveBeat.ts b/src/view/sequencer/addRemoveBeat.ts
new file mode 100644
index 0000000..e991d3f
--- /dev/null
+++ b/src/view/sequencer/addRemoveBeat.ts
@@ -0,0 +1,32 @@
+import h, { classNames } from 'lib/h'
+
+interface Params {
+ initBeats: number,
+ onRemove: (index: number) => void,
+ onAdd: (index: number) => void
+}
+
+export function view({ initBeats, onRemove, onAdd }: Params) {
+ let beats = initBeats
+
+ return h('div', { className: 'g-Sequencer__Buttons' },
+ h('button',
+ { onclick: () => {
+ if (beats > 1) {
+ beats -= 1
+ onRemove(beats)
+ }
+ }
+ },
+ 'Remove Beat'
+ ),
+ h('button',
+ { onclick: () => {
+ onAdd(beats)
+ beats += 1
+ }
+ },
+ 'Add Beat'
+ )
+ )
+}