import React from 'react'; import ReactDOM from 'react-dom'; import { Canvas, useFrame, useThree } from '@react-three/fiber'; import { Stars, Text, Float, Sparkles, PerspectiveCamera, Environment } from '@react-three/drei'; import { useRef, useState } from 'react'; import { motion } from 'framer-motion'; // Main 3D Scene Component function BirthdayScene() { const meshRef = useRef(); const groupRef = useRef(); const [activeMessage, setActiveMessage] = useState(null); const { mouse } = useThree(); const messages = [ "Your smile lights up every room", "19 looks gorgeous on you", "The world is better with you in it", "Your kindness is unmatched", "Forever young at heart", "A soul as bright as the stars", "Your laughter is contagious", "Beautiful inside and out", "A friend like no other", "Your creativity inspires me", "Simply one of a kind", "The perfect blend of sweet and strong", "Your energy is magnetic", "A heart of pure gold", "Wisdom beyond your years", "Your spirit shines so bright", "The definition of amazing", "A light in everyone's life", "My favorite person to celebrate" ]; useFrame((state, delta) => { // Smooth floating animation meshRef.current.position.y = Math.sin(state.clock.getElapsedTime() * 0.5) * 0.2; meshRef.current.rotation.y += delta * 0.1; // Parallax effect groupRef.current.rotation.x = mouse.y * 0.1; groupRef.current.rotation.y = mouse.x * 0.1; }); return ( {/* Environment */} {/* Main 19 Number */} {/* Love Orbs */} {Array.from({ length: 19 }).map((_, i) => { const angle = (i / 19) * Math.PI * 2; const radius = 4; const x = Math.cos(angle) * radius; const z = Math.sin(angle) * radius; return ( setActiveMessage(messages[i])} /> ); })} {/* Active Message Display */} {activeMessage && ( {activeMessage} )} ); } // Love Orb Component function LoveOrb({ position, onClick, message }) { const meshRef = useRef(); useFrame((state) => { meshRef.current.position.y = position[1] + Math.sin(state.clock.getElapsedTime() * 0.5 + position[0]) * 0.2; }); return ( document.body.style.cursor = 'pointer'} onPointerOut={() => document.body.style.cursor = 'auto'} > ); } // Main App Component function App() { const [entered, setEntered] = useState(false); const handleEnter = () => { setEntered(true); }; return ( <> {!entered ? (
ENTER HER WORLD
) : null} ); } // Wait for DOM to load before rendering document.addEventListener('DOMContentLoaded', () => { ReactDOM.render(, document.getElementById('root')); });