- Add i18n configuration to astro.config.mjs with default locale and routing - Refactor language handling to use Astro.currentLocale instead of URL parsing - Update tsconfig to include only necessary files for better type checking - Improve LanguageSwitcher to handle routing based on astro i18n config - Add new translation keys and update components to use dynamic titles - Simplify MotionWrapper component by removing unused default animations
39 lines
808 B
TypeScript
39 lines
808 B
TypeScript
import React from "react";
|
|
import { motion } from "framer-motion";
|
|
import type { MotionProps } from "framer-motion";
|
|
|
|
interface MotionWrapperProps extends Omit<MotionProps, 'custom'> {
|
|
children: React.ReactNode;
|
|
delay?: number;
|
|
}
|
|
|
|
export default function MotionWrapper({
|
|
children,
|
|
delay = 0,
|
|
...props
|
|
}: MotionWrapperProps) {
|
|
return (
|
|
<motion.div
|
|
initial="hidden"
|
|
whileInView="visible"
|
|
viewport={{ once: true, margin: "-100px" }}
|
|
variants={{
|
|
hidden: { opacity: 0, y: 20 },
|
|
visible: {
|
|
opacity: 1,
|
|
y: 0,
|
|
transition: {
|
|
duration: 0.6,
|
|
delay,
|
|
ease: [0.43, 0.13, 0.23, 0.96]
|
|
}
|
|
}
|
|
}}
|
|
custom={delay}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|