first commit

This commit is contained in:
mstfyldz
2026-06-03 16:13:15 +03:00
parent a3b76fa65d
commit 716bad9d7c
40 changed files with 2698 additions and 135 deletions
+49
View File
@@ -0,0 +1,49 @@
"use client";
import { motion, useInView } from "framer-motion";
import { useRef } from "react";
import { cn } from "@/lib/utils";
interface TextRevealProps {
text: string;
className?: string;
delay?: number;
once?: boolean;
stagger?: number;
}
export function TextReveal({
text,
className,
delay = 0,
once = true,
stagger = 0.055,
}: TextRevealProps) {
const ref = useRef<HTMLSpanElement>(null);
const isInView = useInView(ref, { once, margin: "-60px" });
const words = text.split(" ");
return (
<span ref={ref} className={cn("inline", className)}>
{words.map((word, i) => (
<motion.span
key={i}
className="inline-block mr-[0.28em] last:mr-0"
initial={{ opacity: 0, y: 22, filter: "blur(4px)" }}
animate={
isInView
? { opacity: 1, y: 0, filter: "blur(0px)" }
: { opacity: 0, y: 22, filter: "blur(4px)" }
}
transition={{
duration: 0.55,
delay: delay + i * stagger,
ease: [0.16, 1, 0.3, 1],
}}
>
{word}
</motion.span>
))}
</span>
);
}