"use client"; import type { MotionValue } from "motion/react"; import { motion, useScroll, useTransform } from "motion/react"; import type { ComponentPropsWithoutRef, FC, ReactNode } from "react"; import React from "react"; import { useRef } from "react"; import { cn } from "@/lib/utils"; const REVEAL_TEXT = "تمام تعاملات، سرنخ‌ها و قراردادها در یک فضای کاری متمرکز جمع می‌شود. تیم فروش بدون جابجایی بین ابزارها، سریع‌تر پیش‌بینی می‌کند و معاملات بیشتری می‌بندد."; const Feature248 = () => { return (
{REVEAL_TEXT}
); }; export { Feature248 }; // Below is the modified component from Magic UI // Original source: https://magicui.design/docs/components/text-reveal // Modified to follow our coding standards and design system // We respect copyright and attribution to the original creators interface TextRevealProps extends ComponentPropsWithoutRef<"div"> { children: string; title?: string; maxWidth?: string; } const TextReveal: FC = ({ children, title, className, maxWidth, }) => { const targetRef = useRef(null); const { scrollYProgress } = useScroll({ target: targetRef, }); const words = children.split(" "); return (
{title ? ( {title} ) : null} {words.map((word, i) => { const start = i / words.length; const end = start + 1 / words.length; return ( {word} ); })}
); }; interface WordProps { children: ReactNode; progress: MotionValue; range: [number, number]; } const Word: FC = ({ children, progress, range }) => { const opacity = useTransform(progress, range, [0, 1]); return ( {children} {children} ); };