'use client';
import { forwardRef, HTMLAttributes } from 'react';
import styles from './giant-layers.module.css';
export interface GiantLayersProps extends HTMLAttributes {
/** Text to display */
children: string;
/** Number of shadow layers (1-3) */
layers?: 1 | 2 | 3;
/** Size preset */
size?: 'sm' | 'md' | 'lg' | 'xl';
/** Visual variant */
variant?: 'blood' | 'cyber' | 'mono' | 'neon';
/** Shadow offset direction */
direction?: 'diagonal' | 'horizontal' | 'vertical';
/** Animate layers */
animated?: boolean;
/** Expand on hover */
hover?: boolean;
/** Custom layer colors */
layerColors?: [string, string?, string?];
}
export const GiantLayers = forwardRef(
(
{
children,
layers = 3,
size = 'lg',
variant = 'blood',
direction = 'diagonal',
animated = false,
hover = false,
layerColors,
className,
style,
...props
},
ref
) => {
const containerClasses = [
styles.container,
styles[size],
styles[variant],
styles[direction],
animated && styles.animated,
hover && styles.hover,
className
].filter(Boolean).join(' ');
const getLayerStyle = (index: number) => {
if (layerColors && layerColors[index]) {
return {
background: `linear-gradient(180deg, ${layerColors[index]} 0%, transparent 100%)`,
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
backgroundClip: 'text',
};
}
return undefined;
};
return (
{/* Shadow layers */}
{layers >= 3 && (
{children}
)}
{layers >= 2 && (
{children}
)}
{layers >= 1 && (
{children}
)}
{/* Base layer */}
{children}
);
}
);
GiantLayers.displayName = 'GiantLayers';
export default GiantLayers;