Files
aragrp/lib/block-motion.ts
T

40 lines
931 B
TypeScript
Raw Normal View History

import type { Transition, Variants } from "motion/react";
/** Standard scroll-reveal ease (ui-ux-pro-max: power2.out-equivalent). */
export const blockEase = [0.22, 1, 0.36, 1] as const;
/** ~400–500ms section entrance — transform + opacity only. */
export const blockRevealTransition: Transition = {
duration: 0.5,
ease: blockEase,
};
/**
* Trigger when the block approaches ~85% from the top of the viewport.
* `once` keeps motion purposeful and avoids reverse jitter on scroll-up.
*/
export const blockViewport = {
once: true,
amount: 0.2,
margin: "0px 0px -10% 0px",
} as const;
export const blockRevealContainer: Variants = {
hidden: {},
visible: {
transition: {
staggerChildren: 0.08,
delayChildren: 0.04,
},
},
};
export const blockRevealItem: Variants = {
hidden: { opacity: 0, y: 24 },
visible: {
opacity: 1,
y: 0,
transition: blockRevealTransition,
},
};