From 071a5e7110fec479309966f20ebe1efd043f6381 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:08:01 +0330 Subject: [PATCH] Import source: src/components/MoodSection/MoodSection Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/components/MoodSection/MoodSection.jsx | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 src/components/MoodSection/MoodSection.jsx diff --git a/src/components/MoodSection/MoodSection.jsx b/src/components/MoodSection/MoodSection.jsx new file mode 100644 index 0000000..126666b --- /dev/null +++ b/src/components/MoodSection/MoodSection.jsx @@ -0,0 +1,139 @@ +import { useRef } from 'react' +import { Canvas, useFrame } from '@react-three/fiber' +import { motion } from 'framer-motion' +import * as THREE from 'three' + +const moods = [ + { name: 'Focus', desc: 'Deep concentration', tracks: 284, emoji: '◉' }, + { name: 'Chill', desc: 'Ease into the day', tracks: 512, emoji: '◎' }, + { name: 'Energy', desc: 'Push your limits', tracks: 389, emoji: '◈' }, + { name: 'Sleep', desc: 'Drift into calm', tracks: 156, emoji: '◐' }, + { name: 'Hype', desc: 'Turn it all up', tracks: 441, emoji: '◆' }, + { name: 'Melancholy', desc: 'Feel every note', tracks: 203, emoji: '◑' }, +] + +function NeuralWeb() { + const groupRef = useRef() + const nodesRef = useRef([]) + const lineRefs = useRef([]) + + const nodePositions = [ + [-2, 1, 0], [0, 1.5, 0.5], [2, 0.8, -0.3], + [-1.5, -0.5, 0.3], [0.5, -1, 0], [2.2, -0.8, 0.4], + [-2.5, 0, -0.2], [1, 0.2, 1], + ] + + useFrame(({ clock }) => { + const t = clock.getElapsedTime() + if (groupRef.current) groupRef.current.rotation.y = t * 0.1 + + nodesRef.current.forEach((mesh, i) => { + if (!mesh) return + mesh.position.y = nodePositions[i][1] + Math.sin(t * 0.6 + i) * 0.12 + const s = 0.06 + Math.abs(Math.sin(t * 0.8 + i * 0.7)) * 0.04 + mesh.scale.setScalar(s) + }) + }) + + const linePairs = [[0,1],[1,2],[2,5],[0,3],[3,4],[4,5],[1,7],[7,4],[0,6],[6,3],[1,3],[2,7]] + + return ( + + {nodePositions.map((pos, i) => ( + nodesRef.current[i] = el} position={pos}> + + + + ))} + {linePairs.map(([a, b], i) => { + const pa = new THREE.Vector3(...nodePositions[a]) + const pb = new THREE.Vector3(...nodePositions[b]) + const mid = pa.clone().add(pb).multiplyScalar(0.5) + const dir = pb.clone().sub(pa) + const len = dir.length() + const quat = new THREE.Quaternion() + quat.setFromUnitVectors(new THREE.Vector3(0,1,0), dir.normalize()) + return ( + + + + + ) + })} + + ) +} + +function MoodCard({ mood, index }) { + return ( + +
+ +
+ {mood.emoji} + {mood.tracks} tracks +
+ +
+

{mood.name}

+

{mood.desc}

+
+ +
+ {Array.from({ length: 12 }, (_, i) => ( +
+ ))} +
+ + ) +} + +export default function MoodSection() { + return ( +
+
+
+
+ {/* Moods grid */} +
+ +

Curated For You

+

+ Match Your Mood +

+
+
+ {moods.map((mood, i) => )} +
+
+ + {/* 3D Neural web */} +
+ + + + + + +
+
+
+
+ ) +}