mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Incorporating the parent PR. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
38 lines
946 B
TypeScript
38 lines
946 B
TypeScript
import type { Variants } from 'framer-motion'
|
|
|
|
const CARD_VARIANTS: Variants = {
|
|
hidden: { opacity: 0, y: 8 },
|
|
visible: { opacity: 1, y: 0, transition: { duration: 0.3, ease: 'easeOut' } },
|
|
}
|
|
|
|
const STAGGER_AFTER_CONTAINER = 0.2
|
|
const STAGGER_BETWEEN_CARDS = 0.08
|
|
|
|
export interface PlanCardsEntryAnimation {
|
|
container: { variants?: Variants; initial?: string; animate?: string }
|
|
card: Variants | undefined
|
|
}
|
|
|
|
export function getPlanCardsEntryAnimation(
|
|
entryDelay: number | undefined
|
|
): PlanCardsEntryAnimation {
|
|
if (entryDelay === undefined) return { container: {}, card: undefined }
|
|
|
|
return {
|
|
container: {
|
|
variants: {
|
|
hidden: {},
|
|
visible: {
|
|
transition: {
|
|
delayChildren: entryDelay + STAGGER_AFTER_CONTAINER,
|
|
staggerChildren: STAGGER_BETWEEN_CARDS,
|
|
},
|
|
},
|
|
},
|
|
initial: 'hidden',
|
|
animate: 'visible',
|
|
},
|
|
card: CARD_VARIANTS,
|
|
}
|
|
}
|