use real sounds from kbsim

This commit is contained in:
2026-06-08 23:34:32 -07:00
parent 43e9d77de9
commit b5345f0345
168 changed files with 815 additions and 181 deletions
+7 -4
View File
@@ -10,7 +10,7 @@ export const app = $state({
fps: 30,
pixelsPerSecond: ZOOM_DEFAULT,
scrollLeft: 0,
activeSwitch: 'cherry-mx-blue' as SwitchType,
activeSwitch: 'mxbrown' as SwitchType,
videoUrl: null as string | null,
videoName: null as string | null,
timelineWidth: 800,
@@ -68,13 +68,16 @@ export function setTimelineWidth(value: number) {
app.timelineWidth = value;
}
export function addMarker(time: number, key: string): Marker {
const marker: Marker = { id: createMarkerId(), time, key };
export function addMarker(time: number, key: string, code?: string): Marker {
const marker: Marker = { id: createMarkerId(), time, key, code };
app.markers = [...app.markers, marker].sort((a, b) => a.time - b.time);
return marker;
}
export function updateMarker(id: string, patch: Partial<Pick<Marker, 'time' | 'key'>>) {
export function updateMarker(
id: string,
patch: Partial<Pick<Marker, 'time' | 'key' | 'code' | 'releaseTime'>>,
) {
app.markers = app.markers
.map((m) => (m.id === id ? { ...m, ...patch } : m))
.sort((a, b) => a.time - b.time);