fix(ui): remove redundant badges, redesign 3D animation into floating neural crystal prism, and eliminate text overlap for maximum readability
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -45,11 +45,6 @@ export function HeroSection({
|
||||
if (variant === 'tryit' && tool) {
|
||||
return (
|
||||
<section className="relative overflow-hidden pt-12 pb-20 sm:pt-20 sm:pb-28 lg:pt-24 lg:pb-32 bg-[#FAF8F5]">
|
||||
{/* Interactive 3D Three.js Neural Prism Canvas Layer */}
|
||||
<div className="absolute top-4 sm:top-8 left-1/2 -translate-x-1/2 w-full max-w-[620px] h-[340px] sm:h-[400px] pointer-events-none z-0 opacity-65 sm:opacity-80">
|
||||
<Hero3DCanvas />
|
||||
</div>
|
||||
|
||||
{/* Ambient Radial Lighting Glow */}
|
||||
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-[450px] bg-gradient-to-b from-blue-500/[0.04] via-indigo-500/[0.03] to-transparent blur-3xl pointer-events-none -z-10" />
|
||||
|
||||
@@ -76,6 +71,11 @@ export function HeroSection({
|
||||
|
||||
{/* Main Hero Header */}
|
||||
<div className="text-center max-w-3xl mx-auto space-y-6 mb-12 sm:mb-16 relative z-10">
|
||||
{/* Interactive 3D Neural Crystal Prism Jewel (Centered Above Headline - Zero Text Overlap) */}
|
||||
<div className="w-28 h-28 sm:w-36 sm:h-36 mx-auto -mb-2 pointer-events-none z-10 opacity-95">
|
||||
<Hero3DCanvas />
|
||||
</div>
|
||||
|
||||
{/* Live Core Status Pill */}
|
||||
{resolvedBadge && (
|
||||
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200/80 text-xs font-mono font-semibold text-blue-700 shadow-sm backdrop-blur-sm">
|
||||
@@ -144,15 +144,14 @@ export function HeroSection({
|
||||
|
||||
// Centered Hero for Tools/Apps/Pricing pages
|
||||
return (
|
||||
<section className="relative overflow-hidden pt-20 pb-24 sm:pt-28 sm:pb-32 text-center bg-[#FAF8F5] border-b border-slate-900/[0.07]">
|
||||
{/* Ambient 3D Canvas in background */}
|
||||
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-[500px] h-[300px] pointer-events-none -z-0 opacity-40">
|
||||
<Hero3DCanvas />
|
||||
</div>
|
||||
|
||||
<section className="relative overflow-hidden pt-16 pb-20 sm:pt-24 sm:pb-28 text-center bg-[#FAF8F5] border-b border-slate-900/[0.07]">
|
||||
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-96 bg-gradient-to-b from-blue-500/[0.04] to-transparent blur-3xl pointer-events-none -z-10" />
|
||||
|
||||
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6 relative z-10">
|
||||
{/* Subtle Decorative 3D Crystal Accent */}
|
||||
<div className="w-20 h-20 mx-auto -mb-2 pointer-events-none z-10 opacity-85">
|
||||
<Hero3DCanvas />
|
||||
</div>
|
||||
{resolvedBadge && (
|
||||
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700 shadow-sm">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
|
||||
@@ -68,15 +68,6 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
|
||||
{/* Right Status & Action Items */}
|
||||
<div className="hidden lg:flex items-center space-x-4">
|
||||
{/* Live System Operational Indicator */}
|
||||
<div className="flex items-center gap-2 px-3 py-1.5 rounded-full bg-emerald-50 border border-emerald-200 text-[11px] font-mono text-emerald-700 shadow-sm">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-500 opacity-75"></span>
|
||||
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-600"></span>
|
||||
</span>
|
||||
<span>Neural Core v2.4 Active</span>
|
||||
</div>
|
||||
|
||||
{/* Primary CTA Button */}
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
|
||||
Reference in New Issue
Block a user