mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Improved prep control UI
This commit is contained in:
1 parent
fdcae5e0f5
commit
14f5bf3774
3 files changed
+60
-92
No files matched your search
@@ -10,13 +10,14 @@ interface Props {
|
||||
const SLOTS = [0, 1, 2, 3, 4, 5, 6, 7] // Traktor hotcue slots → labelled 1–8
|
||||
|
||||
/**
|
||||
* Traktor-style hotcue bar: all 8 hotcue slots, colour-coded by cue type when
|
||||
* assigned (gray when empty). Clicking a slot selects it — the parent decides
|
||||
* whether that creates a cue (empty slot) or jumps to it (assigned slot).
|
||||
* The 8 hotcue slots, colour-coded by cue type when assigned (gray when empty).
|
||||
* Rendered as a flex-1 group inside the hotcue row; the parent supplies the row
|
||||
* chrome and the trailing edit controls. Clicking a slot delegates to the parent
|
||||
* (create when empty, jump/trigger when assigned).
|
||||
*/
|
||||
export function HotcueBar({ cues, selectedSlot, onSlotClick }: Props) {
|
||||
return (
|
||||
<div className="flex h-8 shrink-0 items-stretch gap-px border-t border-line bg-ink-950">
|
||||
<div className="flex flex-1 items-stretch gap-px">
|
||||
{SLOTS.map((slot) => {
|
||||
const cue = cues.find((c) => c.hotcue === slot) ?? null
|
||||
const selected = selectedSlot === slot
|
||||
@@ -34,9 +35,9 @@ export function HotcueBar({ cues, selectedSlot, onSlotClick }: Props) {
|
||||
}
|
||||
style={color ? { backgroundColor: color, color: contrastText(color) } : undefined}
|
||||
className={
|
||||
'flex flex-1 items-center justify-center text-xs font-semibold transition-[filter] hover:brightness-110 ' +
|
||||
(color ? '' : 'text-faint hover:bg-ink-900 ') +
|
||||
(selected ? 'ring-2 ring-inset ring-white/80' : '')
|
||||
'relative flex flex-1 items-center justify-center text-sm font-semibold transition-colors ' +
|
||||
(color ? 'hover:brightness-110' : 'bg-ink-900 text-faint hover:bg-ink-800') +
|
||||
(selected ? ' ring-2 ring-inset ring-white/80' : '')
|
||||
}
|
||||
>
|
||||
{slot + 1}
|
||||
|
||||
Reference in new issue
Block a user