This commit is contained in:
2026-05-03 18:38:18 +02:00
parent 1446db75d9
commit c61b1b19bb
3 changed files with 13 additions and 11 deletions
+6 -7
View File
@@ -5,6 +5,10 @@ import { type HTMLMotionProps, motion } from "motion/react";
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
import { cn } from "@/lib/utils";
import { CardDepthProvider, useCardDepth } from "./card-context";
import {
defaultTransitionCard,
defaultVariantsCard,
} from "./styles/animations";
const cardVariants = cva(
`flex flex-col gap-2 ring-2 rounded-card
@@ -69,13 +73,8 @@ export const AnimatedCard: React.FC<
> = (props) => {
return (
<MCard
variants={{ enter: { scale: 1 }, from: { scale: 0 } }}
transition={{
type: "spring",
stiffness: 200,
damping: 15,
mass: 2,
}}
variants={defaultVariantsCard}
transition={defaultTransitionCard}
{...props}
/>
);
+6 -3
View File
@@ -1,4 +1,4 @@
import type { Transition, Variants } from "motion";
import { stagger, type Transition, type Variants } from "motion";
export const defaultTransitionCard: Transition = {
type: "spring",
@@ -7,13 +7,16 @@ export const defaultTransitionCard: Transition = {
mass: 1,
};
export const defaultAnimationStagger = {
export const defaultAnimationStagger: {
variants: Variants;
transition: Transition;
} = {
variants: {
enter: {},
from: {},
},
transition: {
staggerChildren: 0.1,
delayChildren: stagger(0.1),
},
};