'use client'; import { forwardRef, HTMLAttributes } from 'react'; import styles from './noise-pattern.module.css'; export interface NoisePatternProps extends HTMLAttributes { /** Noise opacity */ opacity?: number; /** Noise frequency */ frequency?: number; /** Noise type */ type?: 'fractal' | 'turbulence' | 'uniform' | 'grain'; /** Animation speed (0 = static) */ speed?: number; /** Color */ color?: string; /** Blend mode */ blendMode?: string; } export const NoisePattern = forwardRef( ( { opacity = 0.1, frequency = 0.8, type = 'fractal', speed = 0, color = '#000', blendMode = 'overlay', className, ...props }, ref ) => { const svgId = `noise-${type}-${Math.random().toString(36).substr(2, 9)}`; return (
0 ? styles.animated : ''} ${className || ''}`} style={ { '--noise-opacity': opacity, '--noise-frequency': frequency, '--noise-color': color, '--animation-speed': `${speed}s`, mixBlendMode: blendMode, } as React.CSSProperties } {...props} > {type === 'fractal' && ( )} {type === 'turbulence' && ( )} {type === 'uniform' && ( )} {type === 'grain' && ( )}
); } ); NoisePattern.displayName = 'NoisePattern'; export default NoisePattern;