|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import { useState, useEffect } from 'react'; |
| 4 | +import Image from 'next/image'; |
| 5 | + |
| 6 | +interface WelcomeScreenProps { |
| 7 | + onStart: () => void; |
| 8 | +} |
| 9 | + |
| 10 | +export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({ onStart }) => { |
| 11 | + const [isVisible, setIsVisible] = useState(true); |
| 12 | + const [isFadingOut, setIsFadingOut] = useState(false); |
| 13 | + |
| 14 | + const handleStart = () => { |
| 15 | + setIsFadingOut(true); |
| 16 | + setTimeout(() => { |
| 17 | + setIsVisible(false); |
| 18 | + onStart(); |
| 19 | + }, 800); |
| 20 | + }; |
| 21 | + |
| 22 | + if (!isVisible) return null; |
| 23 | + |
| 24 | + return ( |
| 25 | + <div |
| 26 | + className={` |
| 27 | + fixed inset-0 z-[9999] |
| 28 | + bg-gradient-to-br from-neutral-900 via-brand-900 to-neutral-900 |
| 29 | + transition-opacity duration-800 ease-in-out |
| 30 | + ${isFadingOut ? 'opacity-0' : 'opacity-100'} |
| 31 | + `} |
| 32 | + > |
| 33 | + {/* Animated background elements */} |
| 34 | + <div className='absolute inset-0 opacity-20 bg-gradient-to-r from-brand-500/10 via-transparent to-accent-500/10'></div> |
| 35 | + |
| 36 | + {/* Floating particles */} |
| 37 | + <div className='absolute inset-0 overflow-hidden pointer-events-none'> |
| 38 | + {[...Array(30)].map((_, i) => ( |
| 39 | + <div |
| 40 | + key={i} |
| 41 | + className='absolute w-1 h-1 bg-white rounded-full animate-twinkle' |
| 42 | + style={{ |
| 43 | + left: `${Math.random() * 100}%`, |
| 44 | + top: `${Math.random() * 100}%`, |
| 45 | + animationDelay: `${Math.random() * 3}s`, |
| 46 | + animationDuration: `${2 + Math.random() * 3}s`, |
| 47 | + }} |
| 48 | + /> |
| 49 | + ))} |
| 50 | + </div> |
| 51 | + |
| 52 | + {/* Main content */} |
| 53 | + <div className='relative z-10 h-full flex flex-col items-center justify-center text-center px-4'> |
| 54 | + {/* Logo */} |
| 55 | + <div className='mb-8 animate-fadeInUp' style={{ animationDelay: '0.2s' }}> |
| 56 | + <Image |
| 57 | + src='/images/logo/logoicon.png' |
| 58 | + alt='STELLAR NEXUS' |
| 59 | + width={200} |
| 60 | + height={200} |
| 61 | + priority |
| 62 | + className='w-48 h-48 md:w-64 md:h-64 drop-shadow-2xl' |
| 63 | + /> |
| 64 | + </div> |
| 65 | + |
| 66 | + {/* Main Title */} |
| 67 | + <h1 |
| 68 | + className={` |
| 69 | + text-4xl md:text-6xl lg:text-7xl font-bold |
| 70 | + text-transparent bg-clip-text |
| 71 | + bg-gradient-to-r from-brand-400 via-accent-400 to-brand-400 |
| 72 | + mb-6 |
| 73 | + animate-fadeInUp |
| 74 | + drop-shadow-[0_0_30px_rgba(14,165,233,0.5)] |
| 75 | + `} |
| 76 | + style={{ animationDelay: '0.4s' }} |
| 77 | + > |
| 78 | + NEXUS STELLAR |
| 79 | + </h1> |
| 80 | + |
| 81 | + {/* Subtitle */} |
| 82 | + <p |
| 83 | + className={` |
| 84 | + text-xl md:text-2xl lg:text-3xl |
| 85 | + text-white/90 |
| 86 | + mb-12 |
| 87 | + animate-fadeInUp |
| 88 | + drop-shadow-[0_2px_10px_rgba(0,0,0,0.8)] |
| 89 | + `} |
| 90 | + style={{ animationDelay: '0.6s' }} |
| 91 | + > |
| 92 | + Welcome to the future of Web3 |
| 93 | + </p> |
| 94 | + |
| 95 | + {/* Start Button */} |
| 96 | + <div |
| 97 | + className='animate-fadeInUp' |
| 98 | + style={{ animationDelay: '0.8s' }} |
| 99 | + > |
| 100 | + <button |
| 101 | + onClick={handleStart} |
| 102 | + className={` |
| 103 | + relative px-12 py-6 font-bold rounded-xl |
| 104 | + transition-all duration-500 transform |
| 105 | + shadow-2xl border-2 text-2xl |
| 106 | + hover:scale-110 hover:rotate-1 |
| 107 | + bg-gradient-to-r from-brand-500 via-accent-500 to-brand-600 |
| 108 | + hover:from-brand-600 hover:via-accent-600 hover:to-brand-700 |
| 109 | + text-white border-white/30 hover:border-white/60 |
| 110 | + hover:shadow-brand-500/50 |
| 111 | + `} |
| 112 | + > |
| 113 | + {/* Button Content */} |
| 114 | + <div className='flex items-center space-x-4'> |
| 115 | + <span className='text-2xl font-bold'>START</span> |
| 116 | + <span className='text-xl'>🚀</span> |
| 117 | + </div> |
| 118 | + |
| 119 | + {/* Hover Effects */} |
| 120 | + <div className='absolute inset-0 bg-gradient-to-r from-white/0 via-white/10 to-white/0 rounded-xl opacity-0 hover:opacity-100 transition-opacity duration-300'></div> |
| 121 | + |
| 122 | + {/* Floating particles around button */} |
| 123 | + <div className='absolute inset-0 overflow-hidden rounded-xl pointer-events-none'> |
| 124 | + <div className='absolute top-2 left-1/4 w-1 h-1 bg-brand-400 rounded-full animate-ping opacity-70'></div> |
| 125 | + <div |
| 126 | + className='absolute top-4 right-1/3 w-1 h-1 bg-accent-400 rounded-full animate-ping opacity-80' |
| 127 | + style={{ animationDelay: '0.5s' }} |
| 128 | + ></div> |
| 129 | + <div |
| 130 | + className='absolute bottom-2 left-1/3 w-1 h-1 bg-brand-300 rounded-full animate-ping opacity-60' |
| 131 | + style={{ animationDelay: '1s' }} |
| 132 | + ></div> |
| 133 | + <div |
| 134 | + className='absolute bottom-4 right-1/4 w-1 h-1 bg-accent-300 rounded-full animate-ping opacity-90' |
| 135 | + style={{ animationDelay: '1.5s' }} |
| 136 | + ></div> |
| 137 | + </div> |
| 138 | + </button> |
| 139 | + </div> |
| 140 | + |
| 141 | + {/* Glowing Ring Animation */} |
| 142 | + <div className='absolute inset-0 flex items-center justify-center pointer-events-none'> |
| 143 | + <div className='relative w-80 h-80 md:w-96 md:h-96'> |
| 144 | + <div className='absolute inset-0 rounded-full border-2 border-brand-400/30 animate-ping' /> |
| 145 | + <div |
| 146 | + className='absolute inset-4 rounded-full border-2 border-accent-400/30 animate-ping' |
| 147 | + style={{ animationDelay: '0.5s' }} |
| 148 | + /> |
| 149 | + <div |
| 150 | + className='absolute inset-8 rounded-full border-2 border-brand-300/30 animate-ping' |
| 151 | + style={{ animationDelay: '1s' }} |
| 152 | + /> |
| 153 | + </div> |
| 154 | + </div> |
| 155 | + </div> |
| 156 | + |
| 157 | + {/* Vignette Effect */} |
| 158 | + <div className='absolute inset-0 pointer-events-none bg-[radial-gradient(circle_at_center,_transparent_0%,_rgba(0,0,0,0.4)_100%)]' /> |
| 159 | + </div> |
| 160 | + ); |
| 161 | +}; |
0 commit comments