From 33c9ea4157e1c03f890a04b293e066ad626ec4f9 Mon Sep 17 00:00:00 2001 From: Linus Olofsson <61837116+LinusOlofsson-maker@users.noreply.github.com> Date: Wed, 20 May 2026 22:49:51 +0200 Subject: [PATCH] feat: random light pulse along threads + box outlines A blurred light pulse glides along one of the 5 wave threads (wave1/2/3, thread1/2) every 2.5-7s. Color matches the active theme (cyan on home/portfolio/about, pink/magenta on contact). Pulse also follows the outline of designated boxes marked with data-trail-box: - Home: 'Looking for inspiration?' + 'Ready to collaborate?' - Contact: 'Waiting to hear from you' card Boxes are rebuilt on every pulse so they stay aligned during scroll and respect viewport (off-screen boxes are skipped). Pulse uses requestAnimationFrame + path.getPointAtLength for native smoothness, fade-in 15% / hold 70% / fade-out 15%, screen blend mode so it blends with the dark background. --- src/components/WaveBackground.astro | 229 +++++++++++++++++++++++----- src/pages/contact.astro | 2 +- src/pages/index.astro | 4 +- 3 files changed, 194 insertions(+), 41 deletions(-) diff --git a/src/components/WaveBackground.astro b/src/components/WaveBackground.astro index d503dbb..d343e09 100644 --- a/src/components/WaveBackground.astro +++ b/src/components/WaveBackground.astro @@ -2,15 +2,19 @@ // src/components/WaveBackground.astro const { opacity = "opacity-30", theme = "cyan" } = Astro.props; -// Definiera färger baserat på tema -// Cyan = Originalet (Startsidan bas) -// Purple = Contact-sidan (Matchar boxen) -const mainColor = theme === 'purple' ? '#c026d3' : '#4fd1c5'; // Purple-600 vs Teal-400 -const secondaryColor = theme === 'purple' ? '#db2777' : '#22d3ee'; // Pink-600 vs Cyan-400 +const mainColor = theme === 'purple' ? '#c026d3' : '#4fd1c5'; +const secondaryColor = theme === 'purple' ? '#db2777' : '#22d3ee'; +const pulseMain = theme === 'purple' ? '#e879f9' : '#67e8f9'; +const pulseSec = theme === 'purple' ? '#f472b6' : '#a5f3fc'; --- -