// FOLGORE — Mechanical hero animation // Pure SVG/CSS: animated pistons, gears, control cables, oscilloscope readout. // Black canvas, white linework. Editorial industrial. const { useEffect, useRef } = React; function MechanicalHero({ enabled = true }){ const wrapRef = useRef(null); useEffect(() => { // Mouse parallax for the whole rig const onMove = (e) => { if (!wrapRef.current) return; const x = (e.clientX / window.innerWidth - 0.5) * 14; const y = (e.clientY / window.innerHeight - 0.5) * 10; wrapRef.current.style.setProperty('--px', x + 'px'); wrapRef.current.style.setProperty('--py', y + 'px'); }; window.addEventListener('mousemove', onMove); return () => window.removeEventListener('mousemove', onMove); }, []); if (!enabled){ // Static fallback — still on-brand return (
); } return (
{/* Frame markings — corners */} {/* Crosshair behind rig */} {/* LEFT BLOCK — piston cylinder */} CYL · 01 / FRZ-A SN.04471 {/* Cylinder bore */} {/* Piston */} {/* Connecting rod / crank */} STROKE 92mm 3200 rpm {/* RIGHT BLOCK — mirror piston */} CYL · 02 / FRZ-B SN.04472 STROKE 92mm 3200 rpm {/* CENTER — gear assembly */} {/* Big gear */} {/* teeth */} {Array.from({length: 36}).map((_, i) => { const a = (i * 360 / 36) * Math.PI / 180; const x1 = 980 + Math.cos(a) * 200; const y1 = 540 + Math.sin(a) * 200; const x2 = 980 + Math.cos(a) * 218; const y2 = 540 + Math.sin(a) * 218; return ; })} {/* spokes */} {/* Reference notch — shows rotation */} {/* Smaller gear top-left meshing */} {Array.from({length: 24}).map((_, i) => { const a = (i * 360 / 24) * Math.PI / 180; const x1 = 640 + Math.cos(a) * 80; const y1 = 540 + Math.sin(a) * 80; const x2 = 640 + Math.cos(a) * 92; const y2 = 540 + Math.sin(a) * 92; return ; })} {/* Smaller gear bottom-right */} {Array.from({length: 28}).map((_, i) => { const a = (i * 360 / 28) * Math.PI / 180; const x1 = 1280 + Math.cos(a) * 100; const y1 = 660 + Math.sin(a) * 100; const x2 = 1280 + Math.cos(a) * 114; const y2 = 660 + Math.sin(a) * 114; return ; })} {/* Top — control cables / signal lines */} {/* Connector caps */} {/* Bottom — control cables */} {/* Top-left telemetry block */} OUTPUT · KW 3.84 / NORM {/* Top-right telemetry */} TORQUE · NM 412 / PEAK {/* Bottom-left telemetry */} CYCLES · 24H 81 449 {/* Bottom-right telemetry — running clock */} UPTIME · H 14 982 {/* Center oscilloscope strip */} SIGNAL · CH-A FREQ 1.40 KHZ {/* Center title-stamp area (kept low-density so headline above can sit clean) */} {/* Decorative HUD outside SVG (HTML for crisp text) */}
01 ENGINE OK 02 CALIBRATED 03 LIVE FEED
); } window.MechanicalHero = MechanicalHero;