5eb46b02d8
Delete 3 orphaned files (SubNav, TopBar, problems.ts), remove 4 unused type definitions from pmr.ts (ViewId, NavItem, ReferralFormData, Problem), trim types/index.ts to only Phase, and remove unused utility functions (calculateSkillOffset, formatBootLine, getProfileContent, DotColorName).
19 lines
689 B
TypeScript
19 lines
689 B
TypeScript
export function hexToRgba(hex: string, opacity: number): string {
|
|
const r = parseInt(hex.slice(1, 3), 16)
|
|
const g = parseInt(hex.slice(3, 5), 16)
|
|
const b = parseInt(hex.slice(5, 7), 16)
|
|
return `rgba(${r},${g},${b},${opacity})`
|
|
}
|
|
|
|
export const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
|
|
/** Returns a framer-motion transition that respects prefers-reduced-motion */
|
|
export function motionSafeTransition(
|
|
duration: number,
|
|
ease: string = 'easeOut',
|
|
delay: number = 0
|
|
): { duration: number; ease?: string; delay?: number } {
|
|
if (prefersReducedMotion) return { duration: 0 }
|
|
return { duration, ease, ...(delay ? { delay } : {}) }
|
|
}
|