chore: add prettier formatting
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s
This commit is contained in:
@@ -43,7 +43,13 @@ const lightningBolts = [
|
||||
},
|
||||
];
|
||||
|
||||
export function WeatherEffects({ precipitation10m, thunderstorm = false }: { precipitation10m?: number | null; thunderstorm?: boolean }) {
|
||||
export function WeatherEffects({
|
||||
precipitation10m,
|
||||
thunderstorm = false,
|
||||
}: {
|
||||
precipitation10m?: number | null;
|
||||
thunderstorm?: boolean;
|
||||
}) {
|
||||
const reduceMotion = useReducedMotion();
|
||||
const isRaining = (precipitation10m ?? 0) > 0;
|
||||
|
||||
@@ -55,7 +61,11 @@ export function WeatherEffects({ precipitation10m, thunderstorm = false }: { pre
|
||||
<motion.span
|
||||
key={`rain-${index}`}
|
||||
initial={{ y: "-18vh", opacity: 0 }}
|
||||
animate={reduceMotion ? { y: `${(index % 8) * 14}vh`, opacity: 0.28 } : { y: ["-18vh", "118vh"], opacity: [0, drop.opacity, 0] }}
|
||||
animate={
|
||||
reduceMotion
|
||||
? { y: `${(index % 8) * 14}vh`, opacity: 0.28 }
|
||||
: { y: ["-18vh", "118vh"], opacity: [0, drop.opacity, 0] }
|
||||
}
|
||||
transition={{ duration: drop.duration, delay: drop.delay, repeat: Infinity, ease: "linear" }}
|
||||
className={`absolute -top-12 w-0.5 rotate-[10deg] rounded-full bg-foreground/70 shadow-[0_0_8px_hsl(var(--foreground)/0.18)] ${drop.lengthClass}`}
|
||||
style={{ left: drop.left }}
|
||||
@@ -65,7 +75,11 @@ export function WeatherEffects({ precipitation10m, thunderstorm = false }: { pre
|
||||
<motion.span
|
||||
key={`mist-${index}`}
|
||||
initial={{ y: "-10vh", opacity: 0 }}
|
||||
animate={reduceMotion ? { y: `${(index % 6) * 18}vh`, opacity: 0.16 } : { y: ["-10vh", "112vh"], opacity: [0, 0.26, 0] }}
|
||||
animate={
|
||||
reduceMotion
|
||||
? { y: `${(index % 6) * 18}vh`, opacity: 0.16 }
|
||||
: { y: ["-10vh", "112vh"], opacity: [0, 0.26, 0] }
|
||||
}
|
||||
transition={{ duration: drop.duration, delay: drop.delay, repeat: Infinity, ease: "linear" }}
|
||||
className="absolute -top-8 h-7 w-px rotate-[10deg] rounded-full bg-accent/55"
|
||||
style={{ left: drop.left }}
|
||||
@@ -80,7 +94,11 @@ export function WeatherEffects({ precipitation10m, thunderstorm = false }: { pre
|
||||
key={`lightning-${index}`}
|
||||
viewBox="0 0 96 176"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
animate={reduceMotion ? { opacity: bolt.opacity * 0.22 } : { opacity: [0, 0, bolt.opacity, bolt.opacity * 0.08, 0], scaleY: [0.98, 0.98, 1.02, 1, 0.99] }}
|
||||
animate={
|
||||
reduceMotion
|
||||
? { opacity: bolt.opacity * 0.22 }
|
||||
: { opacity: [0, 0, bolt.opacity, bolt.opacity * 0.08, 0], scaleY: [0.98, 0.98, 1.02, 1, 0.99] }
|
||||
}
|
||||
transition={{ duration: 3.6, repeat: Infinity, repeatDelay: 2.4, delay: bolt.delay }}
|
||||
className={`absolute text-foreground dark:text-white ${bolt.className}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user