15 changed files with 181 additions and 178 deletions

No files matched your search

+1
View File
@@ -10,3 +10,4 @@ ios/App/Pods/
ios/App/DerivedData/ ios/App/DerivedData/
ios/App/*.xcworkspace/xcuserdata/ ios/App/*.xcworkspace/xcuserdata/
ios/App/*.xcodeproj/xcuserdata/ ios/App/*.xcodeproj/xcuserdata/
bug_image/*
+2 -2
View File
@@ -30,7 +30,7 @@ Open the local web address shown by Vite. Choose a dance template or add a sound
## Mobile downloads ## Mobile downloads
- [Android / e/OS debug APK](downloads/BeatHound-Android-eOS-1.0.0-debug.apk) — installable on Android API 24 or newer. The same APK is intended for compatible e/OS 4+ devices. - [Android / e/OS debug APK 1.0.1](downloads/BeatHound-Android-eOS-1.0.1-debug.apk) — installable on Android API 24 or newer. The same APK is intended for compatible e/OS 4+ devices.
The Android file is a debug-signed build for testing. It is not a Google Play release package. No iOS app or download is currently supported because of financial constraints. The Android file is a debug-signed build for testing. It is not a Google Play release package. No iOS app or download is currently supported because of financial constraints.
@@ -42,7 +42,7 @@ The mobile prototype uses Capacitor for Android.
npm run android:debug npm run android:debug
``` ```
The Android build needs JDK 21 and Android SDK Platform 36 / Build Tools 36.0.0. It writes the Gradle output and copies the APK to `downloads/BeatHound-Android-eOS-1.0.0-debug.apk`. iOS is currently unsupported for financial reasons; see the [native build guide](docs/native-builds.md). The Android build needs JDK 21 and Android SDK Platform 36 / Build Tools 36.0.0. It writes the Gradle output and copies the APK to `downloads/BeatHound-Android-eOS-1.0.1-debug.apk`. iOS is currently unsupported for financial reasons; see the [native build guide](docs/native-builds.md).
## Project checks ## Project checks
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "com.ninosaurier.beathound" applicationId "com.ninosaurier.beathound"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode 2
versionName "1.0.0" versionName "1.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions { aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
+1
View File
@@ -15,6 +15,7 @@
android:label="@string/title_activity_main" android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch" android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -11,7 +11,7 @@
"docs:build": "vitepress build docs", "docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs --host 0.0.0.0", "docs:preview": "vitepress preview docs --host 0.0.0.0",
"cap:sync": "npm run build:mobile && cap sync", "cap:sync": "npm run build:mobile && cap sync",
"android:debug": "npm run build:mobile && cap sync android && cd android && ./gradlew assembleDebug && cd .. && mkdir -p downloads && cp android/app/build/outputs/apk/debug/app-debug.apk downloads/BeatHound-Android-eOS-1.0.0-debug.apk", "android:debug": "npm run build:mobile && cap sync android && cd android && ./gradlew assembleDebug && cd .. && mkdir -p downloads && cp android/app/build/outputs/apk/debug/app-debug.apk downloads/BeatHound-Android-eOS-1.0.1-debug.apk",
"ios:sync": "npm run build:mobile && cap sync ios", "ios:sync": "npm run build:mobile && cap sync ios",
"ios:open": "cap open ios", "ios:open": "cap open ios",
"test": "vitest run", "test": "vitest run",
+5 -8
View File
@@ -1,4 +1,3 @@
import { useRef } from 'react';
import { IonButton, IonIcon, IonPopover } from '@ionic/react'; import { IonButton, IonIcon, IonPopover } from '@ionic/react';
import { ellipsisVertical } from 'ionicons/icons'; import { ellipsisVertical } from 'ionicons/icons';
import { usePopoverDisclosure } from '../hooks/usePopoverDisclosure'; import { usePopoverDisclosure } from '../hooks/usePopoverDisclosure';
@@ -10,11 +9,10 @@ interface AppHeaderProps {
} }
export function AppHeader({ activeView, onNavigate }: AppHeaderProps) { export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
const popoverRef = useRef<HTMLIonPopoverElement>(null);
const popover = usePopoverDisclosure(); const popover = usePopoverDisclosure();
function selectView(view: AppView): void { function selectView(view: AppView): void {
void popoverRef.current?.dismiss(); popover.close();
onNavigate(view); onNavigate(view);
} }
@@ -38,9 +36,9 @@ export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
<div className="app-header-actions"> <div className="app-header-actions">
<IonButton <IonButton
id="app-menu-trigger"
className="app-menu-trigger" className="app-menu-trigger"
fill="clear" fill="clear"
onClick={(event) => popover.open(event.nativeEvent)}
aria-label="Open app menu" aria-label="Open app menu"
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={popover.isOpen}
@@ -51,12 +49,11 @@ export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
<IonPopover <IonPopover
className="app-menu-popover" className="app-menu-popover"
ref={popoverRef} isOpen={popover.isOpen}
trigger="app-menu-trigger" event={popover.event}
triggerAction="click" reference="event"
side="bottom" side="bottom"
alignment="end" alignment="end"
onDidPresent={popover.onDidPresent}
onDidDismiss={popover.onDidDismiss} onDidDismiss={popover.onDidDismiss}
> >
<nav className="app-menu-options" aria-label="App navigation"> <nav className="app-menu-options" aria-label="App navigation">
+5 -4
View File
@@ -17,6 +17,7 @@ export const BeatTemplateSelector = memo(function BeatTemplateSelector({
const selectedTemplate = BEAT_TEMPLATES.find((template) => template.id === selectedTemplateId); const selectedTemplate = BEAT_TEMPLATES.find((template) => template.id === selectedTemplateId);
function selectTemplate(template: BeatTemplate): void { function selectTemplate(template: BeatTemplate): void {
popover.close();
setSelectedTemplateId(template.id); setSelectedTemplateId(template.id);
onSelectTemplate(template); onSelectTemplate(template);
} }
@@ -24,9 +25,9 @@ export const BeatTemplateSelector = memo(function BeatTemplateSelector({
return ( return (
<div className="beat-template-selector"> <div className="beat-template-selector">
<IonButton <IonButton
id="beat-template-trigger"
className="beat-template-trigger" className="beat-template-trigger"
fill="solid" fill="solid"
onClick={(event) => popover.open(event.nativeEvent)}
aria-label={`Dance template: ${selectedTemplate?.label ?? 'Select a template'}`} aria-label={`Dance template: ${selectedTemplate?.label ?? 'Select a template'}`}
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={popover.isOpen}
@@ -39,12 +40,12 @@ export const BeatTemplateSelector = memo(function BeatTemplateSelector({
<IonPopover <IonPopover
className="beat-template-popover" className="beat-template-popover"
trigger="beat-template-trigger" isOpen={popover.isOpen}
triggerAction="click" event={popover.event}
reference="event"
side="bottom" side="bottom"
alignment="center" alignment="center"
dismissOnSelect dismissOnSelect
onDidPresent={popover.onDidPresent}
onDidDismiss={popover.onDidDismiss} onDidDismiss={popover.onDidDismiss}
> >
<div className="beat-template-options" role="group" aria-label="Dance templates"> <div className="beat-template-options" role="group" aria-label="Dance templates">
+74 -90
View File
@@ -1,13 +1,13 @@
import { useEffect, useMemo, useRef, useState } from 'react'; import { useMemo, useRef, useState } from 'react';
import type { CSSProperties } from 'react';
import { import {
IonAccordion, IonAccordion,
IonAccordionGroup, IonAccordionGroup,
IonButton, IonButton,
IonContent,
IonIcon, IonIcon,
IonItem, IonItem,
IonLabel, IonLabel,
IonPopover, IonModal,
IonSearchbar, IonSearchbar,
} from '@ionic/react'; } from '@ionic/react';
import { add } from 'ionicons/icons'; import { add } from 'ionicons/icons';
@@ -17,7 +17,8 @@ import {
isInstrumentId, isInstrumentId,
} from '../domain/instruments'; } from '../domain/instruments';
import type { InstrumentId } from '../domain/instruments'; import type { InstrumentId } from '../domain/instruments';
import { usePopoverDisclosure } from '../hooks/usePopoverDisclosure';
const PICKER_SHEET_BREAKPOINTS = [0, 0.82, 1];
interface InstrumentSelectorProps { interface InstrumentSelectorProps {
onSelectInstrument: (instrumentId: InstrumentId) => void; onSelectInstrument: (instrumentId: InstrumentId) => void;
@@ -26,27 +27,8 @@ interface InstrumentSelectorProps {
export function InstrumentSelector({ onSelectInstrument }: InstrumentSelectorProps) { export function InstrumentSelector({ onSelectInstrument }: InstrumentSelectorProps) {
const [searchQuery, setSearchQuery] = useState(''); const [searchQuery, setSearchQuery] = useState('');
const [expandedCategoryIds, setExpandedCategoryIds] = useState<string[]>([]); const [expandedCategoryIds, setExpandedCategoryIds] = useState<string[]>([]);
const [viewportHeight, setViewportHeight] = useState( const [isPickerOpen, setIsPickerOpen] = useState(false);
() => window.visualViewport?.height ?? window.innerHeight, const modalRef = useRef<HTMLIonModalElement>(null);
);
const popoverRef = useRef<HTMLIonPopoverElement>(null);
const popover = usePopoverDisclosure();
useEffect(() => {
const visualViewport = window.visualViewport;
function updateViewportHeight(): void {
setViewportHeight(visualViewport?.height ?? window.innerHeight);
}
window.addEventListener('resize', updateViewportHeight);
visualViewport?.addEventListener('resize', updateViewportHeight);
return () => {
window.removeEventListener('resize', updateViewportHeight);
visualViewport?.removeEventListener('resize', updateViewportHeight);
};
}, []);
const filteredCategories = useMemo(() => { const filteredCategories = useMemo(() => {
const query = searchQuery.trim().toLowerCase(); const query = searchQuery.trim().toLowerCase();
@@ -100,8 +82,8 @@ export function InstrumentSelector({ onSelectInstrument }: InstrumentSelectorPro
setExpandedCategoryIds(typeof value === 'string' ? [value] : []); setExpandedCategoryIds(typeof value === 'string' ? [value] : []);
} }
function handlePopoverDidDismiss(): void { function handlePickerDidDismiss(): void {
popover.onDidDismiss(); setIsPickerOpen(false);
setSearchQuery(''); setSearchQuery('');
setExpandedCategoryIds([]); setExpandedCategoryIds([]);
} }
@@ -109,7 +91,7 @@ export function InstrumentSelector({ onSelectInstrument }: InstrumentSelectorPro
function addInstrument(value: unknown): void { function addInstrument(value: unknown): void {
if (!isInstrumentId(value)) return; if (!isInstrumentId(value)) return;
void popoverRef.current?.dismiss(); void modalRef.current?.dismiss();
onSelectInstrument(value); onSelectInstrument(value);
} }
@@ -119,77 +101,79 @@ export function InstrumentSelector({ onSelectInstrument }: InstrumentSelectorPro
id="instrument-add-trigger" id="instrument-add-trigger"
className="instrument-add-button" className="instrument-add-button"
fill="solid" fill="solid"
onClick={() => setIsPickerOpen(true)}
aria-label="Open samples" aria-label="Open samples"
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={isPickerOpen}
> >
<IonIcon icon={add} slot="start" /> <IonIcon icon={add} slot="start" />
Samples Samples
</IonButton> </IonButton>
<IonPopover <IonModal
ref={popoverRef} ref={modalRef}
className="instrument-picker-popover" className="instrument-picker-modal"
style={{ '--picker-viewport-height': `${viewportHeight}px` } as CSSProperties} isOpen={isPickerOpen}
trigger="instrument-add-trigger" breakpoints={PICKER_SHEET_BREAKPOINTS}
triggerAction="click" initialBreakpoint={1}
side="top" expandToScroll={false}
alignment="start" handle
onDidPresent={popover.onDidPresent} onDidDismiss={handlePickerDidDismiss}
onDidDismiss={handlePopoverDidDismiss}
> >
<div className="instrument-picker-menu"> <IonContent className="instrument-picker-content" scrollY={false}>
<IonSearchbar <div className="instrument-picker-menu">
className="instrument-picker-search" <IonSearchbar
aria-label="Search samples" className="instrument-picker-search"
placeholder="Search samples" aria-label="Search samples"
value={searchQuery} placeholder="Search samples"
debounce={0} value={searchQuery}
showClearButton="always" debounce={0}
onIonInput={(event) => handleSearchInput(event.detail.value)} showClearButton="always"
onIonClear={() => handleSearchInput('')} onIonInput={(event) => handleSearchInput(event.detail.value)}
/> onIonClear={() => handleSearchInput('')}
/>
{filteredCategories.length > 0 ? ( {filteredCategories.length > 0 ? (
<IonAccordionGroup <IonAccordionGroup
className="instrument-picker-accordion-group" className="instrument-picker-accordion-group"
multiple multiple
value={expandedCategoryIds} value={expandedCategoryIds}
onIonChange={(event) => handleAccordionChange(event.detail.value)} onIonChange={(event) => handleAccordionChange(event.detail.value)}
> >
{filteredCategories.map(({ category, instruments }) => ( {filteredCategories.map(({ category, instruments }) => (
<IonAccordion <IonAccordion
className="instrument-picker-category" className="instrument-picker-category"
key={category.id} key={category.id}
value={category.id} value={category.id}
> >
<IonItem className="instrument-category-header" slot="header" lines="none"> <IonItem className="instrument-category-header" slot="header" lines="none">
<IonLabel>{category.label}</IonLabel> <IonLabel>{category.label}</IonLabel>
</IonItem> </IonItem>
<div className="instrument-category-content" slot="content"> <div className="instrument-category-content" slot="content">
{instruments.map((instrument) => ( {instruments.map((instrument) => (
<IonButton <IonButton
className="instrument-picker-option" className="instrument-picker-option"
fill="solid" fill="solid"
key={instrument.id} key={instrument.id}
aria-label={`Add ${instrument.label}`} aria-label={`Add ${instrument.label}`}
onClick={() => addInstrument(instrument.id)} onClick={() => addInstrument(instrument.id)}
> >
<span className="instrument-picker-option-copy"> <span className="instrument-picker-option-copy">
<span>{instrument.label}</span> <span>{instrument.label}</span>
<span>{instrument.description}</span> <span>{instrument.description}</span>
</span> </span>
</IonButton> </IonButton>
))} ))}
</div> </div>
</IonAccordion> </IonAccordion>
))} ))}
</IonAccordionGroup> </IonAccordionGroup>
) : ( ) : (
<p className="instrument-picker-empty" role="status">No matching samples.</p> <p className="instrument-picker-empty" role="status">No matching samples.</p>
)} )}
</div> </div>
</IonPopover> </IonContent>
</IonModal>
</div> </div>
); );
} }
+8 -5
View File
@@ -24,10 +24,10 @@ export const SoundRingSelector = memo(function SoundRingSelector({
return ( return (
<> <>
<IonButton <IonButton
id="sound-ring-selector-trigger"
className="sound-ring-selector-trigger" className="sound-ring-selector-trigger"
fill="clear" fill="clear"
disabled={soundIds.length === 0} disabled={soundIds.length === 0}
onClick={(event) => popover.open(event.nativeEvent)}
aria-label={focusedSound ? `Selected ring: ${focusedSound.label}` : 'Select a sound ring'} aria-label={focusedSound ? `Selected ring: ${focusedSound.label}` : 'Select a sound ring'}
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={popover.isOpen}
@@ -46,12 +46,12 @@ export const SoundRingSelector = memo(function SoundRingSelector({
<IonPopover <IonPopover
className="sound-ring-popover" className="sound-ring-popover"
trigger="sound-ring-selector-trigger" isOpen={popover.isOpen}
triggerAction="click" event={popover.event}
reference="event"
side="bottom" side="bottom"
alignment="end" alignment="end"
dismissOnSelect dismissOnSelect
onDidPresent={popover.onDidPresent}
onDidDismiss={popover.onDidDismiss} onDidDismiss={popover.onDidDismiss}
> >
<div className="sound-ring-options" role="group" aria-label="Sound rings"> <div className="sound-ring-options" role="group" aria-label="Sound rings">
@@ -63,7 +63,10 @@ export const SoundRingSelector = memo(function SoundRingSelector({
className="sound-ring-option" className="sound-ring-option"
fill={selected ? 'solid' : 'clear'} fill={selected ? 'solid' : 'clear'}
aria-pressed={selected} aria-pressed={selected}
onClick={() => onSelectSound(soundId)} onClick={() => {
popover.close();
onSelectSound(soundId);
}}
> >
<span className="sound-ring-option-content"> <span className="sound-ring-option-content">
<span <span
+17 -6
View File
@@ -10,16 +10,21 @@ interface TempoControlProps {
onTempoChange: (tempoBpm: number) => void; onTempoChange: (tempoBpm: number) => void;
} }
const TEMPO_TRACK_HEIGHT = 164;
const TEMPO_THUMB_SIZE = 18;
export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange }: TempoControlProps) { export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange }: TempoControlProps) {
const popover = usePopoverDisclosure(); const popover = usePopoverDisclosure();
const tempoProgress = ((tempoBpm - MIN_TEMPO_BPM) / (MAX_TEMPO_BPM - MIN_TEMPO_BPM)) * 100; const tempoProgress = ((tempoBpm - MIN_TEMPO_BPM) / (MAX_TEMPO_BPM - MIN_TEMPO_BPM)) * 100;
const tempoThumbCenter = TEMPO_THUMB_SIZE / 2
+ ((100 - tempoProgress) / 100) * (TEMPO_TRACK_HEIGHT - TEMPO_THUMB_SIZE);
return ( return (
<> <>
<IonButton <IonButton
id="main-tempo-control-trigger"
className="tempo-trigger" className="tempo-trigger"
fill="solid" fill="solid"
onClick={(event) => popover.open(event.nativeEvent)}
aria-label={`Change tempo, currently ${tempoBpm} BPM`} aria-label={`Change tempo, currently ${tempoBpm} BPM`}
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={popover.isOpen}
@@ -32,16 +37,22 @@ export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange
<IonPopover <IonPopover
className="tempo-popover" className="tempo-popover"
trigger="main-tempo-control-trigger" isOpen={popover.isOpen}
triggerAction="click" event={popover.event}
reference="event"
side="top" side="top"
alignment="start" alignment="start"
onDidPresent={popover.onDidPresent}
onDidDismiss={popover.onDidDismiss} onDidDismiss={popover.onDidDismiss}
> >
<div className="tempo-popover-content"> <div className="tempo-popover-content">
<output className="tempo-value" aria-live="polite">{tempoBpm} BPM</output> <output className="tempo-value" aria-live="polite">{tempoBpm} BPM</output>
<div className="tempo-range-track"> <div
className="tempo-range-track"
style={{
'--tempo-progress': `${tempoProgress}%`,
'--tempo-thumb-center': `${tempoThumbCenter}px`,
} as CSSProperties}
>
<input <input
className="tempo-range" className="tempo-range"
type="range" type="range"
@@ -50,9 +61,9 @@ export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange
max={MAX_TEMPO_BPM} max={MAX_TEMPO_BPM}
step={1} step={1}
value={tempoBpm} value={tempoBpm}
style={{ '--tempo-progress': `${tempoProgress}%` } as CSSProperties}
onChange={(event) => onTempoChange(event.currentTarget.valueAsNumber)} onChange={(event) => onTempoChange(event.currentTarget.valueAsNumber)}
/> />
<span className="tempo-range-thumb" aria-hidden="true" />
</div> </div>
</div> </div>
</IonPopover> </IonPopover>
+8 -5
View File
@@ -19,9 +19,9 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
return ( return (
<> <>
<IonButton <IonButton
id="time-signature-trigger"
className="meter-trigger" className="meter-trigger"
fill="solid" fill="solid"
onClick={(event) => popover.open(event.nativeEvent)}
aria-label={`Change time signature, currently ${beatsPerBar}/4`} aria-label={`Change time signature, currently ${beatsPerBar}/4`}
aria-haspopup="dialog" aria-haspopup="dialog"
aria-expanded={popover.isOpen} aria-expanded={popover.isOpen}
@@ -34,12 +34,12 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
<IonPopover <IonPopover
className="meter-popover" className="meter-popover"
trigger="time-signature-trigger" isOpen={popover.isOpen}
triggerAction="click" event={popover.event}
reference="event"
side="bottom" side="bottom"
alignment="start" alignment="start"
dismissOnSelect dismissOnSelect
onDidPresent={popover.onDidPresent}
onDidDismiss={popover.onDidDismiss} onDidDismiss={popover.onDidDismiss}
> >
<div className="meter-popover-content" role="group" aria-label="Time signature"> <div className="meter-popover-content" role="group" aria-label="Time signature">
@@ -49,7 +49,10 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
className="meter-option" className="meter-option"
fill={option === beatsPerBar ? 'solid' : 'clear'} fill={option === beatsPerBar ? 'solid' : 'clear'}
aria-pressed={option === beatsPerBar} aria-pressed={option === beatsPerBar}
onClick={() => onChange(option)} onClick={() => {
popover.close();
onChange(option);
}}
> >
<span className="meter-option-content">{option}/4</span> <span className="meter-option-content">{option}/4</span>
</IonButton> </IonButton>
+13 -4
View File
@@ -1,16 +1,25 @@
import { useCallback, useState } from 'react'; import { useCallback, useState } from 'react';
export interface PopoverDisclosure { export interface PopoverDisclosure {
event: MouseEvent | undefined;
isOpen: boolean; isOpen: boolean;
onDidPresent: () => void; open: (event: MouseEvent) => void;
close: () => void;
onDidDismiss: () => void; onDidDismiss: () => void;
} }
export function usePopoverDisclosure(): PopoverDisclosure { export function usePopoverDisclosure(): PopoverDisclosure {
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const [event, setEvent] = useState<MouseEvent>();
const onDidPresent = useCallback(() => setIsOpen(true), []); const open = useCallback((popoverEvent: MouseEvent) => {
const onDidDismiss = useCallback(() => setIsOpen(false), []); setEvent(popoverEvent);
setIsOpen(true);
}, []);
const close = useCallback(() => {
setIsOpen(false);
setEvent(undefined);
}, []);
return { isOpen, onDidPresent, onDidDismiss }; return { event, isOpen, open, close, onDidDismiss: close };
} }
+44 -51
View File
@@ -872,25 +872,25 @@ ion-content.app-content-studio {
font-size: 19px; font-size: 19px;
} }
ion-popover.instrument-picker-popover { ion-modal.instrument-picker-modal {
--width: min(420px, calc(100vw - 24px)); --width: min(420px, calc(100vw - 24px));
--picker-menu-height: min(60vh, 420px); --height: min(620px, calc(100% - (var(--ion-modal-offset-top, 0px) + 10px)));
--picker-menu-height: min( --max-height: calc(100% - (var(--ion-modal-offset-top, 0px) + 10px));
60dvh,
420px,
max(120px, calc(var(--picker-viewport-height, 100vh) - 160px))
);
--max-height: var(--picker-menu-height);
--background: var(--surface); --background: var(--surface);
--backdrop-opacity: 0; --border-radius: 18px 18px 0 0;
--box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); --box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
}
ion-content.instrument-picker-content {
--background: var(--surface);
--overflow: hidden;
} }
.instrument-picker-menu { .instrument-picker-menu {
display: flex; display: flex;
width: 100%; width: 100%;
height: var(--picker-menu-height); height: 100%;
max-height: var(--picker-menu-height); max-height: 100%;
min-height: 0; min-height: 0;
box-sizing: border-box; box-sizing: border-box;
flex-direction: column; flex-direction: column;
@@ -1137,6 +1137,24 @@ ion-popover.instrument-picker-popover {
justify-content: center; justify-content: center;
} }
.tempo-range-track::before {
position: absolute;
top: 9px;
bottom: 9px;
left: 50%;
width: 3px;
border-radius: 999px;
background: linear-gradient(
to top,
var(--accent) 0%,
var(--accent) var(--tempo-progress),
#58537d var(--tempo-progress),
#58537d 100%
);
content: '';
transform: translateX(-50%);
}
.tempo-range { .tempo-range {
position: absolute; position: absolute;
top: 50%; top: 50%;
@@ -1148,57 +1166,32 @@ ion-popover.instrument-picker-popover {
border: 0; border: 0;
appearance: none; appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
z-index: 1;
transform: translate(-50%, -50%) rotate(-90deg); transform: translate(-50%, -50%) rotate(-90deg);
background: transparent; background: transparent;
cursor: ns-resize;
opacity: 0;
touch-action: none; touch-action: none;
} }
.tempo-range::-webkit-slider-runnable-track { .tempo-range-thumb {
width: 100%; position: absolute;
height: 3px; top: var(--tempo-thumb-center);
border-radius: 999px; left: 50%;
background: linear-gradient(
to right,
var(--accent) 0%,
var(--accent) var(--tempo-progress),
#58537d var(--tempo-progress),
#58537d 100%
);
}
.tempo-range::-webkit-slider-thumb {
width: 18px; width: 18px;
height: 18px; height: 18px;
margin-top: -7.5px;
border: 0;
border-radius: 50%;
-webkit-appearance: none;
background: var(--accent);
box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}
.tempo-range::-moz-range-track {
width: 100%;
height: 3px;
border-radius: 999px;
background: #58537d;
}
.tempo-range::-moz-range-progress {
border-radius: 999px;
background: var(--accent);
}
.tempo-range::-moz-range-thumb {
width: 18px;
height: 18px;
border: 0;
border-radius: 50%; border-radius: 50%;
background: var(--accent); background: var(--accent);
box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
pointer-events: none;
transform: translate(-50%, -50%);
} }
.tempo-range:focus-visible { .tempo-range-track:focus-within .tempo-range-thumb {
box-shadow: 0 0 0 2px var(--base), 0 0 0 4px var(--accent);
}
.tempo-range-track:focus-within {
outline: 2px solid var(--accent); outline: 2px solid var(--accent);
outline-offset: 4px; outline-offset: 4px;
} }