'use client'; import { forwardRef, HTMLAttributes } from 'react'; import { cn } from '@/shared/lib/utils'; export interface AncientScrollProps extends HTMLAttributes { /** The text to display on the scroll */ children: string; /** Level of paper decay: pristine, aged, weathered, crumbling */ decay?: 'pristine' | 'aged' | 'weathered' | 'crumbling'; /** Ink color style: black, brown, red, gold */ inkColor?: 'black' | 'brown' | 'red' | 'gold'; /** Enable flowing ink animation */ flowingInk?: boolean; /** Show aged paper texture */ showTexture?: boolean; } export const AncientScroll = forwardRef( ( { children, decay = 'aged', inkColor = 'brown', flowingInk = true, showTexture = true, className, style, ...props }, ref ) => { const decayClasses = { pristine: 'from-amber-50 via-amber-100 to-amber-50', aged: 'from-amber-100 via-amber-200 to-amber-100', weathered: 'from-amber-200 via-amber-300 to-amber-200 contrast-125 brightness-95', crumbling: 'from-amber-300 via-amber-400 to-amber-300 contrast-125 brightness-85', }; const inkColorClasses = { black: 'text-stone-800', brown: 'text-amber-900', red: 'text-red-900', gold: 'text-yellow-700', }; return (
{children.split('\n').map((paragraph, index) => (

{paragraph.split('').map((char, charIndex) => ( {char} ))}

))}
); } ); AncientScroll.displayName = 'AncientScroll'; export default AncientScroll;