import { ReactNode, useState, useRef } from "react"; import { View, ViewStyle, Pressable, Animated, StyleSheet } from "react-native"; interface CyberpunkButtonOutlineProps { children: ReactNode; onPress?: () => void; style?: ViewStyle; accentColor?: string; index?: number; } export function CyberpunkButtonOutline({ children, onPress, style, accentColor = "#00ffff", }: CyberpunkButtonOutlineProps) { const [isPressed, setIsPressed] = useState(false); const animatedScale = useRef(new Animated.Value(1)).current; const animatedOpacity = useRef(new Animated.Value(1)).current; const handlePressIn = () => { setIsPressed(true); Animated.parallel([ Animated.spring(animatedScale, { toValue: 0.98, useNativeDriver: true, tension: 100, friction: 10, }), Animated.timing(animatedOpacity, { toValue: 1.2, duration: 100, useNativeDriver: true, }), ]).start(); }; const handlePressOut = () => { setIsPressed(false); Animated.parallel([ Animated.spring(animatedScale, { toValue: 1, useNativeDriver: true, tension: 100, friction: 10, }), Animated.timing(animatedOpacity, { toValue: 1, duration: 100, useNativeDriver: true, }), ]).start(); }; const cornerCutSize = 15; const borderWidth = isPressed ? 3 : 2.5; return ( {/* Main border frame */} {/* Cut corners overlay */} {/* Top left corner cut */} {/* Top right corner cut */} {/* Bottom left corner cut */} {/* Bottom right corner cut */} {/* Inner border for double-line effect */} {/* Corner accent lines */} {/* Top left */} {/* Top right */} {/* Bottom left */} {/* Bottom right */} {/* Content container */} {children} ); } const styles = StyleSheet.create({ mainFrame: { position: "absolute", top: 0, left: 10, right: 10, bottom: 0, borderRadius: 2, }, innerFrame: { position: "absolute", borderRadius: 2, }, cornerCut: { position: "absolute", }, accentLine: { position: "absolute", }, });