From 45e4b3e4b8b86981fc7261f98f9455fa0e184253 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:07:54 +0330 Subject: [PATCH] Import source: src/components/FloatingScene/FloatingScene Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- .../FloatingScene/FloatingScene.jsx | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 src/components/FloatingScene/FloatingScene.jsx diff --git a/src/components/FloatingScene/FloatingScene.jsx b/src/components/FloatingScene/FloatingScene.jsx new file mode 100644 index 0000000..e0c6e9e --- /dev/null +++ b/src/components/FloatingScene/FloatingScene.jsx @@ -0,0 +1,168 @@ +import { useRef, useMemo } from 'react' +import { Canvas, useFrame } from '@react-three/fiber' +import { motion } from 'framer-motion' +import * as THREE from 'three' + +function FloatingTorus({ position, speed, phase }) { + const ref = useRef() + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + ref.current.rotation.x = t * speed * 0.4 + phase + ref.current.rotation.y = t * speed * 0.6 + phase + ref.current.position.y = position[1] + Math.sin(t * 0.6 + phase) * 0.3 + }) + return ( + + + + + ) +} + +function FloatingIcosahedron({ position, speed, phase }) { + const ref = useRef() + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + ref.current.rotation.x = t * speed * 0.5 + phase + ref.current.rotation.z = t * speed * 0.3 + phase + ref.current.position.y = position[1] + Math.sin(t * 0.5 + phase) * 0.35 + }) + return ( + + + + + ) +} + +function FloatingSphere({ position, speed, phase }) { + const ref = useRef() + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + ref.current.rotation.y = t * speed * 0.4 + ref.current.position.y = position[1] + Math.sin(t * 0.7 + phase) * 0.25 + }) + return ( + + + + + ) +} + +function FloatingOctahedron({ position, speed, phase }) { + const ref = useRef() + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + ref.current.rotation.x = t * speed * 0.6 + phase + ref.current.rotation.y = t * speed * 0.4 + phase + ref.current.position.y = position[1] + Math.sin(t * 0.8 + phase) * 0.3 + }) + return ( + + + + + ) +} + +function FloatingDodecahedron({ position, speed, phase }) { + const ref = useRef() + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + ref.current.rotation.y = t * speed * 0.35 + phase + ref.current.rotation.z = t * speed * 0.25 + phase + ref.current.position.y = position[1] + Math.sin(t * 0.55 + phase) * 0.28 + }) + return ( + + + + + ) +} + +function SceneParticles() { + const ref = useRef() + const positions = useMemo(() => { + const arr = new Float32Array(400 * 3) + for (let i = 0; i < 400; i++) { + arr[i * 3] = (Math.random() - 0.5) * 28 + arr[i * 3 + 1] = (Math.random() - 0.5) * 10 + arr[i * 3 + 2] = (Math.random() - 0.5) * 12 + } + return arr + }, []) + useFrame(({ clock }) => { + if (ref.current) ref.current.rotation.y = clock.getElapsedTime() * 0.015 + }) + return ( + + + + + + + ) +} + +function Scene() { + return ( + <> + + + + + + + + + + + + + {/* Small accent shapes */} + + + + + ) +} + +export default function FloatingScene() { + return ( +
+
+ + + + + {/* Overlay text */} +
+ + Sound In Space + + + Music Has Shape + +
+ + {/* Fade top/bottom */} +
+
+
+ ) +}