From 91b819e9c1fe3d190e5f2c39fa11d96a5fe7c442 Mon Sep 17 00:00:00 2001 From: Timo Knuth Date: Fri, 9 Jan 2026 10:14:27 +0100 Subject: [PATCH] animations --- .claude/settings.local.json | 12 ++ src/components/home/BackgroundAnimations.tsx | 186 ++++++++++++------- 2 files changed, 127 insertions(+), 71 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..a31ff41 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,12 @@ +{ + "permissions": { + "allow": [ + "Bash(npm run build:*)", + "Bash(npm install:*)", + "Bash(ls:*)", + "Bash(node scripts/optimize-images.js:*)", + "Bash(node scripts/optimize-images.cjs:*)", + "Skill(frontend-design)" + ] + } +} diff --git a/src/components/home/BackgroundAnimations.tsx b/src/components/home/BackgroundAnimations.tsx index 9e6c928..35c02e0 100644 --- a/src/components/home/BackgroundAnimations.tsx +++ b/src/components/home/BackgroundAnimations.tsx @@ -2,22 +2,22 @@ import { motion } from 'framer-motion'; import { useMemo } from 'react'; const BackgroundAnimations = () => { - // Reduced particles for better performance (30 -> 12) + // Particles with better visibility (increased opacity and size) const particles = useMemo(() => { - return Array.from({ length: 12 }, (_, i) => ({ + return Array.from({ length: 18 }, (_, i) => ({ id: i, x: Math.random() * 100, y: Math.random() * 100, - size: Math.random() * 2 + 1, - duration: Math.random() * 12 + 8, + size: Math.random() * 4 + 2, // Larger particles (2-6px instead of 1-3px) + duration: Math.random() * 10 + 6, delay: Math.random() * 4, - opacity: Math.random() * 0.5 + 0.2, + opacity: Math.random() * 0.4 + 0.5, // Much higher opacity (0.5-0.9) })); }, []); - // Reduced circuit nodes for performance (12 -> 6) + // Circuit nodes for tech effect const circuitNodes = useMemo(() => { - return Array.from({ length: 6 }, (_, i) => ({ + return Array.from({ length: 8 }, (_, i) => ({ id: i, x: Math.random() * 80 + 10, y: Math.random() * 80 + 10, @@ -25,10 +25,10 @@ const BackgroundAnimations = () => { })); }, []); - // Reduced connection lines (half as many) + // Connection lines between nodes const connectionLines = useMemo(() => { const lines = []; - for (let i = 0; i < circuitNodes.length - 1; i += 2) { + for (let i = 0; i < circuitNodes.length - 1; i++) { if (i + 1 < circuitNodes.length) { lines.push({ id: i, @@ -44,72 +44,106 @@ const BackgroundAnimations = () => { return (
- {/* Simplified Static Grid Background - no animation for better performance */} -
- {/* SVG Container for Lines and Nodes - optimized */} - + {/* SVG Container for Lines and Nodes */} + - {/* Simplified Connection Lines - static for better performance */} + {/* Animated Connection Lines */} {connectionLines.map((line) => ( - - ))} - - {/* Reduced Vertical Data Streams (8 -> 4) */} - {[...Array(4)].map((_, i) => ( - ))} - {/* Simplified Circuit Nodes - reduced animation */} + {/* Vertical Data Streams */} + {[...Array(6)].map((_, i) => ( + + ))} + + + {/* Circuit Nodes with pulse ring */} {circuitNodes.map((node) => ( - {/* Core node with simple pulse */} + {/* Pulse ring */} + {/* Core node */} + { ))} - {/* Optimized Floating Data Particles with GPU acceleration */} + {/* Floating Data Particles - highly visible */} {particles.map((particle) => ( { height: `${particle.size}px`, left: `${particle.x}%`, top: `${particle.y}%`, - opacity: particle.opacity, - boxShadow: '0 0 6px rgba(51, 102, 255, 0.6)', + boxShadow: '0 0 12px rgba(51, 102, 255, 0.9), 0 0 24px rgba(51, 102, 255, 0.5)', willChange: 'transform, opacity', }} animate={{ - y: [0, -600], - opacity: [0, particle.opacity, 0], + y: [0, -500], + opacity: [0, particle.opacity, particle.opacity, 0], }} transition={{ duration: particle.duration, @@ -146,24 +179,35 @@ const BackgroundAnimations = () => { /> ))} - {/* Simplified Static Scanline Effect - no animation */} -
- {/* Reduced Radial Glows (3 -> 2) with simpler animation */} + {/* Radial Glows */} {[ - { x: 25, y: 40 }, - { x: 75, y: 60 }, + { x: 20, y: 30, size: 300 }, + { x: 80, y: 70, size: 350 }, + { x: 50, y: 50, size: 400 }, ].map((pos, i) => ( { style={{ left: `${pos.x}%`, top: `${pos.y}%`, - width: '180px', - height: '180px', - background: 'radial-gradient(circle, rgba(51, 102, 255, 0.12) 0%, transparent 70%)', + width: `${pos.size}px`, + height: `${pos.size}px`, + background: 'radial-gradient(circle, rgba(51, 102, 255, 0.25) 0%, transparent 70%)', transform: 'translate(-50%, -50%)', willChange: 'transform', }} animate={{ - scale: [1, 1.15, 1], - opacity: [0.4, 0.6, 0.4], + scale: [1, 1.3, 1], + opacity: [0.5, 0.8, 0.5], }} transition={{ - duration: 6, + duration: 5, repeat: Infinity, - delay: i * 2, + delay: i * 1.5, ease: "easeInOut", }} /> ))} - {/* Static Corner Accent Glows - no blur for better performance */} -
-
+ {/* Corner Accent Glows */} +
+
); };