import { type MotionProps } from "framer-motion"; import { useTheme } from "styled-components"; import { TRANSITIONS_IN_SECONDS } from "@/utils/constants"; const usePeekTransition = (showControls = false): MotionProps => { const { sizes: { taskbar }, } = useTheme(); let peekContainerHeight = taskbar.entry.peekImage.height + taskbar.entry.peekImage.margin * 2; if (showControls) peekContainerHeight += taskbar.entry.peekControlsHeight; return { animate: "active", exit: "initial", initial: "initial", transition: { duration: TRANSITIONS_IN_SECONDS.WINDOW / 3, // Reduced duration ease: [0.42, 0, 0.58, 1], // Custom cubic-bezier for quicker start and smooth end }, variants: { active: { height: peekContainerHeight, opacity: 1, }, initial: { height: 0, opacity: 0, }, }, }; }; export default usePeekTransition;