-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmicron-ui-core.js
More file actions
32 lines (29 loc) · 1018 Bytes
/
micron-ui-core.js
File metadata and controls
32 lines (29 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { createElement, applyDiff } from 'https://esm.sh/webjsx@0.0.73';
import htm from 'https://esm.sh/htm@3.1.1';
export const html = htm.bind(createElement);
let _renderFn = null;
let _pending = false;
export function setRenderFn(fn) { _renderFn = fn; }
export function render() {
if (_pending) return;
_pending = true;
requestAnimationFrame(() => {
_pending = false;
if (_renderFn) _renderFn();
});
}
export function makeCollapsible(key, title, content, color='cyan') {
return { key, title, content, color };
}
export const TABS = [
{id:'seq', label:'Sequencer', icon:'⊞'},
{id:'patch', label:'Patch', icon:'◎'},
{id:'patterns', label:'Patterns', icon:'▤'},
{id:'rhythm', label:'Rhythm', icon:'♥'},
{id:'midi', label:'MIDI', icon:'⟵'},
{id:'sysex', label:'SysEx', icon:'⬡'},
{id:'setups', label:'Setups', icon:'⊕'},
{id:'config', label:'Config', icon:'⚙'},
{id:'standalone', label:'Standalone', icon:'▲'},
{id:'library', label:'Library', icon:'⊙'},
];