/* WeatherMate — animated weather icon set */
function WeatherIcon({ condition, isDay = true, size = 120, animate = true, style }) {
const cls = animate ? "wx-anim" : "";
const wrap = (children) => (
);
// palette
const sunC = "#FFD45E", sunRay = "#FFC53D";
const moonC = "#E9DEFF";
const cloudHi = "#FFFFFF", cloudLo = "#E4E9F2";
const cloudDk = "#C9D2E0";
function Sun({ cx = 60, cy = 56, r = 24, small }) {
const rays = [];
for (let i = 0; i < 12; i++) {
const a = (i / 12) * Math.PI * 2;
const r1 = r + 8, r2 = r + 16;
rays.push(
);
}
return (
{rays}
);
}
function Moon({ cx = 60, cy = 54, r = 26 }) {
return (
);
}
function Cloud({ x = 0, y = 0, scale = 1, hi = cloudHi, lo = cloudLo }) {
return (
);
}
function Drops({ n = 3, color = "#7FB2E8" }) {
const xs = [42, 60, 78];
return (
{Array.from({ length: n }).map((_, i) => (
))}
);
}
function Flakes() {
const xs = [42, 60, 78];
return (
{xs.map((x, i) => (
))}
);
}
function Bolt() {
return (
);
}
const defs = (
);
switch (condition) {
case "clear":
return wrap(<>{defs}{isDay ? : }>);
case "partly":
return wrap(<>{defs}
{isDay ? : }
>);
case "cloudy":
return wrap(<>{defs}
>);
case "fog":
return wrap(<>{defs}
{[0, 1, 2, 3].map(i => (
))}
>);
case "drizzle":
return wrap(<>{defs}>);
case "rain":
return wrap(<>{defs}>);
case "snow":
return wrap(<>{defs}>);
case "thunder":
return wrap(<>{defs}>);
default:
return wrap(<>{defs}>);
}
}
window.WeatherIcon = WeatherIcon;