From 85906087134717637fd9d8652c9e7353f127e6fc Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Tue, 3 Nov 2026 13:41:58 +0530 Subject: [PATCH] fix(ui): remove redundant badges, redesign 3D animation into floating neural crystal prism, and eliminate text overlap for maximum readability --- content/pages/home.json | 4 - src/components/3d/Hero3DCanvas.tsx | 161 +++++++++++++----------- src/components/sections/HeroSection.tsx | 21 ++-- src/components/ui/Navbar.tsx | 9 -- 4 files changed, 96 insertions(+), 99 deletions(-) diff --git a/content/pages/home.json b/content/pages/home.json index c29ee0a..7fc14f4 100644 --- a/content/pages/home.json +++ b/content/pages/home.json @@ -23,10 +23,6 @@ }, "tryIt": { "toolRef": "face.blemish.remove" - }, - "badge": { - "en": "⚡ Powered by CRE Neural Vision Core v2.0", - "hi": "⚡ सीआरई न्यूरल विज़न कोर v2.0 द्वारा संचालित" } } }, diff --git a/src/components/3d/Hero3DCanvas.tsx b/src/components/3d/Hero3DCanvas.tsx index 8e457f1..8b41598 100644 --- a/src/components/3d/Hero3DCanvas.tsx +++ b/src/components/3d/Hero3DCanvas.tsx @@ -18,13 +18,13 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; // Dimensions - let width = container.clientWidth || 400; - let height = container.clientHeight || 400; + let width = container.clientWidth || 340; + let height = container.clientHeight || 340; - // Scene, Camera, Renderer + // Scene, Camera, WebGLRenderer const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 100); - camera.position.z = 7; + camera.position.z = 6.2; const renderer = new THREE.WebGLRenderer({ alpha: true, @@ -40,88 +40,98 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { const rootGroup = new THREE.Group(); scene.add(rootGroup); - // 1. Outer Geodesic Wireframe Prism (Icosahedron) - const icoGeo = new THREE.IcosahedronGeometry(2.1, 1); - const wireframeGeo = new THREE.WireframeGeometry(icoGeo); - const wireframeMat = new THREE.LineBasicMaterial({ + // 1. Outer Translucent Diamond Crystal Prism (Octahedron) + const crystalGeo = new THREE.OctahedronGeometry(1.8, 0); + const crystalMat = new THREE.MeshPhysicalMaterial({ color: 0x3b82f6, // Electric Blue + roughness: 0.1, + metalness: 0.1, + transmission: 0.7, // Glass-like transparency + opacity: 0.65, transparent: true, - opacity: 0.5, - blending: THREE.AdditiveBlending, + emissive: 0x1d4ed8, + emissiveIntensity: 0.2, }); - const wireframeMesh = new THREE.LineSegments(wireframeGeo, wireframeMat); - rootGroup.add(wireframeMesh); + const crystalMesh = new THREE.Mesh(crystalGeo, crystalMat); + rootGroup.add(crystalMesh); - // Outer Node Dots on Vertices - const vertexPositions = icoGeo.attributes.position; - const vertexCount = vertexPositions.count; + // Subtle Glowing Edge Highlights on Crystal + const edgesGeo = new THREE.EdgesGeometry(crystalGeo); + const edgesMat = new THREE.LineBasicMaterial({ + color: 0x60a5fa, + transparent: true, + opacity: 0.8, + }); + const edgesLines = new THREE.LineSegments(edgesGeo, edgesMat); + rootGroup.add(edgesLines); + + // 2. Inner Nested Core Prism (Counter-rotating) + const innerGeo = new THREE.OctahedronGeometry(1.0, 0); + const innerMat = new THREE.MeshPhysicalMaterial({ + color: 0x6366f1, // Indigo + roughness: 0.2, + metalness: 0.8, + emissive: 0x4338ca, + emissiveIntensity: 0.5, + transparent: true, + opacity: 0.8, + }); + const innerMesh = new THREE.Mesh(innerGeo, innerMat); + rootGroup.add(innerMesh); + + // Vertex Spark Points + const vertexPositions = crystalGeo.attributes.position; const dotGeo = new THREE.BufferGeometry(); dotGeo.setAttribute('position', vertexPositions); const dotMat = new THREE.PointsMaterial({ - color: 0x60a5fa, - size: 0.12, + color: 0x93c5fd, + size: 0.14, transparent: true, - opacity: 0.85, + opacity: 0.9, blending: THREE.AdditiveBlending, }); const vertexPoints = new THREE.Points(dotGeo, dotMat); rootGroup.add(vertexPoints); - // 2. Inner Glowing Core Sphere - const innerGeo = new THREE.SphereGeometry(1.0, 32, 32); - const innerMat = new THREE.MeshStandardMaterial({ - color: 0x4f46e5, // Indigo - roughness: 0.15, - metalness: 0.85, - emissive: 0x1e40af, // Deep Blue glow - emissiveIntensity: 0.6, - transparent: true, - opacity: 0.9, - }); - const innerMesh = new THREE.Mesh(innerGeo, innerMat); - rootGroup.add(innerMesh); - - // 3. Orbiting Neural Tensor Particles (60 Particles) - const particleCount = prefersReducedMotion ? 20 : 60; + // 3. Delicate Floating Neural Particles (35 Points) + const particleCount = prefersReducedMotion ? 12 : 36; const particlePositions = new Float32Array(particleCount * 3); - const particleScales = new Float32Array(particleCount); for (let i = 0; i < particleCount; i++) { - const radius = 2.6 + Math.random() * 1.6; + const radius = 2.2 + Math.random() * 1.4; const theta = Math.random() * Math.PI * 2; const phi = Math.acos(2 * Math.random() - 1); particlePositions[i * 3] = radius * Math.sin(phi) * Math.cos(theta); particlePositions[i * 3 + 1] = radius * Math.sin(phi) * Math.sin(theta); particlePositions[i * 3 + 2] = radius * Math.cos(phi); - particleScales[i] = Math.random() * 0.08 + 0.04; } const particlesGeo = new THREE.BufferGeometry(); particlesGeo.setAttribute('position', new THREE.BufferAttribute(particlePositions, 3)); const particlesMat = new THREE.PointsMaterial({ - color: 0x818cf8, // Lavender Indigo - size: 0.1, + color: 0xa5b4fc, + size: 0.08, transparent: true, - opacity: 0.75, + opacity: 0.7, blending: THREE.AdditiveBlending, }); const particlesMesh = new THREE.Points(particlesGeo, particlesMat); rootGroup.add(particlesMesh); - // Lighting - const ambientLight = new THREE.AmbientLight(0xffffff, 0.8); + // Lights + const ambientLight = new THREE.AmbientLight(0xffffff, 0.9); scene.add(ambientLight); - const blueLight = new THREE.PointLight(0x3b82f6, 3, 12); - blueLight.position.set(4, 3, 4); - scene.add(blueLight); + const keyLight = new THREE.PointLight(0x38bdf8, 3, 10); + keyLight.position.set(3, 3, 3); + scene.add(keyLight); - const purpleLight = new THREE.PointLight(0xa855f7, 2.5, 12); - purpleLight.position.set(-4, -3, 3); - scene.add(purpleLight); + const fillLight = new THREE.PointLight(0xa855f7, 2, 10); + fillLight.position.set(-3, -2, 2); + scene.add(fillLight); - // Mouse Tracking with Smooth Damping + // Smooth Mouse Tracking with Damped Inertia let mouseX = 0; let mouseY = 0; let targetRotX = 0; @@ -132,12 +142,11 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { const centerX = rect.left + rect.width / 2; const centerY = rect.top + rect.height / 2; - // Distance from center of container normalized mouseX = (e.clientX - centerX) / (window.innerWidth * 0.5); mouseY = (e.clientY - centerY) / (window.innerHeight * 0.5); - targetRotY = mouseX * 0.65; - targetRotX = mouseY * 0.45; + targetRotY = mouseX * 0.75; + targetRotX = mouseY * 0.55; }; window.addEventListener('mousemove', handleMouseMove, { passive: true }); @@ -145,8 +154,8 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { // Handle Resize const handleResize = () => { if (!container) return; - width = container.clientWidth || 400; - height = container.clientHeight || 400; + width = container.clientWidth || 340; + height = container.clientHeight || 340; camera.aspect = width / height; camera.updateProjectionMatrix(); renderer.setSize(width, height); @@ -154,7 +163,7 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { window.addEventListener('resize', handleResize); - // IntersectionObserver to halt loop when not visible (Zero waste when scrolled away) + // IntersectionObserver to pause loop when scrolled out of view let isVisible = true; let animFrameId: number; @@ -170,7 +179,6 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { ); observer.observe(container); - // Animation Loop let clock = new THREE.Clock(); const animate = () => { @@ -183,23 +191,27 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { const elapsedTime = clock.getElapsedTime(); - // Smooth Inertial Lerp to Target Rotation - rootGroup.rotation.y += (targetRotY - rootGroup.rotation.y) * 0.04; - rootGroup.rotation.x += (targetRotX - rootGroup.rotation.x) * 0.04; + // Damped lerp to mouse position + rootGroup.rotation.y += (targetRotY - rootGroup.rotation.y) * 0.045; + rootGroup.rotation.x += (targetRotX - rootGroup.rotation.x) * 0.045; if (!prefersReducedMotion) { - // Continuous Gentle Oscillation & Spin - wireframeMesh.rotation.y += 0.0035; - wireframeMesh.rotation.z += 0.0015; - vertexPoints.rotation.y += 0.0035; - vertexPoints.rotation.z += 0.0015; + // Outer crystal slow graceful spin + crystalMesh.rotation.y += 0.004; + crystalMesh.rotation.x += 0.002; + edgesLines.rotation.y += 0.004; + edgesLines.rotation.x += 0.002; + vertexPoints.rotation.y += 0.004; + vertexPoints.rotation.z += 0.002; - // Inner core breathing scale - const breath = 1.0 + Math.sin(elapsedTime * 1.8) * 0.05; + // Inner core counter-rotates and breathes gently + innerMesh.rotation.y -= 0.006; + innerMesh.rotation.z += 0.003; + const breath = 1.0 + Math.sin(elapsedTime * 2.2) * 0.06; innerMesh.scale.set(breath, breath, breath); - // Counter-orbit particles - particlesMesh.rotation.y -= 0.002; + // Ambient particles orbit slowly + particlesMesh.rotation.y -= 0.0015; particlesMesh.rotation.x += 0.001; } @@ -208,21 +220,20 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) { animate(); - // Clean up return () => { if (animFrameId) cancelAnimationFrame(animFrameId); window.removeEventListener('mousemove', handleMouseMove); window.removeEventListener('resize', handleResize); observer.disconnect(); - // Dispose Geometries and Materials - icoGeo.dispose(); - wireframeGeo.dispose(); - wireframeMat.dispose(); - dotGeo.dispose(); - dotMat.dispose(); + crystalGeo.dispose(); + crystalMat.dispose(); + edgesGeo.dispose(); + edgesMat.dispose(); innerGeo.dispose(); innerMat.dispose(); + dotGeo.dispose(); + dotMat.dispose(); particlesGeo.dispose(); particlesMat.dispose(); renderer.dispose(); diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index 726293b..35d2880 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -45,11 +45,6 @@ export function HeroSection({ if (variant === 'tryit' && tool) { return (
- {/* Interactive 3D Three.js Neural Prism Canvas Layer */} -
- -
- {/* Ambient Radial Lighting Glow */}
@@ -76,6 +71,11 @@ export function HeroSection({ {/* Main Hero Header */}
+ {/* Interactive 3D Neural Crystal Prism Jewel (Centered Above Headline - Zero Text Overlap) */} +
+ +
+ {/* Live Core Status Pill */} {resolvedBadge && (
@@ -144,15 +144,14 @@ export function HeroSection({ // Centered Hero for Tools/Apps/Pricing pages return ( -
- {/* Ambient 3D Canvas in background */} -
- -
- +
+ {/* Subtle Decorative 3D Crystal Accent */} +
+ +
{resolvedBadge && (
diff --git a/src/components/ui/Navbar.tsx b/src/components/ui/Navbar.tsx index ef8a2a0..7ab287a 100644 --- a/src/components/ui/Navbar.tsx +++ b/src/components/ui/Navbar.tsx @@ -68,15 +68,6 @@ export function Navbar({ config, currentLocale }: NavbarProps) { {/* Right Status & Action Items */}
- {/* Live System Operational Indicator */} -
- - - - - Neural Core v2.4 Active -
- {/* Primary CTA Button */}