import React, { useEffect } from 'react'; import { StyleSheet, TextStyle } from 'react-native'; import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withSequence, withTiming, interpolate, } from 'react-native-reanimated'; import { COLORS } from '../constants/colors'; interface GlowTextProps { text: string; style?: TextStyle; glowColor?: string; fontSize?: number; } export const GlowText: React.FC = ({ text, style, glowColor = COLORS.primary, fontSize = 48, }) => { const pulse = useSharedValue(0); useEffect(() => { pulse.value = withRepeat( withSequence( withTiming(1, { duration: 3000 }), withTiming(0, { duration: 3000 }) ), -1, true ); }, []); const animStyle = useAnimatedStyle(() => { return { textShadowRadius: interpolate(pulse.value, [0, 1], [8, 20]), opacity: interpolate(pulse.value, [0, 1], [0.95, 1]), }; }); return ( {text} ); }; const styles = StyleSheet.create({ text: { color: COLORS.primary, fontWeight: '900', letterSpacing: 8, textAlign: 'center', }, });