migrated to vue wtf

This commit is contained in:
Daniel Ledda
2023-02-26 22:14:43 +01:00
parent b16e20a86a
commit 766faf5f56
54 changed files with 3135 additions and 3538 deletions

View File

@@ -0,0 +1,36 @@
import type { TrackUnitStickingType, TrackUnitType } from "@/Track";
import type { IconName } from "@/ui/Widgets/Icon/icons";
export const TypeClasses = [ "Ghost", "Accent" ] as const;
export const StickingTypeIconMap = {
none: null,
lf: 'lf',
lh: 'lh',
rf: 'rf',
rh: 'rh',
} as const satisfies Readonly<Record<TrackUnitStickingType, IconName | null>>;
export const TrackUnitTypeClassMap = {
"Normal": [],
"GhostNote": ["Ghost"],
"Accent": ["Accent"],
"GhostNoteAccent": ["Ghost", "Accent"],
} as const satisfies Readonly<Record<TrackUnitType, Readonly<string[]>>>;
export function getClasses(options: { on: boolean, stickingType: TrackUnitStickingType, type: TrackUnitType, highlightable?: boolean }) {
const classes = ["track-unit"];
if (options.on) {
classes.push("on");
}
if (StickingTypeIconMap[options.stickingType]) {
classes.push("icon-visible");
}
if (options.type) {
classes.push(...TrackUnitTypeClassMap[options.type]);
}
if (options.highlightable) {
classes.push("highlightable");
}
return classes;
}