Initialize repo

This commit is contained in:
Kazimierz Ciołek
2026-02-02 13:44:55 +01:00
commit 704edb6ae0
149 changed files with 12373 additions and 0 deletions

46
components/ui/fade-in.tsx Normal file
View File

@@ -0,0 +1,46 @@
"use client";
import { motion, useInView } from "framer-motion";
import { useRef } from "react";
interface FadeInProps {
children: React.ReactNode;
className?: string;
delay?: number;
direction?: "up" | "down" | "left" | "right";
}
export function FadeIn({ children, className = "", delay = 0, direction = "up" }: FadeInProps) {
const ref = useRef(null);
const isInView = useInView(ref, { once: true, margin: "-100px" });
const directionOffset = {
up: { y: 40, x: 0 },
down: { y: -40, x: 0 },
left: { x: 40, y: 0 },
right: { x: -40, y: 0 },
};
return (
<motion.div
ref={ref}
initial={{
opacity: 0,
...directionOffset[direction]
}}
animate={isInView ? {
opacity: 1,
x: 0,
y: 0
} : {}}
transition={{
duration: 0.8,
delay: delay,
ease: [0.21, 0.47, 0.32, 0.98]
}}
className={className}
>
{children}
</motion.div>
);
}