mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Improved beat jump visuals
This commit is contained in:
1 parent
642977e9bc
commit
394520c2cf
3 files changed
+25
-8
No files matched your search
@@ -84,8 +84,8 @@ export function BpmReadout({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const T_BTN =
|
const T_BTN =
|
||||||
'flex h-8 items-center justify-center rounded-lg font-mono text-xs text-text transition-colors ' +
|
'flex h-8 items-center justify-center rounded-lg font-mono text-xs text-text transition-[background-color,transform] duration-75 ' +
|
||||||
'hover:bg-ink-800 disabled:opacity-30 disabled:hover:bg-transparent'
|
'hover:bg-ink-800 active:scale-[0.92] active:bg-white/[0.14] disabled:opacity-30 disabled:hover:bg-transparent disabled:active:scale-100'
|
||||||
|
|
||||||
/** Nudge / octave / tap / lock — always visible on the control row. */
|
/** Nudge / octave / tap / lock — always visible on the control row. */
|
||||||
export function TempoControls({
|
export function TempoControls({
|
||||||
@@ -126,7 +126,7 @@ export function TempoControls({
|
|||||||
const off = bpm == null
|
const off = bpm == null
|
||||||
const of = flexible ? ` of marker ${markerIndex + 1}` : ''
|
const of = flexible ? ` of marker ${markerIndex + 1}` : ''
|
||||||
return (
|
return (
|
||||||
<div role="group" aria-label="Tempo" className="btn-glass flex h-10 shrink-0 items-center gap-0.5 rounded-xl px-1">
|
<div role="group" aria-label="Tempo" className="glass-group flex h-10 shrink-0 items-center gap-0.5 rounded-xl px-1">
|
||||||
<button className={`${T_BTN} w-7`} onClick={() => onNudgeBpm(-0.25)} disabled={off} title={`BPM −0.25${of}`}>−−</button>
|
<button className={`${T_BTN} w-7`} onClick={() => onNudgeBpm(-0.25)} disabled={off} title={`BPM −0.25${of}`}>−−</button>
|
||||||
<button className={`${T_BTN} w-[22px]`} onClick={() => onNudgeBpm(-0.01)} disabled={off} title={`BPM −0.01${of}`}>−</button>
|
<button className={`${T_BTN} w-[22px]`} onClick={() => onNudgeBpm(-0.01)} disabled={off} title={`BPM −0.01${of}`}>−</button>
|
||||||
<button className={`${T_BTN} w-[22px]`} onClick={() => onNudgeBpm(0.01)} disabled={off} title={`BPM +0.01${of}`}>+</button>
|
<button className={`${T_BTN} w-[22px]`} onClick={() => onNudgeBpm(0.01)} disabled={off} title={`BPM +0.01${of}`}>+</button>
|
||||||
@@ -188,7 +188,9 @@ export function GridEditStrip({
|
|||||||
}) {
|
}) {
|
||||||
const hasGrid = markerCount > 0
|
const hasGrid = markerCount > 0
|
||||||
const flexible = markerCount > 1
|
const flexible = markerCount > 1
|
||||||
const nudge = 'flex h-10 items-center px-2 font-mono text-[11px] text-text hover:bg-ink-800 disabled:opacity-30'
|
const nudge =
|
||||||
|
'flex h-10 items-center px-2 font-mono text-[11px] text-text transition-[background-color,transform] duration-75 ' +
|
||||||
|
'hover:bg-ink-800 active:scale-[0.92] active:bg-white/[0.14] disabled:opacity-30'
|
||||||
const pill = 'flex h-[34px] shrink-0 items-center gap-1.5 rounded-full px-3 text-xs disabled:opacity-35'
|
const pill = 'flex h-[34px] shrink-0 items-center gap-1.5 rounded-full px-3 text-xs disabled:opacity-35'
|
||||||
return (
|
return (
|
||||||
// A container, so the three actions on the right can drop their labels
|
// A container, so the three actions on the right can drop their labels
|
||||||
@@ -224,7 +226,7 @@ export function GridEditStrip({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="btn-glass flex h-10 shrink-0 items-center overflow-hidden rounded-xl">
|
<div className="glass-group flex h-10 shrink-0 items-center overflow-hidden rounded-xl">
|
||||||
{/* Phase nudges move the GOVERNING marker — not gated on atMarker,
|
{/* Phase nudges move the GOVERNING marker — not gated on atMarker,
|
||||||
since the drift is heard at the playhead, not at the marker. */}
|
since the drift is heard at the playhead, not at the marker. */}
|
||||||
<button className={nudge} onClick={() => onNudgeMarker(-10)} disabled={!hasGrid} title="Move the marker −10 ms">−10</button>
|
<button className={nudge} onClick={() => onNudgeMarker(-10)} disabled={!hasGrid} title="Move the marker −10 ms">−10</button>
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ const LIT =
|
|||||||
const KEY =
|
const KEY =
|
||||||
'flex items-center justify-center rounded-[9px] transition-[color,background-color,box-shadow,transform,filter] duration-75 ' +
|
'flex items-center justify-center rounded-[9px] transition-[color,background-color,box-shadow,transform,filter] duration-75 ' +
|
||||||
'active:scale-[0.93] active:brightness-125 disabled:opacity-30 disabled:active:scale-100'
|
'active:scale-[0.93] active:brightness-125 disabled:opacity-30 disabled:active:scale-100'
|
||||||
|
// One half of the ‹ › pair: its own hover and press, inside the shared surface.
|
||||||
|
const HALF =
|
||||||
|
'flex h-10 w-[34px] items-center justify-center text-text transition-[background-color,transform] duration-75 ' +
|
||||||
|
'hover:bg-white/[0.08] active:scale-[0.92] active:bg-white/[0.14] disabled:opacity-30 ' +
|
||||||
|
'disabled:hover:bg-transparent disabled:active:scale-100'
|
||||||
// An armed IN: a green rim and glow — "waiting for OUT".
|
// An armed IN: a green rim and glow — "waiting for OUT".
|
||||||
const ARMED =
|
const ARMED =
|
||||||
'bg-mint/15 text-mint shadow-[inset_0_0_0_1px_rgb(61_220_132/0.75),0_0_12px_-3px_rgb(61_220_132/0.7)]'
|
'bg-mint/15 text-mint shadow-[inset_0_0_0_1px_rgb(61_220_132/0.75),0_0_12px_-3px_rgb(61_220_132/0.7)]'
|
||||||
@@ -172,12 +177,12 @@ export function LoopControls({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div role="group" aria-label="Jump or move loop" className="btn-glass flex h-10 items-center rounded-xl">
|
<div role="group" aria-label="Jump or move loop" className="glass-group flex h-10 items-center rounded-xl">
|
||||||
<button
|
<button
|
||||||
onClick={() => onMove(-1)}
|
onClick={() => onMove(-1)}
|
||||||
disabled={!canMove}
|
disabled={!canMove}
|
||||||
title={`${what} back (←)`}
|
title={`${what} back (←)`}
|
||||||
className="flex h-10 w-[34px] items-center justify-center text-text disabled:opacity-30"
|
className={`${HALF} rounded-l-xl`}
|
||||||
>
|
>
|
||||||
<Icon name="chevronLeft" size={15} strokeWidth={2.2} />
|
<Icon name="chevronLeft" size={15} strokeWidth={2.2} />
|
||||||
</button>
|
</button>
|
||||||
@@ -185,7 +190,7 @@ export function LoopControls({
|
|||||||
onClick={() => onMove(1)}
|
onClick={() => onMove(1)}
|
||||||
disabled={!canMove}
|
disabled={!canMove}
|
||||||
title={`${what} forward (→)`}
|
title={`${what} forward (→)`}
|
||||||
className="flex h-10 w-[34px] items-center justify-center text-text disabled:opacity-30"
|
className={`${HALF} rounded-r-xl`}
|
||||||
>
|
>
|
||||||
<Icon name="chevronRight" size={15} strokeWidth={2.2} />
|
<Icon name="chevronRight" size={15} strokeWidth={2.2} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -242,6 +242,16 @@ option {
|
|||||||
background: rgb(255 255 255 / 0.12);
|
background: rgb(255 255 255 / 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A row of buttons that should LOOK like one raised control (‹ ›, the tempo
|
||||||
|
group) but act as separate keys: the btn-glass surface with no hover of
|
||||||
|
its own, so only the key under the pointer reacts. */
|
||||||
|
.glass-group {
|
||||||
|
background: rgb(255 255 255 / 0.07);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 rgb(255 255 255 / 0.14),
|
||||||
|
inset 0 0 0 1px rgb(255 255 255 / 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
/* THE primary action: a lit pill, white into the accent. One per view. */
|
/* THE primary action: a lit pill, white into the accent. One per view. */
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
color: var(--color-ink-950);
|
color: var(--color-ink-950);
|
||||||
|
|||||||
Reference in new issue
Block a user