Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | 'use client' // Use modular game provider for multiplayer support import { useComplementRace } from '@/arcade-games/complement-race/Provider' import { GameControls } from './GameControls' import { GameCountdown } from './GameCountdown' import { GameDisplay } from './GameDisplay' import { GameIntro } from './GameIntro' import { GameResults } from './GameResults' export function ComplementRaceGame() { const { state } = useComplementRace() return ( <div data-component="game-page-root" style={{ flex: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden', padding: '20px 8px', minHeight: '100vh', maxHeight: '100vh', background: state.style === 'sprint' ? 'linear-gradient(to bottom, #2563eb 0%, #60a5fa 100%)' : 'radial-gradient(ellipse at center, #8db978 0%, #7ba565 40%, #6a9354 100%)', position: 'relative', }} > {/* Background pattern - subtle grass texture */} {state.style !== 'sprint' && ( <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none', zIndex: 0, opacity: 0.15, }} > <svg width="100%" height="100%"> <defs> <pattern id="grass-texture" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse" > <rect width="40" height="40" fill="transparent" /> <line x1="2" y1="5" x2="8" y2="5" stroke="#2d5016" strokeWidth="1" opacity="0.3" /> <line x1="15" y1="8" x2="20" y2="8" stroke="#2d5016" strokeWidth="1" opacity="0.25" /> <line x1="25" y1="12" x2="32" y2="12" stroke="#2d5016" strokeWidth="1" opacity="0.2" /> <line x1="5" y1="18" x2="12" y2="18" stroke="#2d5016" strokeWidth="1" opacity="0.3" /> <line x1="28" y1="22" x2="35" y2="22" stroke="#2d5016" strokeWidth="1" opacity="0.25" /> <line x1="10" y1="30" x2="16" y2="30" stroke="#2d5016" strokeWidth="1" opacity="0.2" /> <line x1="22" y1="35" x2="28" y2="35" stroke="#2d5016" strokeWidth="1" opacity="0.3" /> </pattern> </defs> <rect width="100%" height="100%" fill="url(#grass-texture)" /> </svg> </div> )} {/* Subtle tree clusters around edges - top-down view with gentle sway */} {state.style !== 'sprint' && ( <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none', zIndex: 0, }} > {/* Top-left tree cluster */} <div style={{ position: 'absolute', top: '5%', left: '3%', width: '80px', height: '80px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.2, filter: 'blur(4px)', animation: 'treeSway1 8s ease-in-out infinite', }} /> {/* Top-right tree cluster */} <div style={{ position: 'absolute', top: '8%', right: '5%', width: '100px', height: '100px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.18, filter: 'blur(5px)', animation: 'treeSway2 10s ease-in-out infinite', }} /> {/* Bottom-left tree cluster */} <div style={{ position: 'absolute', bottom: '10%', left: '8%', width: '90px', height: '90px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.15, filter: 'blur(4px)', animation: 'treeSway1 9s ease-in-out infinite reverse', }} /> {/* Bottom-right tree cluster */} <div style={{ position: 'absolute', bottom: '5%', right: '4%', width: '110px', height: '110px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.2, filter: 'blur(6px)', animation: 'treeSway2 11s ease-in-out infinite', }} /> {/* Additional smaller clusters for depth */} <div style={{ position: 'absolute', top: '40%', left: '2%', width: '60px', height: '60px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.12, filter: 'blur(3px)', animation: 'treeSway1 7s ease-in-out infinite', }} /> <div style={{ position: 'absolute', top: '55%', right: '3%', width: '70px', height: '70px', borderRadius: '50%', background: 'radial-gradient(circle, #4a7c3a 0%, #3d6630 60%, transparent 70%)', opacity: 0.14, filter: 'blur(4px)', animation: 'treeSway2 8.5s ease-in-out infinite reverse', }} /> </div> )} {/* Flying bird shadows - very subtle from aerial view */} {state.style !== 'sprint' && ( <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none', zIndex: 0, }} > <div style={{ position: 'absolute', top: '30%', left: '-5%', width: '15px', height: '8px', background: 'rgba(0, 0, 0, 0.08)', borderRadius: '50%', filter: 'blur(2px)', animation: 'birdFly1 20s linear infinite', }} /> <div style={{ position: 'absolute', top: '60%', left: '-5%', width: '12px', height: '6px', background: 'rgba(0, 0, 0, 0.06)', borderRadius: '50%', filter: 'blur(2px)', animation: 'birdFly2 28s linear infinite', }} /> <div style={{ position: 'absolute', top: '45%', left: '-5%', width: '10px', height: '5px', background: 'rgba(0, 0, 0, 0.05)', borderRadius: '50%', filter: 'blur(1px)', animation: 'birdFly1 35s linear infinite', animationDelay: '-12s', }} /> </div> )} {/* Subtle cloud shadows moving across field */} {state.style !== 'sprint' && ( <div style={{ position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none', zIndex: 0, }} > <div style={{ position: 'absolute', top: '-10%', left: '-20%', width: '300px', height: '200px', background: 'radial-gradient(ellipse, rgba(0, 0, 0, 0.03) 0%, transparent 60%)', borderRadius: '50%', filter: 'blur(20px)', animation: 'cloudShadow1 45s linear infinite', }} /> <div style={{ position: 'absolute', top: '-10%', left: '-20%', width: '250px', height: '180px', background: 'radial-gradient(ellipse, rgba(0, 0, 0, 0.025) 0%, transparent 60%)', borderRadius: '50%', filter: 'blur(25px)', animation: 'cloudShadow2 60s linear infinite', animationDelay: '-20s', }} /> </div> )} {/* CSS animations */} <style>{` @keyframes treeSway1 { 0%, 100% { transform: scale(1) translate(0, 0); } 25% { transform: scale(1.02) translate(2px, -1px); } 50% { transform: scale(0.98) translate(-1px, 1px); } 75% { transform: scale(1.01) translate(-2px, -1px); } } @keyframes treeSway2 { 0%, 100% { transform: scale(1) translate(0, 0); } 30% { transform: scale(1.015) translate(-2px, 1px); } 60% { transform: scale(0.985) translate(2px, -1px); } 80% { transform: scale(1.01) translate(1px, 1px); } } @keyframes birdFly1 { 0% { transform: translate(0, 0); } 100% { transform: translate(calc(100vw + 100px), -20vh); } } @keyframes birdFly2 { 0% { transform: translate(0, 0); } 100% { transform: translate(calc(100vw + 100px), 15vh); } } @keyframes cloudShadow1 { 0% { transform: translate(0, 0); } 100% { transform: translate(calc(100vw + 400px), 30vh); } } @keyframes cloudShadow2 { 0% { transform: translate(0, 0); } 100% { transform: translate(calc(100vw + 350px), -20vh); } } `}</style> <div style={{ maxWidth: '100%', margin: '0 auto', flex: 1, display: 'flex', flexDirection: 'column', position: 'relative', zIndex: 1, }} > {state.gamePhase === 'intro' && <GameIntro />} {state.gamePhase === 'controls' && <GameControls />} {state.gamePhase === 'countdown' && <GameCountdown />} {state.gamePhase === 'playing' && <GameDisplay />} {state.gamePhase === 'results' && <GameResults />} </div> </div> ) } |