Compare commits
18
Commits
5c45ac845d
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e071a26055 | ||
|
|
9defd6fd02 | ||
|
|
cb5517e249 | ||
|
|
b46d251c9f | ||
|
|
ed0ef552eb | ||
|
|
25835f73d6 | ||
|
|
beed163d35 | ||
|
|
afbf445b0f | ||
|
|
fc81fee862 | ||
|
|
a55281b1aa | ||
|
|
b236d40053 | ||
|
|
ad518ad2a6 | ||
|
|
33626aaf55 | ||
|
|
7481fbf711 | ||
|
|
42735005b1 | ||
|
|
22606e7f79 | ||
|
|
a9d3331044 | ||
|
|
08e3e8f46d |
No files matched your search
@@ -28,11 +28,13 @@ npm run dev
|
|||||||
|
|
||||||
Open the local web address shown by Vite. Choose a dance template or add a sound, then press **Play**. Your browser may ask to allow audio.
|
Open the local web address shown by Vite. Choose a dance template or add a sound, then press **Play**. Your browser may ask to allow audio.
|
||||||
|
|
||||||
|
To run the app on an Android phone with live reload, connect the phone with USB debugging enabled and put it on the same Wi-Fi network as your computer. Start Vite with `npm run dev`, then run `npm run dev:android` in a second terminal. Capacitor installs and opens the app on the phone; code changes reload while the dev server is running. Stop the native run with **Ctrl+C**.
|
||||||
|
|
||||||
## 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 0.1.3](downloads/BeatHound-Android-eOS-0.1.3-debug.apk) — installable on Android API 24 or newer and 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 generated 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.
|
||||||
|
|
||||||
## Build the Android prototype
|
## Build the Android prototype
|
||||||
|
|
||||||
@@ -42,7 +44,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-0.1.3-debug.apk`. iOS is currently unsupported for financial reasons; see the [native build guide](docs/native-builds.md).
|
||||||
|
|
||||||
## Project checks
|
## Project checks
|
||||||
|
|
||||||
|
|||||||
@@ -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 8
|
||||||
versionName "1.0.0"
|
versionName "0.1.3"
|
||||||
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.
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
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>
|
||||||
|
|||||||
@@ -21,16 +21,16 @@ Gradle creates the debug APK here:
|
|||||||
android/app/build/outputs/apk/debug/app-debug.apk
|
android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
The checked-in file `downloads/BeatHound-Android-eOS-1.0.0-debug.apk` is debug-signed and linked from the root README. It is for direct testing and sideloading, not for Google Play publication. A release build should use a private signing key that is not stored in Git.
|
After a successful build, `downloads/BeatHound-Android-eOS-0.1.3-debug.apk` is debug-signed and available for direct testing and sideloading, not for Google Play publication. A release build should use a private signing key that is not stored in Git.
|
||||||
|
|
||||||
`npm run android:debug` also copies each new debug build to that `downloads/` path.
|
`npm run android:debug` also copies each new debug build to `downloads/BeatHound-Android-eOS-0.1.3-debug.apk`.
|
||||||
|
|
||||||
### Install with ADB
|
### Install with ADB
|
||||||
|
|
||||||
With USB debugging enabled on an Android or e/OS device, install the APK with:
|
With USB debugging enabled on an Android or e/OS device, install the APK with:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
adb install downloads/BeatHound-Android-eOS-1.0.0-debug.apk
|
adb install downloads/BeatHound-Android-eOS-0.1.3-debug.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also transfer the APK to the device and open it. The device may ask you to allow installation from that file source.
|
You can also transfer the APK to the device and open it. The device may ask you to allow installation from that file source.
|
||||||
|
|||||||
@@ -86,6 +86,22 @@ npm run dev
|
|||||||
|
|
||||||
Vite prints a local web address. Open that address in your browser. The dev server listens on all network interfaces, so it may also be reachable from another device on your local network.
|
Vite prints a local web address. Open that address in your browser. The dev server listens on all network interfaces, so it may also be reachable from another device on your local network.
|
||||||
|
|
||||||
|
### Run on an Android phone with live reload
|
||||||
|
|
||||||
|
Connect the Android phone to the computer with USB debugging enabled, and make sure both devices are on the same Wi-Fi network. In the project folder, start the Vite server in one terminal:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
In a second terminal, install and launch the app on the connected phone:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run dev:android
|
||||||
|
```
|
||||||
|
|
||||||
|
The native app loads from the Vite server, so code changes appear without rebuilding the app. Keep both terminals running and press **Ctrl+C** in the second terminal to stop live reload.
|
||||||
|
|
||||||
### Checks and production build
|
### Checks and production build
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "BeatHound",
|
||||||
|
"integrations": {
|
||||||
|
"capacitor": {}
|
||||||
|
},
|
||||||
|
"type": "react"
|
||||||
|
}
|
||||||
Generated
+14
-14
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "beat-hound",
|
"name": "beat-hound",
|
||||||
"version": "1.0.0",
|
"version": "0.1.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "beat-hound",
|
"name": "beat-hound",
|
||||||
"version": "1.0.0",
|
"version": "0.1.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^8.6.2",
|
"@capacitor/android": "^8.6.3",
|
||||||
"@capacitor/core": "^8.6.2",
|
"@capacitor/core": "8.6.3",
|
||||||
"@capacitor/ios": "^8.6.2",
|
"@capacitor/ios": "^8.6.2",
|
||||||
"@ionic/react": "^8.7.6",
|
"@ionic/react": "^8.7.6",
|
||||||
"ionicons": "^7.4.0",
|
"ionicons": "^7.4.0",
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"react-dom": "^19.1.1"
|
"react-dom": "^19.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@capacitor/cli": "^8.6.2",
|
"@capacitor/cli": "8.6.3",
|
||||||
"@eslint/js": "^9.35.0",
|
"@eslint/js": "^9.35.0",
|
||||||
"@types/react": "^19.1.10",
|
"@types/react": "^19.1.10",
|
||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
@@ -536,18 +536,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/android": {
|
"node_modules/@capacitor/android": {
|
||||||
"version": "8.6.2",
|
"version": "8.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-8.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-8.6.3.tgz",
|
||||||
"integrity": "sha512-dWXnXmOVTtxU91n5h11MzoQ7PAMjyzU1qguw0mBJZiwSuhGvLKTG/IlsQ75H8qeE0a1acV2f573x15wYvyzuVA==",
|
"integrity": "sha512-hTRLGYBUr7UoFSvn+1dnTwgPV7q0FgcTAVA6Y2i0wYzEkq3vR3oSaIs6ERO8WiqeIAupbbL74iG3OwM7BA1bcQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@capacitor/core": "^8.6.0"
|
"@capacitor/core": "^8.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/cli": {
|
"node_modules/@capacitor/cli": {
|
||||||
"version": "8.6.2",
|
"version": "8.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-8.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-8.6.3.tgz",
|
||||||
"integrity": "sha512-3HeNPX3cEWBSljJT0sJviZCxXRoToTLAufhUcIJh+JMj1xOhLFZpuj8oFRnJ0kNYAf7DIBHQDmilIXloK9+YYg==",
|
"integrity": "sha512-HBZ5mb9CNv5TzEW+vjB3aWKi7JIZRb7ExxsVaH/OLd19qXlarWxc2vUXAKtM6Zl2LmTb/rX8hN1q1BvwO7gb7w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -592,9 +592,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/core": {
|
"node_modules/@capacitor/core": {
|
||||||
"version": "8.6.2",
|
"version": "8.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-8.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-8.6.3.tgz",
|
||||||
"integrity": "sha512-UEb9crRuqEAe2Iu2eGOEuQ8rLQxpwg7ZZIpl17UJoytEpnV1e4oXXW0K7yYS2NsCOGmJjyLeKjNlgG7tkAoX8g==",
|
"integrity": "sha512-WJ/DM2OTriEED5sI4jUyJU0NL3QJ/YenS2+SepW/nghMA5ixFJhm8NqGWdqDYYg+eRtJkjD8PcXtIxy4zTP0PA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.1.0"
|
"tslib": "^2.1.0"
|
||||||
|
|||||||
+7
-6
@@ -1,25 +1,26 @@
|
|||||||
{
|
{
|
||||||
"name": "beat-hound",
|
"name": "beat-hound",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0",
|
"version": "0.1.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host 0.0.0.0",
|
"dev": "vite --host 0.0.0.0 --port 5173 --strictPort",
|
||||||
|
"dev:android": "cap run android --live-reload --port 5173",
|
||||||
"build": "tsc --noEmit && vite build",
|
"build": "tsc --noEmit && vite build",
|
||||||
"build:mobile": "tsc --noEmit && vite build --base=./",
|
"build:mobile": "tsc --noEmit && vite build --base=./",
|
||||||
"docs:dev": "vitepress dev docs --host 0.0.0.0",
|
"docs:dev": "vitepress dev docs --host 0.0.0.0",
|
||||||
"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-0.1.3-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",
|
||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^8.6.2",
|
"@capacitor/android": "^8.6.3",
|
||||||
"@capacitor/core": "^8.6.2",
|
"@capacitor/core": "8.6.3",
|
||||||
"@capacitor/ios": "^8.6.2",
|
"@capacitor/ios": "^8.6.2",
|
||||||
"@ionic/react": "^8.7.6",
|
"@ionic/react": "^8.7.6",
|
||||||
"ionicons": "^7.4.0",
|
"ionicons": "^7.4.0",
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
"react-dom": "^19.1.1"
|
"react-dom": "^19.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@capacitor/cli": "^8.6.2",
|
"@capacitor/cli": "8.6.3",
|
||||||
"@eslint/js": "^9.35.0",
|
"@eslint/js": "^9.35.0",
|
||||||
"@types/react": "^19.1.10",
|
"@types/react": "^19.1.10",
|
||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
|
|||||||
const popover = usePopoverDisclosure();
|
const popover = usePopoverDisclosure();
|
||||||
|
|
||||||
function selectView(view: AppView): void {
|
function selectView(view: AppView): void {
|
||||||
popover.close();
|
|
||||||
onNavigate(view);
|
onNavigate(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,9 +35,9 @@ export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
|
|||||||
|
|
||||||
<div className="app-header-actions">
|
<div className="app-header-actions">
|
||||||
<IonButton
|
<IonButton
|
||||||
|
id={popover.triggerId}
|
||||||
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}
|
||||||
@@ -49,11 +48,13 @@ export function AppHeader({ activeView, onNavigate }: AppHeaderProps) {
|
|||||||
|
|
||||||
<IonPopover
|
<IonPopover
|
||||||
className="app-menu-popover"
|
className="app-menu-popover"
|
||||||
isOpen={popover.isOpen}
|
trigger={popover.triggerId}
|
||||||
event={popover.event}
|
reference="trigger"
|
||||||
reference="event"
|
size="auto"
|
||||||
side="bottom"
|
side="bottom"
|
||||||
alignment="end"
|
alignment="end"
|
||||||
|
dismissOnSelect
|
||||||
|
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">
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { useMemo } from 'react';
|
|||||||
import { IonButton, IonIcon } from '@ionic/react';
|
import { IonButton, IonIcon } from '@ionic/react';
|
||||||
import { trash } from 'ionicons/icons';
|
import { trash } from 'ionicons/icons';
|
||||||
import { BeatSelectionHint } from './BeatSelectionHint';
|
import { BeatSelectionHint } from './BeatSelectionHint';
|
||||||
import { SampleLegend } from './CategoryLegend';
|
|
||||||
import { CircularTimeline } from './CircularTimeline';
|
import { CircularTimeline } from './CircularTimeline';
|
||||||
import { PitchControl } from './PitchControl';
|
import { PitchControl } from './PitchControl';
|
||||||
import { SoundRingSelector } from './SoundRingSelector';
|
import { SoundRingSelector } from './SoundRingSelector';
|
||||||
@@ -104,11 +103,6 @@ export function BeatLoopPanel({ sequencer, soundPalette }: BeatLoopPanelProps) {
|
|||||||
onChangePitch={sequencer.changeBeatPitch}
|
onChangePitch={sequencer.changeBeatPitch}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<SampleLegend
|
|
||||||
soundIds={soundIdsInLoop}
|
|
||||||
colorBySoundId={soundPalette.colorBySoundId}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,6 @@ 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);
|
||||||
}
|
}
|
||||||
@@ -25,9 +24,9 @@ export const BeatTemplateSelector = memo(function BeatTemplateSelector({
|
|||||||
return (
|
return (
|
||||||
<div className="beat-template-selector">
|
<div className="beat-template-selector">
|
||||||
<IonButton
|
<IonButton
|
||||||
|
id={popover.triggerId}
|
||||||
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}
|
||||||
@@ -40,12 +39,13 @@ export const BeatTemplateSelector = memo(function BeatTemplateSelector({
|
|||||||
|
|
||||||
<IonPopover
|
<IonPopover
|
||||||
className="beat-template-popover"
|
className="beat-template-popover"
|
||||||
isOpen={popover.isOpen}
|
trigger={popover.triggerId}
|
||||||
event={popover.event}
|
reference="trigger"
|
||||||
reference="event"
|
size="cover"
|
||||||
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">
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ export function CircularTimeline({
|
|||||||
onFocus={() => onSelectBeat(beat.id)}
|
onFocus={() => onSelectBeat(beat.id)}
|
||||||
>
|
>
|
||||||
<circle cx={point.x} cy={point.y} r="19" className="sound-point-hit-area" />
|
<circle cx={point.x} cy={point.y} r="19" className="sound-point-hit-area" />
|
||||||
<circle cx={point.x} cy={point.y} r="10" className="sound-point-face" />
|
<circle cx={point.x} cy={point.y} r="12" className="sound-point-face" />
|
||||||
<text
|
<text
|
||||||
x={point.x}
|
x={point.x}
|
||||||
y={point.y}
|
y={point.y}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function PitchControl({ selectedBeat, onChangePitch }: PitchControlProps)
|
|||||||
return (
|
return (
|
||||||
<div className="pitch-control">
|
<div className="pitch-control">
|
||||||
<div className="pitch-control-heading">
|
<div className="pitch-control-heading">
|
||||||
<span>Pitch</span>
|
<span>Pitch {selectedBeat.letter}</span>
|
||||||
<output aria-live="polite">
|
<output aria-live="polite">
|
||||||
{getPitchLabel(pitchSemitones, instrument.pitchBaseMidi)}
|
{getPitchLabel(pitchSemitones, instrument.pitchBaseMidi)}
|
||||||
</output>
|
</output>
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ export const SoundRingSelector = memo(function SoundRingSelector({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<IonButton
|
<IonButton
|
||||||
|
id={popover.triggerId}
|
||||||
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,13 @@ export const SoundRingSelector = memo(function SoundRingSelector({
|
|||||||
|
|
||||||
<IonPopover
|
<IonPopover
|
||||||
className="sound-ring-popover"
|
className="sound-ring-popover"
|
||||||
isOpen={popover.isOpen}
|
trigger={popover.triggerId}
|
||||||
event={popover.event}
|
reference="trigger"
|
||||||
reference="event"
|
size="cover"
|
||||||
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">
|
||||||
@@ -64,7 +65,6 @@ export const SoundRingSelector = memo(function SoundRingSelector({
|
|||||||
fill={selected ? 'solid' : 'clear'}
|
fill={selected ? 'solid' : 'clear'}
|
||||||
aria-pressed={selected}
|
aria-pressed={selected}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
popover.close();
|
|
||||||
onSelectSound(soundId);
|
onSelectSound(soundId);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<IonButton
|
<IonButton
|
||||||
|
id={popover.triggerId}
|
||||||
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}
|
||||||
@@ -37,11 +37,12 @@ export const TempoControl = memo(function TempoControl({ tempoBpm, onTempoChange
|
|||||||
|
|
||||||
<IonPopover
|
<IonPopover
|
||||||
className="tempo-popover"
|
className="tempo-popover"
|
||||||
isOpen={popover.isOpen}
|
trigger={popover.triggerId}
|
||||||
event={popover.event}
|
reference="trigger"
|
||||||
reference="event"
|
size="cover"
|
||||||
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">
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<IonButton
|
<IonButton
|
||||||
|
id={popover.triggerId}
|
||||||
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,13 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
|
|||||||
|
|
||||||
<IonPopover
|
<IonPopover
|
||||||
className="meter-popover"
|
className="meter-popover"
|
||||||
isOpen={popover.isOpen}
|
trigger={popover.triggerId}
|
||||||
event={popover.event}
|
reference="trigger"
|
||||||
reference="event"
|
size="cover"
|
||||||
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">
|
||||||
@@ -50,7 +51,6 @@ export const TimeSignatureSelector = memo(function TimeSignatureSelector({
|
|||||||
fill={option === beatsPerBar ? 'solid' : 'clear'}
|
fill={option === beatsPerBar ? 'solid' : 'clear'}
|
||||||
aria-pressed={option === beatsPerBar}
|
aria-pressed={option === beatsPerBar}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
popover.close();
|
|
||||||
onChange(option);
|
onChange(option);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,25 +1,17 @@
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useId, useState } from 'react';
|
||||||
|
|
||||||
export interface PopoverDisclosure {
|
export interface PopoverDisclosure {
|
||||||
event: MouseEvent | undefined;
|
triggerId: string;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
open: (event: MouseEvent) => void;
|
onDidPresent: () => void;
|
||||||
close: () => void;
|
|
||||||
onDidDismiss: () => void;
|
onDidDismiss: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function usePopoverDisclosure(): PopoverDisclosure {
|
export function usePopoverDisclosure(): PopoverDisclosure {
|
||||||
|
const triggerId = useId();
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [event, setEvent] = useState<MouseEvent>();
|
const onDidPresent = useCallback(() => setIsOpen(true), []);
|
||||||
|
const onDidDismiss = useCallback(() => setIsOpen(false), []);
|
||||||
|
|
||||||
const open = useCallback((popoverEvent: MouseEvent) => {
|
return { triggerId, isOpen, onDidPresent, onDidDismiss };
|
||||||
setEvent(popoverEvent);
|
|
||||||
setIsOpen(true);
|
|
||||||
}, []);
|
|
||||||
const close = useCallback(() => {
|
|
||||||
setIsOpen(false);
|
|
||||||
setEvent(undefined);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return { event, isOpen, open, close, onDidDismiss: close };
|
|
||||||
}
|
}
|
||||||
+15
-61
@@ -347,6 +347,7 @@ ion-content.app-content-studio {
|
|||||||
--background-activated: #3b3944;
|
--background-activated: #3b3944;
|
||||||
--border-radius: 9px;
|
--border-radius: 9px;
|
||||||
--border-width: 0;
|
--border-width: 0;
|
||||||
|
width: min(230px, calc(100vw - 32px));
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
@@ -372,7 +373,6 @@ ion-content.app-content-studio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.beat-template-popover {
|
.beat-template-popover {
|
||||||
--width: 230px;
|
|
||||||
--background: var(--surface);
|
--background: var(--surface);
|
||||||
--backdrop-opacity: 0;
|
--backdrop-opacity: 0;
|
||||||
--box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
|
--box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
|
||||||
@@ -441,16 +441,6 @@ ion-content.app-content-studio {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro-copy {
|
|
||||||
margin: 7px 0 0;
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.intro-copy.is-hidden {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Preset and instrument selectors */
|
/* Preset and instrument selectors */
|
||||||
.orbit-card {
|
.orbit-card {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -471,6 +461,7 @@ ion-content.app-content-studio {
|
|||||||
--color: var(--muted);
|
--color: var(--muted);
|
||||||
--border-radius: 7px;
|
--border-radius: 7px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
min-width: 160px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: var(--mono);
|
font-family: var(--mono);
|
||||||
font-size: 8px;
|
font-size: 8px;
|
||||||
@@ -506,7 +497,6 @@ ion-content.app-content-studio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sound-ring-popover {
|
.sound-ring-popover {
|
||||||
--width: 160px;
|
|
||||||
--background: var(--surface);
|
--background: var(--surface);
|
||||||
--backdrop-opacity: 0;
|
--backdrop-opacity: 0;
|
||||||
--box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
|
--box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
|
||||||
@@ -585,6 +575,8 @@ ion-content.app-content-studio {
|
|||||||
|
|
||||||
.timeline-orbit-hit-area {
|
.timeline-orbit-hit-area {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
transition: r 720ms cubic-bezier(0.22, 1.15, 0.36, 1);
|
transition: r 720ms cubic-bezier(0.22, 1.15, 0.36, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,7 +597,7 @@ ion-content.app-content-studio {
|
|||||||
|
|
||||||
.timeline-tick text {
|
.timeline-tick text {
|
||||||
fill: var(--muted);
|
fill: var(--muted);
|
||||||
font: 9px var(--mono);
|
font: 14px var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-playhead line {
|
.timeline-playhead line {
|
||||||
@@ -646,7 +638,7 @@ ion-content.app-content-studio {
|
|||||||
|
|
||||||
.sound-point-letter {
|
.sound-point-letter {
|
||||||
fill: var(--base);
|
fill: var(--base);
|
||||||
font: 700 9px var(--mono);
|
font: 700 11px var(--mono);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
text-transform: lowercase;
|
text-transform: lowercase;
|
||||||
}
|
}
|
||||||
@@ -723,8 +715,7 @@ ion-content.app-content-studio {
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hint-swatch,
|
.hint-swatch {
|
||||||
.legend-swatch {
|
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
@@ -743,24 +734,6 @@ ion-content.app-content-studio {
|
|||||||
color: #7671a7;
|
color: #7671a7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sound-legend {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px 14px;
|
|
||||||
padding-top: 17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend-sample {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
color: var(--soft);
|
|
||||||
font-size: 10px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.category-letter-badge {
|
.category-letter-badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
width: 17px;
|
width: 17px;
|
||||||
@@ -774,16 +747,6 @@ ion-content.app-content-studio {
|
|||||||
font: 600 9px var(--mono);
|
font: 600 9px var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
.legend-swatch {
|
|
||||||
width: 7px;
|
|
||||||
height: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend-empty {
|
|
||||||
color: var(--soft);
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.audio-error {
|
.audio-error {
|
||||||
margin: 13px auto 0;
|
margin: 13px auto 0;
|
||||||
color: #ffad8b;
|
color: #ffad8b;
|
||||||
@@ -1032,7 +995,7 @@ ion-content.instrument-picker-content {
|
|||||||
--bar-background-active: var(--accent);
|
--bar-background-active: var(--accent);
|
||||||
--bar-height: 3px;
|
--bar-height: 3px;
|
||||||
--height: 28px;
|
--height: 28px;
|
||||||
--knob-background: var(--accent);
|
--knob-background: #fff;
|
||||||
--knob-size: 12px;
|
--knob-size: 12px;
|
||||||
--padding-top: 2px;
|
--padding-top: 2px;
|
||||||
--padding-bottom: 2px;
|
--padding-bottom: 2px;
|
||||||
@@ -1109,7 +1072,6 @@ ion-content.instrument-picker-content {
|
|||||||
|
|
||||||
/* Popover contents */
|
/* Popover contents */
|
||||||
.tempo-popover {
|
.tempo-popover {
|
||||||
--width: var(--tempo-control-width);
|
|
||||||
--height: 226px;
|
--height: 226px;
|
||||||
--background: var(--surface);
|
--background: var(--surface);
|
||||||
--backdrop-opacity: 0;
|
--backdrop-opacity: 0;
|
||||||
@@ -1197,13 +1159,16 @@ ion-content.instrument-picker-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.meter-popover {
|
.meter-popover {
|
||||||
--width: 96px;
|
--height: 250px;
|
||||||
--height: 224px;
|
|
||||||
--background: var(--surface);
|
--background: var(--surface);
|
||||||
--backdrop-opacity: 0;
|
--backdrop-opacity: 0;
|
||||||
--box-shadow: 0 10px 28px rgba(var(--primary-rgb), 0.2);
|
--box-shadow: 0 10px 28px rgba(var(--primary-rgb), 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.meter-popover::part(content) {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.meter-popover-content {
|
.meter-popover-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -1222,6 +1187,7 @@ ion-content.instrument-picker-content {
|
|||||||
--border-radius: 7px;
|
--border-radius: 7px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 31px;
|
height: 31px;
|
||||||
|
min-height: 31px;
|
||||||
flex: 0 0 31px;
|
flex: 0 0 31px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
@@ -1243,7 +1209,7 @@ ion-content.instrument-picker-content {
|
|||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
/* Compact layout */
|
/* Compact layout */
|
||||||
.app-shell {
|
.app-shell {
|
||||||
padding: 0 14px 26px;
|
padding: max(1.5rem, env(safe-area-inset-top, 0px)) 14px 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-header {
|
.app-header {
|
||||||
@@ -1320,10 +1286,6 @@ ion-content.instrument-picker-content {
|
|||||||
margin-top: 13px;
|
margin-top: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro-copy {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orbit-card {
|
.orbit-card {
|
||||||
padding: 17px 11px 14px;
|
padding: 17px 11px 14px;
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
@@ -1393,10 +1355,6 @@ ion-content.instrument-picker-content {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.intro-copy {
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orbit-card {
|
.orbit-card {
|
||||||
padding: 12px 10px 9px;
|
padding: 12px 10px 9px;
|
||||||
}
|
}
|
||||||
@@ -1405,10 +1363,6 @@ ion-content.instrument-picker-content {
|
|||||||
width: min(100%, max(180px, calc(100dvh - 390px)));
|
width: min(100%, max(180px, calc(100dvh - 390px)));
|
||||||
}
|
}
|
||||||
|
|
||||||
.sound-legend {
|
|
||||||
gap: 6px 10px;
|
|
||||||
padding-top: 8px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 360px) {
|
@media (max-width: 360px) {
|
||||||
|
|||||||
@@ -13,12 +13,6 @@ export function StudioView({ studio }: StudioViewProps) {
|
|||||||
<h1>Sharpen your sense of rhythm</h1>
|
<h1>Sharpen your sense of rhythm</h1>
|
||||||
<p className="template-prompt">Choose a dance template</p>
|
<p className="template-prompt">Choose a dance template</p>
|
||||||
<BeatTemplateSelector onSelectTemplate={studio.applyTemplate} />
|
<BeatTemplateSelector onSelectTemplate={studio.applyTemplate} />
|
||||||
<p
|
|
||||||
className={`intro-copy${studio.sequencer.beats.length > 0 ? ' is-hidden' : ''}`}
|
|
||||||
aria-hidden={studio.sequencer.beats.length > 0}
|
|
||||||
>
|
|
||||||
Add a sound, then move it around the loop.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<BeatLoopPanel
|
<BeatLoopPanel
|
||||||
|
|||||||
Reference in new issue
Block a user