From 3b58a31a376fbd85951a081afbb1576c45196219 Mon Sep 17 00:00:00 2001 From: zv Date: Sat, 13 Jun 2026 12:12:08 +0200 Subject: [PATCH] fix: improve weather card precipitation effects --- components/weather/weather-effects.tsx | 82 ++++++++++++++++++++------ 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/components/weather/weather-effects.tsx b/components/weather/weather-effects.tsx index d39683d..aef0eff 100644 --- a/components/weather/weather-effects.tsx +++ b/components/weather/weather-effects.tsx @@ -2,34 +2,78 @@ import { motion, useReducedMotion } from "framer-motion"; -const rainDrops = Array.from({ length: 12 }, (_, index) => ({ - left: `${(index * 43 + 7) % 101}%`, - delay: (index % 9) * 0.18, - duration: 1.1 + (index % 4) * 0.18, +const rainDrops = Array.from({ length: 32 }, (_, index) => ({ + left: `${(index * 29 + 7) % 101}%`, + delay: (index % 16) * 0.08, + duration: 0.82 + (index % 5) * 0.1, + lengthClass: index % 3 === 0 ? "h-16" : index % 3 === 1 ? "h-12" : "h-9", + opacity: index % 3 === 0 ? 0.46 : index % 3 === 1 ? 0.38 : 0.3, })); +const mistDrops = Array.from({ length: 18 }, (_, index) => ({ + left: `${(index * 37 + 19) % 101}%`, + delay: (index % 9) * 0.16, + duration: 1.35 + (index % 4) * 0.12, +})); + +const lightningBolts = [ + "left-[68%] top-[12%] h-28 rotate-[18deg]", + "left-[76%] top-[20%] h-20 rotate-[24deg]", +]; + export function WeatherEffects({ precipitation10m, thunderstorm = false }: { precipitation10m?: number | null; thunderstorm?: boolean }) { const reduceMotion = useReducedMotion(); const isRaining = (precipitation10m ?? 0) > 0; return (