@cos-design/weather-background 3.5.4 → 3.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +272 -262
- package/dist/packages/shared/src/index.d.ts +10 -3
- package/dist/packages/shared/src/math.d.ts +1 -0
- package/dist/packages/shared/src/photo.d.ts +15 -0
- package/dist/packages/shared/src/pointer.d.ts +14 -0
- package/dist/packages/shared/src/reduced-motion.d.ts +4 -0
- package/dist/packages/shared/src/size.d.ts +8 -0
- package/dist/packages/shared/src/use-element-size.d.ts +45 -0
- package/dist/packages/shared/src/visibility.d.ts +2 -0
- package/dist/src/components/weatherBackground/types.d.ts +6 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
2
|
+
import { bindPrefersReducedMotion as i, bindVisibilityPause as a, prefersReducedMotion as o, useCanvasBox as s } from "@cos-design/shared";
|
|
3
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
4
|
import './index.css';//#region src/components/weatherBackground/day-cycle.ts
|
|
5
|
-
var
|
|
5
|
+
var u = (e) => Math.min(1, Math.max(0, e)), d = (e) => {
|
|
6
6
|
let t = e.replace("#", "").trim(), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
7
7
|
if (n.length !== 6) return [
|
|
8
8
|
80,
|
|
@@ -19,17 +19,17 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
19
19
|
r >> 8 & 255,
|
|
20
20
|
r & 255
|
|
21
21
|
];
|
|
22
|
-
},
|
|
22
|
+
}, f = ([e, t, n]) => {
|
|
23
23
|
let r = (e) => Math.min(255, Math.max(0, Math.round(e))).toString(16).padStart(2, "0");
|
|
24
24
|
return `#${r(e)}${r(t)}${r(n)}`;
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
],
|
|
30
|
-
let t =
|
|
25
|
+
}, p = (e, t, n) => e + (t - e) * n, m = (e, t, n) => [
|
|
26
|
+
p(e[0], t[0], n),
|
|
27
|
+
p(e[1], t[1], n),
|
|
28
|
+
p(e[2], t[2], n)
|
|
29
|
+
], h = (e, t, n) => f(m(d(e), d(t), u(n))), g = (e) => {
|
|
30
|
+
let t = u(e);
|
|
31
31
|
return t * t * (3 - 2 * t);
|
|
32
|
-
},
|
|
32
|
+
}, _ = (e = Date.now()) => {
|
|
33
33
|
let t = new Date(e), n = new Date(t);
|
|
34
34
|
n.setHours(6, 0, 0, 0);
|
|
35
35
|
let r = new Date(t);
|
|
@@ -37,52 +37,52 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
37
37
|
sunrise: n.getTime(),
|
|
38
38
|
sunset: r.getTime()
|
|
39
39
|
};
|
|
40
|
-
},
|
|
40
|
+
}, v = (e, t = /* @__PURE__ */ new Date()) => {
|
|
41
41
|
let n = e.trim().match(/^(\d{1,2}):(\d{2})$/);
|
|
42
42
|
if (!n) return null;
|
|
43
43
|
let r = Number(n[1]), i = Number(n[2]);
|
|
44
44
|
if (r < 0 || r > 23 || i < 0 || i > 59) return null;
|
|
45
45
|
let a = new Date(t);
|
|
46
46
|
return a.setHours(r, i, 0, 0), a.getTime();
|
|
47
|
-
},
|
|
47
|
+
}, y = (e, t = /* @__PURE__ */ new Date()) => v(e ?? "14:00", t) ?? v("14:00", t), b = (e, t) => {
|
|
48
48
|
let { sunrise: n, sunset: r } = t;
|
|
49
49
|
if (!(r > n)) {
|
|
50
|
-
let t =
|
|
50
|
+
let t = _(e);
|
|
51
51
|
n = t.sunrise, r = t.sunset;
|
|
52
52
|
}
|
|
53
|
-
let i = Math.max(1, r - n), a = n + 1440 * 60 * 1e3, o = r - 1440 * 60 * 1e3,
|
|
54
|
-
if (
|
|
53
|
+
let i = Math.max(1, r - n), a = n + 1440 * 60 * 1e3, o = r - 1440 * 60 * 1e3, s = e >= n && e < r, c;
|
|
54
|
+
if (s) c = u((e - n) / i);
|
|
55
55
|
else if (e >= r) {
|
|
56
56
|
let t = Math.max(1, a - r);
|
|
57
|
-
|
|
57
|
+
c = u((e - r) / t);
|
|
58
58
|
} else {
|
|
59
59
|
let t = Math.max(1, n - o);
|
|
60
|
-
|
|
60
|
+
c = u((e - o) / t);
|
|
61
61
|
}
|
|
62
|
-
let
|
|
62
|
+
let l = s ? Math.sin(Math.PI * c) : 0, d = Math.abs(e - n), f = Math.abs(e - r), p = u(1 - Math.min(d, f) / 45e5);
|
|
63
63
|
return {
|
|
64
|
-
isDay:
|
|
65
|
-
arcProgress:
|
|
66
|
-
elevation:
|
|
64
|
+
isDay: s,
|
|
65
|
+
arcProgress: c,
|
|
66
|
+
elevation: l,
|
|
67
67
|
twilight: p
|
|
68
68
|
};
|
|
69
|
-
},
|
|
70
|
-
let r =
|
|
69
|
+
}, x = (e, t, n) => {
|
|
70
|
+
let r = u(n), i = Math.sin(Math.PI * r);
|
|
71
71
|
return {
|
|
72
72
|
x: e * (.1 + .8 * r),
|
|
73
73
|
y: t * (.58 - .4 * i)
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, S = "#e8895c", C = "#f3c98a", w = "#2a1f4a", T = "#c4784a", ee = (e, t, n) => {
|
|
76
76
|
if (n.isDay) {
|
|
77
|
-
let t =
|
|
78
|
-
return [
|
|
77
|
+
let t = g(n.elevation), r = (1 - t) * .72;
|
|
78
|
+
return [h(h(e[0], S, r), "#1a2438", (1 - t) * .12), h(h(e[1], C, r * .85), "#3a4558", (1 - t) * .08)];
|
|
79
79
|
}
|
|
80
80
|
let r = n.twilight;
|
|
81
|
-
return [
|
|
82
|
-
},
|
|
81
|
+
return [h(t[0], h(w, S, .35), r * .55), h(t[1], h(T, C, .4), r * .7)];
|
|
82
|
+
}, te = (e, t, n) => {
|
|
83
83
|
let r = e.createLinearGradient(0, 0, 0, t);
|
|
84
84
|
return r.addColorStop(0, n[0]), r.addColorStop(1, n[1]), r;
|
|
85
|
-
},
|
|
85
|
+
}, E = (e) => {
|
|
86
86
|
if (!e.isDay) return {
|
|
87
87
|
scale: .92 + e.twilight * .06,
|
|
88
88
|
alpha: .75 + e.twilight * .2
|
|
@@ -92,16 +92,16 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
92
92
|
scale: .82 + t * .22,
|
|
93
93
|
alpha: .65 + t * .35
|
|
94
94
|
};
|
|
95
|
-
},
|
|
95
|
+
}, D = 2, O = [
|
|
96
96
|
"",
|
|
97
97
|
"薄雾",
|
|
98
98
|
"中雾",
|
|
99
99
|
"浓雾"
|
|
100
|
-
],
|
|
101
|
-
let t =
|
|
102
|
-
return `${t} · ${
|
|
103
|
-
},
|
|
104
|
-
let n =
|
|
100
|
+
], k = (e) => Math.min(3, Math.max(1, Math.round(e))), A = (e) => {
|
|
101
|
+
let t = k(e);
|
|
102
|
+
return `${t} · ${O[t]}`;
|
|
103
|
+
}, j = (e) => e === "fog", M = (e, t) => {
|
|
104
|
+
let n = k(t);
|
|
105
105
|
return n === 1 ? {
|
|
106
106
|
...e,
|
|
107
107
|
fogBanks: 3,
|
|
@@ -121,19 +121,19 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
121
121
|
cloudAlpha: .32,
|
|
122
122
|
sun: "dim"
|
|
123
123
|
};
|
|
124
|
-
},
|
|
125
|
-
let t =
|
|
124
|
+
}, N = (e) => {
|
|
125
|
+
let t = k(e);
|
|
126
126
|
return t === 1 ? .45 : t === 3 ? .95 : .65;
|
|
127
|
-
},
|
|
127
|
+
}, P = (e) => e === 45 ? 2 : e === 48 ? 3 : null, F = (e) => e == null || !Number.isFinite(e) ? null : e >= 5e3 ? 1 : e >= 1e3 ? 2 : 3, I = 2, L = [
|
|
128
128
|
"",
|
|
129
129
|
"细雹",
|
|
130
130
|
"密雹",
|
|
131
131
|
"巨雹"
|
|
132
|
-
],
|
|
133
|
-
let t =
|
|
134
|
-
return `${t} · ${
|
|
135
|
-
},
|
|
136
|
-
let t =
|
|
132
|
+
], R = (e) => Math.min(3, Math.max(1, Math.round(e))), z = (e) => {
|
|
133
|
+
let t = R(e);
|
|
134
|
+
return `${t} · ${L[t]}`;
|
|
135
|
+
}, B = (e) => e === "hail", ne = (e) => {
|
|
136
|
+
let t = R(e);
|
|
137
137
|
return t === 1 ? {
|
|
138
138
|
count: 75,
|
|
139
139
|
sizeMin: .85,
|
|
@@ -150,8 +150,8 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
150
150
|
sizeMax: 3.8,
|
|
151
151
|
speedMul: 1
|
|
152
152
|
};
|
|
153
|
-
}, V = (e) => e === 96 ? 2 : e === 99 ? 3 : null,
|
|
154
|
-
let t =
|
|
153
|
+
}, V = (e) => e === 96 ? 2 : e === 99 ? 3 : null, H = 1, U = 10, W = 5, G = 5, K = (e) => Math.min(10, Math.max(1, Math.round(e))), q = (e, t, n) => e + (t - e) * n, J = (e) => {
|
|
154
|
+
let t = K(e);
|
|
155
155
|
return t <= 2 ? 1 : t <= 4 ? 2 : t <= 6 ? 3 : t <= 8 ? 4 : 5;
|
|
156
156
|
}, re = [
|
|
157
157
|
"毛毛雨",
|
|
@@ -165,22 +165,22 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
165
165
|
"中雪",
|
|
166
166
|
"暴雪",
|
|
167
167
|
"特大暴雪"
|
|
168
|
-
],
|
|
169
|
-
let n =
|
|
168
|
+
], ae = (e, t) => {
|
|
169
|
+
let n = J(e);
|
|
170
170
|
return (t === "rain" ? re : ie)[n - 1];
|
|
171
|
-
},
|
|
172
|
-
let n = (
|
|
171
|
+
}, oe = (e, t) => `${K(e)} · ${ae(e, t)}`, se = ["", ...re], ce = ["", ...ie], Y = (e) => e === "lightRain" || e === "moderateRain" || e === "heavyRain" ? "rain" : e === "lightSnow" || e === "moderateSnow" || e === "heavySnow" ? "snow" : e, le = (e) => e === "rain" || e === "lightRain" || e === "moderateRain" || e === "heavyRain", ue = (e) => e === "snow" || e === "lightSnow" || e === "moderateSnow" || e === "heavySnow", de = (e) => le(e) || e === "thunderstorm" || e === "sleet", fe = (e) => ue(e) || e === "sleet", pe = (e, t = 5) => e === "lightRain" ? 3 : e === "moderateRain" ? 5 : e === "heavyRain" ? 8 : K(t), me = (e, t = 5) => e === "lightSnow" ? 3 : e === "moderateSnow" ? 5 : e === "heavySnow" ? 8 : K(t), X = (e, t) => t === "rain" ? e <= 2 ? "lightRain" : e === 3 ? "moderateRain" : "heavyRain" : e <= 2 ? "lightSnow" : e === 3 ? "moderateSnow" : "heavySnow", he = (e, t = 5, n = 5) => e === "rain" ? X(J(t), "rain") : e === "lightRain" || e === "moderateRain" || e === "heavyRain" ? X(J(pe(e)), "rain") : e === "snow" ? X(J(n), "snow") : e === "lightSnow" || e === "moderateSnow" || e === "heavySnow" ? X(J(me(e)), "snow") : e, ge = (e, t) => {
|
|
172
|
+
let n = (K(t) - 1) / 9;
|
|
173
173
|
return {
|
|
174
|
-
count: Math.round(
|
|
175
|
-
speed:
|
|
176
|
-
wind:
|
|
177
|
-
alpha:
|
|
178
|
-
splash:
|
|
174
|
+
count: Math.round(q(35, 340, n)),
|
|
175
|
+
speed: q(5.5, 16, n),
|
|
176
|
+
wind: q(-.4, -3.2, n),
|
|
177
|
+
alpha: q(.28, .62, n),
|
|
178
|
+
splash: K(t) >= 5
|
|
179
179
|
};
|
|
180
|
-
},
|
|
181
|
-
let t = (
|
|
182
|
-
return Math.round(
|
|
183
|
-
},
|
|
180
|
+
}, _e = (e) => {
|
|
181
|
+
let t = (K(e) - 1) / 9;
|
|
182
|
+
return Math.round(q(30, 360, t));
|
|
183
|
+
}, ve = (e) => [51, 56].includes(e) ? 2 : [
|
|
184
184
|
61,
|
|
185
185
|
66,
|
|
186
186
|
80
|
|
@@ -190,16 +190,16 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
190
190
|
57,
|
|
191
191
|
63,
|
|
192
192
|
81
|
|
193
|
-
].includes(e) ? 5 : [65, 67].includes(e) ? 8 : [82].includes(e) ? 10 : [95].includes(e) ? 7 : null,
|
|
193
|
+
].includes(e) ? 5 : [65, 67].includes(e) ? 8 : [82].includes(e) ? 10 : [95].includes(e) ? 7 : null, ye = (e) => [77].includes(e) ? 2 : [71, 85].includes(e) ? 3 : [73].includes(e) ? 5 : [75].includes(e) ? 8 : [86].includes(e) ? 10 : null, be = 2, xe = [
|
|
194
194
|
"",
|
|
195
195
|
"轻霾",
|
|
196
196
|
"中霾",
|
|
197
197
|
"重霾"
|
|
198
|
-
],
|
|
199
|
-
let t =
|
|
200
|
-
return `${t} · ${
|
|
201
|
-
},
|
|
202
|
-
let n =
|
|
198
|
+
], Z = (e) => Math.min(3, Math.max(1, Math.round(e))), Se = (e) => {
|
|
199
|
+
let t = Z(e);
|
|
200
|
+
return `${t} · ${xe[t]}`;
|
|
201
|
+
}, Ce = (e) => e === "smog", we = (e, t) => {
|
|
202
|
+
let n = Z(t);
|
|
203
203
|
return n === 1 ? {
|
|
204
204
|
...e,
|
|
205
205
|
fogBanks: 5,
|
|
@@ -219,10 +219,10 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
219
219
|
cloudAlpha: .35,
|
|
220
220
|
sun: "dim"
|
|
221
221
|
};
|
|
222
|
-
},
|
|
223
|
-
let t =
|
|
222
|
+
}, Te = (e) => {
|
|
223
|
+
let t = Z(e);
|
|
224
224
|
return t === 1 ? .55 : t === 3 ? 1.05 : .85;
|
|
225
|
-
},
|
|
225
|
+
}, Ee = (e) => e == null || !Number.isFinite(e) ? null : e >= 5e3 ? 1 : e >= 1e3 ? 2 : 3, De = {
|
|
226
226
|
0: "sunny",
|
|
227
227
|
1: "sunny",
|
|
228
228
|
2: "partlyCloudy",
|
|
@@ -251,7 +251,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
251
251
|
95: "thunderstorm",
|
|
252
252
|
96: "hail",
|
|
253
253
|
99: "hail"
|
|
254
|
-
},
|
|
254
|
+
}, Oe = (e) => Y(De[e] ?? "overcast"), ke = {
|
|
255
255
|
weather: null,
|
|
256
256
|
rainLevel: null,
|
|
257
257
|
snowLevel: null,
|
|
@@ -261,7 +261,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
261
261
|
status: "idle",
|
|
262
262
|
error: null,
|
|
263
263
|
current: null
|
|
264
|
-
},
|
|
264
|
+
}, Ae = {
|
|
265
265
|
weather: null,
|
|
266
266
|
rainLevel: null,
|
|
267
267
|
snowLevel: null,
|
|
@@ -271,7 +271,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
271
271
|
status: "locating",
|
|
272
272
|
error: null,
|
|
273
273
|
current: null
|
|
274
|
-
},
|
|
274
|
+
}, je = {
|
|
275
275
|
weather: null,
|
|
276
276
|
rainLevel: null,
|
|
277
277
|
snowLevel: null,
|
|
@@ -281,15 +281,15 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
281
281
|
status: "fetching",
|
|
282
282
|
error: null,
|
|
283
283
|
current: null
|
|
284
|
-
},
|
|
284
|
+
}, Me = (e) => e != null && Number.isFinite(e.latitude) && Number.isFinite(e.longitude), Q = (e) => {
|
|
285
285
|
if (typeof e != "string" || !e) return null;
|
|
286
286
|
let t = Date.parse(e);
|
|
287
287
|
return Number.isFinite(t) ? t : null;
|
|
288
|
-
},
|
|
288
|
+
}, Ne = (e) => {
|
|
289
289
|
if (typeof e != "string" || !e) return null;
|
|
290
290
|
let t = e.match(/T(\d{2}):(\d{2})/);
|
|
291
291
|
return t ? `${t[1]}:${t[2]}` : null;
|
|
292
|
-
},
|
|
292
|
+
}, Pe = (e, t) => {
|
|
293
293
|
if (e) try {
|
|
294
294
|
let t = new Intl.DateTimeFormat("en-GB", {
|
|
295
295
|
timeZone: e,
|
|
@@ -300,8 +300,8 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
300
300
|
if (n != null && r != null) return `${n.padStart(2, "0")}:${r.padStart(2, "0")}`;
|
|
301
301
|
} catch {}
|
|
302
302
|
return t ?? null;
|
|
303
|
-
},
|
|
304
|
-
let i =
|
|
303
|
+
}, Fe = (t = !0, n) => {
|
|
304
|
+
let i = Me(n), a = i ? n.latitude : null, o = i ? n.longitude : null, s = t ? i ? je : Ae : ke, c = `${t}:${a},${o}`, [l, u] = r(s), [d, f] = r(c);
|
|
305
305
|
return d !== c && (f(c), u((e) => t && e.weather ? {
|
|
306
306
|
...s,
|
|
307
307
|
weather: e.weather,
|
|
@@ -321,7 +321,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
321
321
|
if (!a.ok) throw Error(`Open-Meteo 请求失败(HTTP ${a.status})`);
|
|
322
322
|
let o = await a.json(), s = Number(o?.current?.weather_code);
|
|
323
323
|
if (Number.isNaN(s)) throw Error("Open-Meteo 返回数据缺少 weather_code");
|
|
324
|
-
let c = Number(o?.current?.wind_speed_10m ?? 0), l =
|
|
324
|
+
let c = Number(o?.current?.wind_speed_10m ?? 0), l = Q(o?.daily?.sunrise?.[0]), d = Q(o?.daily?.sunset?.[0]), f = typeof o?.timezone == "string" ? o.timezone : null, p = Ne(o?.current?.time) ?? Pe(f), m = Oe(s), h = ve(s), g = ye(s), _ = o?.current?.visibility, v = _ != null && Number.isFinite(Number(_)) ? Number(_) : null, y = m === "fog" ? F(v) ?? P(s) ?? 2 : null, b = m === "hail" ? V(s) ?? 2 : null, x = m === "smog" ? Ee(v) ?? 2 : null;
|
|
325
325
|
if (e) return;
|
|
326
326
|
u({
|
|
327
327
|
weather: m,
|
|
@@ -409,7 +409,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
409
409
|
a,
|
|
410
410
|
o
|
|
411
411
|
]), l;
|
|
412
|
-
},
|
|
412
|
+
}, Ie = async (e, t, n) => {
|
|
413
413
|
let r = new URLSearchParams({
|
|
414
414
|
latitude: String(e),
|
|
415
415
|
longitude: String(t),
|
|
@@ -418,17 +418,17 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
418
418
|
forecast_days: "1"
|
|
419
419
|
}), i = await fetch(`https://api.open-meteo.com/v1/forecast?${r}`, { signal: n });
|
|
420
420
|
if (!i.ok) return null;
|
|
421
|
-
let a = await i.json(), o =
|
|
421
|
+
let a = await i.json(), o = Q(a?.daily?.sunrise?.[0]), s = Q(a?.daily?.sunset?.[0]);
|
|
422
422
|
return o == null || s == null ? null : {
|
|
423
423
|
sunrise: o,
|
|
424
424
|
sunset: s
|
|
425
425
|
};
|
|
426
|
-
},
|
|
427
|
-
let n =
|
|
426
|
+
}, Le = (t) => {
|
|
427
|
+
let n = Me(t), i = n ? t.latitude : null, a = n ? t.longitude : null, o = `${i},${a}`, [s, c] = r(null), [l, u] = r(o);
|
|
428
428
|
return l !== o && (u(o), c(null)), e(() => {
|
|
429
429
|
if (i == null || a == null) return;
|
|
430
430
|
let e = !1, t = new AbortController();
|
|
431
|
-
return
|
|
431
|
+
return Ie(i, a, t.signal).then((t) => {
|
|
432
432
|
e || c(t);
|
|
433
433
|
}).catch(() => {
|
|
434
434
|
e || c(null);
|
|
@@ -436,7 +436,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
436
436
|
e = !0, t.abort();
|
|
437
437
|
};
|
|
438
438
|
}, [i, a]), n ? s : null;
|
|
439
|
-
},
|
|
439
|
+
}, Re = 3, ze = (e) => Math.min(12, Math.max(0, Math.round(e))), Be = (e) => Math.max(0, ze(e) - 2), Ve = .55, He = [
|
|
440
440
|
0,
|
|
441
441
|
3,
|
|
442
442
|
8,
|
|
@@ -450,7 +450,7 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
450
450
|
95,
|
|
451
451
|
110,
|
|
452
452
|
125
|
|
453
|
-
],
|
|
453
|
+
], Ue = [
|
|
454
454
|
1,
|
|
455
455
|
5,
|
|
456
456
|
11,
|
|
@@ -464,8 +464,8 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
464
464
|
102,
|
|
465
465
|
117,
|
|
466
466
|
Infinity
|
|
467
|
-
],
|
|
468
|
-
let i = t.gustiness, a = t.wander, o = n * .0017 + r * .0024, s = e *
|
|
467
|
+
], $ = (e, t, n = 0, r = 0) => {
|
|
468
|
+
let i = t.gustiness, a = t.wander, o = n * .0017 + r * .0024, s = e * Ve, c = Math.sin(s * .007 + o), l = Math.sin(s * .021 + 1.37 + o * 1.4), u = Math.sin(s * .055 + 2.8 + o * .6), d = 1 + (.5 * c + .35 * l + .15 * u) * (.25 + i * .75), f = Math.sin(s * .012 + o * .8);
|
|
469
469
|
f > .72 && (d += (f - .72) * (.8 + i * 2.4)), Math.sin(s * .0095 + .6 + o) < -.55 && (d *= .45 + i * .2), d = Math.max(.12, Math.min(2.25, d));
|
|
470
470
|
let p = a * (.55 * Math.sin(s * .0088 + o) + .3 * Math.sin(s * .026 + 1.9 + o * 1.1) + .15 * Math.sin(s * .063 + .4));
|
|
471
471
|
return {
|
|
@@ -474,8 +474,8 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
474
474
|
ux: Math.cos(p),
|
|
475
475
|
uy: Math.sin(p)
|
|
476
476
|
};
|
|
477
|
-
},
|
|
478
|
-
let t =
|
|
477
|
+
}, We = (e) => {
|
|
478
|
+
let t = ze(e);
|
|
479
479
|
if (t <= 0) return {
|
|
480
480
|
count: 0,
|
|
481
481
|
alphaMul: 0
|
|
@@ -485,12 +485,12 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
485
485
|
count: Math.floor(3 + n * n * 50),
|
|
486
486
|
alphaMul: .1 + n * .9
|
|
487
487
|
};
|
|
488
|
-
},
|
|
488
|
+
}, Ge = (e) => He[ze(e)] ?? 16, Ke = (e) => {
|
|
489
489
|
let t = Math.max(0, e);
|
|
490
|
-
for (let e = 0; e <
|
|
490
|
+
for (let e = 0; e < Ue.length; e++) if (t <= Ue[e]) return e;
|
|
491
491
|
return 12;
|
|
492
|
-
},
|
|
493
|
-
let t =
|
|
492
|
+
}, qe = (e) => {
|
|
493
|
+
let t = Ke(e), n = Be(t), r = Ge(n), i = Math.max(.04, Math.min(r / 16, 4.2)), { alphaMul: a } = We(n), o = i ** .82, s = Math.min(1, (n / 8) ** 1.1), c = (.04 + s * .32) * Math.PI;
|
|
494
494
|
return {
|
|
495
495
|
speedKmh: e,
|
|
496
496
|
level: t,
|
|
@@ -506,17 +506,17 @@ var s = (e) => Math.min(1, Math.max(0, e)), c = (e) => {
|
|
|
506
506
|
gustiness: s,
|
|
507
507
|
wander: c
|
|
508
508
|
};
|
|
509
|
-
},
|
|
509
|
+
}, Je = (e) => e.live && e.liveWindKmh != null && Number.isFinite(e.liveWindKmh) ? Math.max(0, e.liveWindKmh) : Ge(e.windLevel);
|
|
510
510
|
//#endregion
|
|
511
511
|
//#region src/components/weatherBackground/scene/draw-atmosphere.ts
|
|
512
|
-
function
|
|
512
|
+
function Ye(e) {
|
|
513
513
|
let t = e.windMotion.cloud, { intensity: n, angle: r, uy: i } = e.windField, a = -Math.cos(r);
|
|
514
514
|
for (let r of e.state.clouds) {
|
|
515
515
|
let o = Math.abs(r.speed) * t * n;
|
|
516
516
|
r.x += o * a, r.y += o * i * .12, r.y < -80 && (r.y = -80), r.y > e.height * .55 && (r.y = e.height * .55), r.x - 140 * r.scale > e.width && (r.x = -160 * r.scale), r.x + 180 * r.scale < 0 && (r.x = e.width + 40 * r.scale), e.ctx.drawImage(r.sprite, r.x + r.ox, r.y + r.oy);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Xe(e) {
|
|
520
520
|
let t = e.fogSprite;
|
|
521
521
|
if (!t || e.state.fogBanks.length === 0) return;
|
|
522
522
|
let { canvas: n, baseR: r } = t, i = e.windMotion.fog, { intensity: a, angle: o, uy: s } = e.windField, c = -Math.cos(o);
|
|
@@ -525,27 +525,27 @@ function Je(e) {
|
|
|
525
525
|
t.x += o * c, t.y += o * s * .1, t.y < e.height * .02 && (t.y = e.height * .02), t.y > e.height * .95 && (t.y = e.height * .95), c < 0 && t.x + t.rw < 0 && (t.x = e.width + t.rw), c > 0 && t.x - t.rw > e.width && (t.x = -t.rw), e.ctx.save(), e.ctx.translate(t.x, t.y), e.ctx.scale(t.rw / r, t.rh / r), e.ctx.globalAlpha = t.alpha, e.ctx.drawImage(n, -r, -r), e.ctx.restore();
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Ze(e) {
|
|
529
529
|
if (e.cfg.haze <= 0) return;
|
|
530
530
|
let t = e.activeWeather === "smog" ? "177, 164, 135" : "220, 226, 232";
|
|
531
531
|
e.activeNight && (t = e.activeWeather === "smog" ? "82, 74, 54" : "116, 128, 145"), e.ctx.fillStyle = `rgba(${t}, ${e.cfg.haze})`, e.ctx.fillRect(0, 0, e.width, e.height);
|
|
532
532
|
}
|
|
533
533
|
//#endregion
|
|
534
534
|
//#region src/components/weatherBackground/lightning.ts
|
|
535
|
-
function
|
|
535
|
+
function Qe(e, t, n, r, i, a) {
|
|
536
536
|
if (a <= 0) return [[e, t], [n, r]];
|
|
537
|
-
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c =
|
|
537
|
+
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c = Qe(e, t, o, s, i * .55, a - 1), l = Qe(o, s, n, r, i * .55, a - 1);
|
|
538
538
|
return [...c.slice(0, -1), ...l];
|
|
539
539
|
}
|
|
540
540
|
//#endregion
|
|
541
541
|
//#region src/components/weatherBackground/scene/draw-effects.ts
|
|
542
|
-
function
|
|
542
|
+
function $e(e) {
|
|
543
543
|
if (e.state.windStreaks.length === 0) return;
|
|
544
544
|
let t = e.windMotion.streak, n = e.windMotion.streakVisibility;
|
|
545
545
|
if (n <= .02) return;
|
|
546
546
|
let r = e.state.t;
|
|
547
547
|
for (let i of e.state.windStreaks) {
|
|
548
|
-
let a =
|
|
548
|
+
let a = $(r + i.phase * 18, e.windMotion, i.x, i.y), o = a.intensity * (.55 + .45 * e.windField.intensity), s = a.angle * .65 + e.windField.angle * .35, c = -1 * Math.cos(s), l = Math.sin(s), u = i.speed * t * o;
|
|
549
549
|
i.x += u * c, i.y += u * l * .45, i.wave += .03 + o * .025, (i.x < -i.length - 40 || i.x > e.width + i.length + 40) && (i.x = c < 0 ? e.width + i.length + Math.random() * e.width * .25 : -i.length - Math.random() * e.width * .25, i.y = Math.random() * e.height), i.y < -20 && (i.y = e.height + 10), i.y > e.height + 20 && (i.y = -10);
|
|
550
550
|
let d = 5 + o * 5, f = Math.sin(i.wave) * d, p = i.length * (.85 + o * .2), m = i.x + c * p, h = i.y + l * p * .45, g = i.alpha * n * Math.min(1.35, .55 + o * .55);
|
|
551
551
|
if (e.ctx.beginPath(), e.ctx.moveTo(i.x, i.y), e.ctx.bezierCurveTo(i.x + c * p * .3, i.y + l * p * .3 * .45 + f, i.x + c * p * .7, i.y + l * p * .7 * .45 - f, m, h), e.ctx.strokeStyle = `rgba(235, 244, 250, ${g})`, e.ctx.lineWidth = i.width * (.85 + o * .2), e.ctx.lineCap = "round", e.ctx.stroke(), i.length > 70 && n > .45 && o > .7) {
|
|
@@ -554,12 +554,12 @@ function Ze(e) {
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function et(e) {
|
|
558
558
|
if (e.cfg.lightning) {
|
|
559
559
|
if (e.state.t >= e.state.nextStrike) {
|
|
560
560
|
e.state.nextStrike = e.state.t + 150 + Math.random() * 300, e.state.flashAlpha = .5, e.state.boltLife = 9;
|
|
561
561
|
let t = e.width * (.15 + Math.random() * .7);
|
|
562
|
-
e.state.boltPoints =
|
|
562
|
+
e.state.boltPoints = Qe(t, e.height * .12, t + (Math.random() - .5) * e.width * .2, e.height * .92, 60, 6);
|
|
563
563
|
}
|
|
564
564
|
if (e.state.boltLife > 0) {
|
|
565
565
|
--e.state.boltLife;
|
|
@@ -571,7 +571,7 @@ function Qe(e) {
|
|
|
571
571
|
}
|
|
572
572
|
//#endregion
|
|
573
573
|
//#region src/components/weatherBackground/sprites/hail.ts
|
|
574
|
-
var
|
|
574
|
+
var tt = 3.2, nt = (e) => {
|
|
575
575
|
let t = Math.ceil(e * 2.8 + 4), n = document.createElement("canvas");
|
|
576
576
|
n.width = t, n.height = t;
|
|
577
577
|
let r = n.getContext("2d"), i = t / 2, a = t / 2, o = 9 + Math.floor(Math.random() * 5), s = Array.from({ length: o }, (t, n) => {
|
|
@@ -604,10 +604,10 @@ var $e = 3.2, et = (e) => {
|
|
|
604
604
|
r.beginPath(), r.arc(n, o, e * (.1 + Math.random() * .08), 0, Math.PI * 2), r.fillStyle = "rgba(255, 255, 255, 0.55)", r.fill();
|
|
605
605
|
}
|
|
606
606
|
return r.beginPath(), r.ellipse(i - e * .34, a - e * .36, e * .24, e * .17, -.35, 0, Math.PI * 2), r.fillStyle = "rgba(255, 255, 255, 0.78)", r.fill(), n;
|
|
607
|
-
},
|
|
607
|
+
}, rt = (e = 16) => Array.from({ length: e }, () => nt(tt)), it = (e) => e[Math.floor(Math.random() * e.length)], at = (e, t, n, r, i = !0, a, o = 1) => {
|
|
608
608
|
let s = a?.min ?? 1.4, c = a?.max ?? 4.8;
|
|
609
|
-
e.r = s + Math.random() ** 1.35 * (c - s), e.x = Math.random() * (t + 260) - 130 + (Math.random() - .5) * 40, e.y = i ? -e.r - Math.random() * n * .55 : Math.random() * n, e.vx = (-1.2 - Math.random() * 4.8 + (Math.random() - .5) * 1.2) * o, e.vy = (5.5 + Math.random() * 11) * o, e.bounces = 0, e.opacity = .45 + Math.random() * .55, e.delay = Math.floor(Math.random() * (i ? 110 : 45)), e.gravity = (.11 + Math.random() * .14) * (.9 + o * .1), e.phase = Math.random() * Math.PI * 2, e.gust = (Math.random() - .5) * 1.4, e.maxBounces = +(Math.random() < .62), e.sprite =
|
|
610
|
-
},
|
|
609
|
+
e.r = s + Math.random() ** 1.35 * (c - s), e.x = Math.random() * (t + 260) - 130 + (Math.random() - .5) * 40, e.y = i ? -e.r - Math.random() * n * .55 : Math.random() * n, e.vx = (-1.2 - Math.random() * 4.8 + (Math.random() - .5) * 1.2) * o, e.vy = (5.5 + Math.random() * 11) * o, e.bounces = 0, e.opacity = .45 + Math.random() * .55, e.delay = Math.floor(Math.random() * (i ? 110 : 45)), e.gravity = (.11 + Math.random() * .14) * (.9 + o * .1), e.phase = Math.random() * Math.PI * 2, e.gust = (Math.random() - .5) * 1.4, e.maxBounces = +(Math.random() < .62), e.sprite = it(r), e.drawSize = e.r * 2.8 + 4, e.rotation = Math.random() * Math.PI * 2, e.rotationSpeed = (Math.random() - .5) * .06;
|
|
610
|
+
}, ot = (e, t, n, r, i = 1) => {
|
|
611
611
|
let a = {
|
|
612
612
|
x: 0,
|
|
613
613
|
y: 0,
|
|
@@ -626,11 +626,11 @@ var $e = 3.2, et = (e) => {
|
|
|
626
626
|
rotation: 0,
|
|
627
627
|
rotationSpeed: 0
|
|
628
628
|
};
|
|
629
|
-
return
|
|
629
|
+
return at(a, e, t, n, Math.random() < .72, r, i), a;
|
|
630
630
|
};
|
|
631
631
|
//#endregion
|
|
632
632
|
//#region src/components/weatherBackground/scene/draw-precipitation.ts
|
|
633
|
-
function
|
|
633
|
+
function st(e) {
|
|
634
634
|
if (!e.cfg.rain) return;
|
|
635
635
|
let { alpha: t, splash: n } = e.cfg.rain, r = e.cfg.rain.wind * e.windMotion.rain, { intensity: i, angle: a, uy: o } = e.windField, s = r * i * Math.cos(a), c = Math.abs(r) * i * o * .35;
|
|
636
636
|
e.ctx.strokeStyle = `rgba(214, 228, 240, ${t})`, e.ctx.lineWidth = 1.2, e.ctx.beginPath();
|
|
@@ -652,7 +652,7 @@ function at(e) {
|
|
|
652
652
|
e.ctx.beginPath(), e.ctx.ellipse(n.x, e.height - 3, n.r, n.r * .35, 0, Math.PI, Math.PI * 2), e.ctx.strokeStyle = `rgba(214, 228, 240, ${n.alpha})`, e.ctx.lineWidth = 1, e.ctx.stroke();
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function ct(e) {
|
|
656
656
|
let t = e.windMotion.snowDrift, { intensity: n, angle: r, uy: i } = e.windField, a = t * n * Math.cos(r), o = Math.abs(t) * n * i * .4;
|
|
657
657
|
for (let t of e.state.flakes) {
|
|
658
658
|
t.y += t.speed + o, t.x += Math.sin(e.state.t * .02 + t.phase) * (.3 + t.size * .08) + t.drift + a, t.rotation += t.rotationSpeed, t.y - t.drawSize > e.height && (t.y = -t.drawSize, t.x = Math.random() * e.width, t.phase = Math.random() * Math.PI * 2, t.drift = (Math.random() - .5) * .4, t.opacity = .55 + Math.random() * .45), t.x > e.width + 20 && (t.x = -20), t.x < -20 && (t.x = e.width + 20);
|
|
@@ -660,7 +660,7 @@ function ot(e) {
|
|
|
660
660
|
e.ctx.save(), e.ctx.globalAlpha = t.opacity, e.ctx.translate(t.x, t.y), e.ctx.rotate(t.rotation), e.ctx.drawImage(t.sprite, -n, -n, t.drawSize, t.drawSize), e.ctx.restore();
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function lt(e) {
|
|
664
664
|
if (e.state.hailstones.length === 0) return;
|
|
665
665
|
let t = e.state.hailPool, n = e.windMotion.hail, r = e.state.t, i = e.windField;
|
|
666
666
|
for (let a of e.state.hailstones) {
|
|
@@ -668,10 +668,10 @@ function st(e) {
|
|
|
668
668
|
--a.delay;
|
|
669
669
|
continue;
|
|
670
670
|
}
|
|
671
|
-
let o =
|
|
671
|
+
let o = $(r + a.phase * 12, e.windMotion, a.x, a.y), s = o.intensity * (.4 + .6 * i.intensity), c = o.angle * .5 + i.angle * .5, l = e.windMotion.snowDrift * .45 * s * Math.cos(c), u = Math.abs(e.windMotion.snowDrift) * s * Math.sin(c) * .2, d = a.x, f = a.y;
|
|
672
672
|
if (a.vy += a.gravity + u * .02, a.vx += a.gust * .004 * n * s + l + (Math.random() - .5) * .08 * n * s, a.x += a.vx + Math.sin(r * .028 + a.phase) * .35, a.y += a.vy, e.ctx.beginPath(), e.ctx.moveTo(d, f), e.ctx.lineTo(a.x, a.y), e.ctx.strokeStyle = `rgba(225, 239, 250, ${a.opacity * .18})`, e.ctx.lineWidth = a.r * .35, e.ctx.stroke(), a.y + a.r >= e.height) if (a.bounces < a.maxBounces) a.y = e.height - a.r, a.vy *= -(.22 + Math.random() * .28), a.vx = a.vx * (.55 + Math.random() * .25) + (Math.random() - .5) * 1.6, a.bounces += 1;
|
|
673
673
|
else {
|
|
674
|
-
|
|
674
|
+
at(a, e.width, e.height, t, !0, e.hailSpec ? {
|
|
675
675
|
min: e.hailSpec.sizeMin,
|
|
676
676
|
max: e.hailSpec.sizeMax
|
|
677
677
|
} : void 0, e.hailSpec?.speedMul ?? 1);
|
|
@@ -683,10 +683,10 @@ function st(e) {
|
|
|
683
683
|
}
|
|
684
684
|
//#endregion
|
|
685
685
|
//#region src/components/weatherBackground/scene/draw-sky.ts
|
|
686
|
-
function
|
|
686
|
+
function ut(e) {
|
|
687
687
|
e.ctx.fillStyle = e.skyGradient, e.ctx.fillRect(0, 0, e.width, e.height);
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function dt(e) {
|
|
690
690
|
if (e.state.stars.length === 0) return;
|
|
691
691
|
let t = 1;
|
|
692
692
|
if (e.dayCycle) {
|
|
@@ -698,25 +698,25 @@ function lt(e) {
|
|
|
698
698
|
e.ctx.beginPath(), e.ctx.arc(n.x, n.y, n.r, 0, Math.PI * 2), e.ctx.fillStyle = `rgba(226, 235, 255, ${r * t})`, e.ctx.fill();
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function ft(e) {
|
|
702
702
|
let t = e.celestial;
|
|
703
703
|
if (!t) return;
|
|
704
|
-
let { ctx: n, sunX: r, sunY: i, state: a } = e, o = 1 + Math.sin(a.t * t.breathSpeed) * t.breathAmp, s = e.dayCycle ?
|
|
704
|
+
let { ctx: n, sunX: r, sunY: i, state: a } = e, o = 1 + Math.sin(a.t * t.breathSpeed) * t.breathAmp, s = e.dayCycle ? E(e.dayCycle) : {
|
|
705
705
|
scale: 1,
|
|
706
706
|
alpha: 1
|
|
707
707
|
}, c = t.half * o * s.scale, l = c * 2;
|
|
708
708
|
n.save(), n.globalAlpha = s.alpha, n.drawImage(t.canvas, r - c, i - c, l, l), n.restore();
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function pt(e) {
|
|
711
711
|
if (e.activeNight) {
|
|
712
|
-
|
|
712
|
+
dt(e), ft(e);
|
|
713
713
|
return;
|
|
714
714
|
}
|
|
715
|
-
|
|
715
|
+
ft(e);
|
|
716
716
|
}
|
|
717
717
|
//#endregion
|
|
718
718
|
//#region src/components/weatherBackground/configs.ts
|
|
719
|
-
var
|
|
719
|
+
var mt = {
|
|
720
720
|
sunny: {
|
|
721
721
|
sky: ["#4a9fe0", "#c8e8fb"],
|
|
722
722
|
sun: "full",
|
|
@@ -1048,7 +1048,7 @@ var ft = {
|
|
|
1048
1048
|
snowCount: 160,
|
|
1049
1049
|
lightning: !1
|
|
1050
1050
|
}
|
|
1051
|
-
},
|
|
1051
|
+
}, ht = {
|
|
1052
1052
|
sunny: {
|
|
1053
1053
|
sky: ["#0b1a33", "#27476e"],
|
|
1054
1054
|
stars: 110
|
|
@@ -1117,14 +1117,14 @@ var ft = {
|
|
|
1117
1117
|
sky: ["#101a26", "#2e3d4d"],
|
|
1118
1118
|
stars: 30
|
|
1119
1119
|
}
|
|
1120
|
-
},
|
|
1120
|
+
}, gt = ([e, t, n]) => [
|
|
1121
1121
|
Math.round(e * .3 + 18),
|
|
1122
1122
|
Math.round(t * .3 + 24),
|
|
1123
1123
|
Math.round(n * .3 + 42)
|
|
1124
1124
|
];
|
|
1125
1125
|
//#endregion
|
|
1126
1126
|
//#region src/components/weatherBackground/sprites/cloud.ts
|
|
1127
|
-
function
|
|
1127
|
+
function _t(e, t, n, r) {
|
|
1128
1128
|
let [i, a, o] = n, s = Infinity, c = Infinity, l = -Infinity, u = -Infinity;
|
|
1129
1129
|
for (let n of t) {
|
|
1130
1130
|
let t = n.dx * e, r = n.dy * e, i = n.r * e;
|
|
@@ -1143,12 +1143,12 @@ function ht(e, t, n, r) {
|
|
|
1143
1143
|
oy: f
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function vt(e, t, n, r, i) {
|
|
1147
1147
|
let a = .7 + Math.random() * .9, o = 4 + Math.floor(Math.random() * 3), s = Array.from({ length: o }, (e, t) => ({
|
|
1148
1148
|
dx: (t - o / 2) * 26 + (Math.random() - .5) * 14,
|
|
1149
1149
|
dy: (Math.random() - .5) * 14,
|
|
1150
1150
|
r: 22 + Math.random() * 20
|
|
1151
|
-
})), { sprite: c, ox: l, oy: u } =
|
|
1151
|
+
})), { sprite: c, ox: l, oy: u } = _t(a, s, r, i);
|
|
1152
1152
|
return {
|
|
1153
1153
|
x: Math.random() * (e + 240) - 120,
|
|
1154
1154
|
y: t * .06 + Math.random() * t * n,
|
|
@@ -1160,7 +1160,7 @@ function gt(e, t, n, r, i) {
|
|
|
1160
1160
|
oy: u
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function yt(e, t = 120) {
|
|
1164
1164
|
let n = t * 2, r = document.createElement("canvas");
|
|
1165
1165
|
r.width = n, r.height = n;
|
|
1166
1166
|
let i = r.getContext("2d"), a = i.createRadialGradient(t, t, 0, t, t, t);
|
|
@@ -1171,7 +1171,7 @@ function _t(e, t = 120) {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
//#endregion
|
|
1173
1173
|
//#region src/components/weatherBackground/sprites/celestial.ts
|
|
1174
|
-
function
|
|
1174
|
+
function bt(e, t) {
|
|
1175
1175
|
let n = e.sun;
|
|
1176
1176
|
if (n === "none") return null;
|
|
1177
1177
|
let r = n === "full" ? 1 : n === "soft" ? .62 : .32, i = t * (n === "full" ? .72 : n === "soft" ? .62 : .5), a = t * (n === "full" ? 7.2 : n === "soft" ? 5.2 : 3.6), o = a;
|
|
@@ -1199,7 +1199,7 @@ function vt(e, t) {
|
|
|
1199
1199
|
breathAmp: .018
|
|
1200
1200
|
};
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function xt(e, t, n) {
|
|
1203
1203
|
if (e.sun === "none") return null;
|
|
1204
1204
|
let r = t * .82, i = e.sun === "dim", a = i ? .45 : 1, o = r * (i ? 4.2 : 6.2), s = Math.ceil(Math.max(o, r * 2.6, r * 1.35) + 2), c = s * 2, l = document.createElement("canvas");
|
|
1205
1205
|
l.width = c, l.height = c;
|
|
@@ -1253,12 +1253,12 @@ function yt(e, t, n) {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
//#endregion
|
|
1255
1255
|
//#region src/components/weatherBackground/sprites/snow.ts
|
|
1256
|
-
var
|
|
1256
|
+
var St = (e) => {
|
|
1257
1257
|
let t = Math.ceil(e * 2 + 4), n = document.createElement("canvas");
|
|
1258
1258
|
n.width = t, n.height = t;
|
|
1259
1259
|
let r = n.getContext("2d"), i = r.createRadialGradient(t / 2, t / 2, 0, t / 2, t / 2, e + 1);
|
|
1260
1260
|
return i.addColorStop(0, "rgba(255, 255, 255, 1)"), i.addColorStop(.6, "rgba(255, 255, 255, 0.85)"), i.addColorStop(1, "rgba(255, 255, 255, 0)"), r.fillStyle = i, r.fillRect(0, 0, t, t), n;
|
|
1261
|
-
},
|
|
1261
|
+
}, Ct = (e) => {
|
|
1262
1262
|
let t = Math.ceil(e * 2 + 6), n = document.createElement("canvas");
|
|
1263
1263
|
n.width = t, n.height = t;
|
|
1264
1264
|
let r = n.getContext("2d");
|
|
@@ -1285,22 +1285,22 @@ var bt = (e) => {
|
|
|
1285
1285
|
r.closePath(), r.stroke();
|
|
1286
1286
|
}
|
|
1287
1287
|
return n;
|
|
1288
|
-
},
|
|
1288
|
+
}, wt = () => ({
|
|
1289
1289
|
dots: [
|
|
1290
1290
|
1.2,
|
|
1291
1291
|
1.6,
|
|
1292
1292
|
2,
|
|
1293
1293
|
2.3
|
|
1294
|
-
].map((e) =>
|
|
1294
|
+
].map((e) => St(e)),
|
|
1295
1295
|
crystals: [
|
|
1296
1296
|
2.6,
|
|
1297
1297
|
3.2,
|
|
1298
1298
|
3.8,
|
|
1299
1299
|
4.4,
|
|
1300
1300
|
5
|
|
1301
|
-
].map((e) =>
|
|
1302
|
-
}),
|
|
1303
|
-
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o =
|
|
1301
|
+
].map((e) => Ct(e * 2.4))
|
|
1302
|
+
}), Tt = (e) => e[Math.floor(Math.random() * e.length)], Et = (e, t, n, r) => {
|
|
1303
|
+
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o = Tt(a ? n.crystals : n.dots), s = a ? i * 4.8 + 6 : i * 2 + 4;
|
|
1304
1304
|
return {
|
|
1305
1305
|
x: Math.random() * e,
|
|
1306
1306
|
y: r ?? Math.random() * t,
|
|
@@ -1314,25 +1314,25 @@ var bt = (e) => {
|
|
|
1314
1314
|
sprite: o,
|
|
1315
1315
|
drawSize: s
|
|
1316
1316
|
};
|
|
1317
|
-
},
|
|
1318
|
-
function
|
|
1319
|
-
let { ctx: t, width: n, height: r, activeWeather: i, dayCycleTimes: a = null, sceneTimeMs: o, liveClock: s = !1, windMotion: c, rainLevel: l = 5, snowLevel: u = 5, hailLevel: d = 2, fogLevel: f = 2, smogLevel: p = 2 } = e, m =
|
|
1317
|
+
}, Dt = (e, t) => t ? e === "smog" ? "96, 88, 66" : "138, 150, 168" : e === "smog" ? "168, 155, 126" : "226, 232, 238";
|
|
1318
|
+
function Ot(e) {
|
|
1319
|
+
let { ctx: t, width: n, height: r, activeWeather: i, dayCycleTimes: a = null, sceneTimeMs: o, liveClock: s = !1, windMotion: c, rainLevel: l = 5, snowLevel: u = 5, hailLevel: d = 2, fogLevel: f = 2, smogLevel: p = 2 } = e, m = mt[i], h = (() => {
|
|
1320
1320
|
let e = m;
|
|
1321
|
-
return
|
|
1321
|
+
return de(i) && e.rain && (e = {
|
|
1322
1322
|
...e,
|
|
1323
|
-
rain:
|
|
1324
|
-
}),
|
|
1323
|
+
rain: ge(e.rain, l)
|
|
1324
|
+
}), fe(i) && (e = {
|
|
1325
1325
|
...e,
|
|
1326
|
-
snowCount:
|
|
1326
|
+
snowCount: _e(u),
|
|
1327
1327
|
fogBanks: u >= 7 ? Math.max(e.fogBanks, 3) : e.fogBanks,
|
|
1328
1328
|
haze: u >= 7 ? Math.max(e.haze, .12) : e.haze
|
|
1329
|
-
}),
|
|
1330
|
-
})(), g =
|
|
1331
|
-
if (
|
|
1332
|
-
let e =
|
|
1333
|
-
|
|
1329
|
+
}), j(i) && (e = M(e, f)), Ce(i) && (e = we(e, p)), e;
|
|
1330
|
+
})(), g = ht[i], _ = a ?? null, v = _ ? b(s ? Date.now() : o, _) : null, y = v ? !v.isDay : !1, S = v ? ee(h.sky, g.sky, v) : y ? g.sky : h.sky, C = y ? gt(h.cloudColor) : h.cloudColor, w = Math.min(n, r) * .09, T = n * .72, E = r * .26;
|
|
1331
|
+
if (v) {
|
|
1332
|
+
let e = x(n, r, v.arcProgress);
|
|
1333
|
+
T = e.x, E = e.y;
|
|
1334
1334
|
}
|
|
1335
|
-
let
|
|
1335
|
+
let D = te(t, r, S), O = [
|
|
1336
1336
|
{
|
|
1337
1337
|
dx: -.32,
|
|
1338
1338
|
dy: .08,
|
|
@@ -1353,29 +1353,29 @@ function Et(e) {
|
|
|
1353
1353
|
dy: .24,
|
|
1354
1354
|
r: .07
|
|
1355
1355
|
}
|
|
1356
|
-
],
|
|
1356
|
+
], k = bt(h, w), A = xt(h, w, O), P = y ? A : k, F = y || _ != null ? Array.from({ length: g.stars }, () => ({
|
|
1357
1357
|
x: Math.random() * n,
|
|
1358
1358
|
y: Math.random() * r * .72,
|
|
1359
1359
|
r: .4 + Math.random() * 1.1,
|
|
1360
1360
|
phase: Math.random() * Math.PI * 2,
|
|
1361
1361
|
speed: .015 + Math.random() * .035
|
|
1362
|
-
})) : [],
|
|
1362
|
+
})) : [], I = Array.from({ length: h.cloudCount }, () => vt(n, r, h.cloudSpread, C, h.cloudAlpha)), L = h.rain ? Array.from({ length: h.rain.count }, () => ({
|
|
1363
1363
|
x: Math.random() * (n + 160) - 80,
|
|
1364
1364
|
y: Math.random() * r,
|
|
1365
1365
|
len: 8 + Math.random() * 10,
|
|
1366
1366
|
speed: h.rain.speed * (.75 + Math.random() * .5)
|
|
1367
|
-
})) : [],
|
|
1367
|
+
})) : [], R = [], z = Array.from({ length: h.fogBanks }, (e, t) => ({
|
|
1368
1368
|
x: Math.random() * n,
|
|
1369
1369
|
y: t / Math.max(h.fogBanks - 1, 1) * r * .9 + r * .05,
|
|
1370
1370
|
rw: n * (.25 + Math.random() * .3),
|
|
1371
1371
|
rh: r * (.08 + Math.random() * .08),
|
|
1372
1372
|
speed: (.1 + Math.random() * .25) * (t % 2 == 0 ? 1 : -1),
|
|
1373
|
-
alpha: (.1 + Math.random() * .1) * (
|
|
1374
|
-
})),
|
|
1373
|
+
alpha: (.1 + Math.random() * .1) * (j(i) ? N(f) : Ce(i) ? Te(p) : 1)
|
|
1374
|
+
})), V = h.fogBanks > 0 ? yt(Dt(i, y)) : null, H = h.snowCount > 0 ? wt() : null, U = H == null ? [] : Array.from({ length: h.snowCount }, () => Et(n, r, H)), W = B(i) ? ne(d) : null, G = W == null ? null : rt(), K = G != null && W != null ? Array.from({ length: W.count }, () => ot(n, r, G, {
|
|
1375
1375
|
min: W.sizeMin,
|
|
1376
1376
|
max: W.sizeMax
|
|
1377
|
-
}, W.speedMul)) : [],
|
|
1378
|
-
let { count: e } =
|
|
1377
|
+
}, W.speedMul)) : [], q = (() => {
|
|
1378
|
+
let { count: e } = We(c.visualLevel);
|
|
1379
1379
|
return e <= 0 ? [] : Array.from({ length: e }, () => ({
|
|
1380
1380
|
x: Math.random() * n,
|
|
1381
1381
|
y: Math.random() * r,
|
|
@@ -1386,162 +1386,172 @@ function Et(e) {
|
|
|
1386
1386
|
width: .5 + Math.random() * 1.1,
|
|
1387
1387
|
phase: Math.random() * Math.PI * 2
|
|
1388
1388
|
}));
|
|
1389
|
-
})(),
|
|
1389
|
+
})(), J = [], re = 120 + Math.random() * 240;
|
|
1390
1390
|
return {
|
|
1391
1391
|
sky: S,
|
|
1392
|
-
cloudRgb:
|
|
1392
|
+
cloudRgb: C,
|
|
1393
1393
|
cfg: h,
|
|
1394
|
-
sunX:
|
|
1395
|
-
sunY:
|
|
1396
|
-
sunR:
|
|
1397
|
-
skyGradient:
|
|
1398
|
-
celestial:
|
|
1399
|
-
sunSprite:
|
|
1400
|
-
moonSprite:
|
|
1401
|
-
fogSprite:
|
|
1402
|
-
dayCycleTimes:
|
|
1403
|
-
dayCycle:
|
|
1394
|
+
sunX: T,
|
|
1395
|
+
sunY: E,
|
|
1396
|
+
sunR: w,
|
|
1397
|
+
skyGradient: D,
|
|
1398
|
+
celestial: P,
|
|
1399
|
+
sunSprite: k,
|
|
1400
|
+
moonSprite: A,
|
|
1401
|
+
fogSprite: V,
|
|
1402
|
+
dayCycleTimes: _,
|
|
1403
|
+
dayCycle: v,
|
|
1404
1404
|
sceneTimeMs: o,
|
|
1405
1405
|
liveClock: s,
|
|
1406
1406
|
hailSpec: W,
|
|
1407
1407
|
state: {
|
|
1408
|
-
stars:
|
|
1409
|
-
moonCraters:
|
|
1410
|
-
clouds:
|
|
1411
|
-
drops:
|
|
1412
|
-
splashes:
|
|
1413
|
-
fogBanks:
|
|
1408
|
+
stars: F,
|
|
1409
|
+
moonCraters: O,
|
|
1410
|
+
clouds: I,
|
|
1411
|
+
drops: L,
|
|
1412
|
+
splashes: R,
|
|
1413
|
+
fogBanks: z,
|
|
1414
1414
|
flakes: U,
|
|
1415
|
-
hailstones:
|
|
1415
|
+
hailstones: K,
|
|
1416
1416
|
hailPool: G ?? [],
|
|
1417
|
-
windStreaks:
|
|
1417
|
+
windStreaks: q,
|
|
1418
1418
|
t: 0,
|
|
1419
1419
|
flashAlpha: 0,
|
|
1420
1420
|
boltLife: 0,
|
|
1421
|
-
boltPoints:
|
|
1422
|
-
nextStrike:
|
|
1421
|
+
boltPoints: J,
|
|
1422
|
+
nextStrike: re
|
|
1423
1423
|
}
|
|
1424
1424
|
};
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function kt(e, t) {
|
|
1427
1427
|
if (!e.dayCycleTimes) return;
|
|
1428
|
-
let n =
|
|
1429
|
-
e.dayCycle = n, e.activeNight = !n.isDay, e.sky = i, e.skyGradient =
|
|
1428
|
+
let n = b(e.liveClock ? t ?? Date.now() : e.sceneTimeMs, e.dayCycleTimes), r = ht[e.activeWeather], i = ee(e.cfg.sky, r.sky, n), a = x(e.width, e.height, n.arcProgress);
|
|
1429
|
+
e.dayCycle = n, e.activeNight = !n.isDay, e.sky = i, e.skyGradient = te(e.ctx, e.height, i), e.sunX = a.x, e.sunY = a.y, e.celestial = n.isDay ? e.sunSprite : e.moonSprite;
|
|
1430
1430
|
}
|
|
1431
1431
|
//#endregion
|
|
1432
1432
|
//#region src/components/weatherBackground/scene/create-weather-scene.ts
|
|
1433
|
-
function
|
|
1434
|
-
t && (e.state.t += 1), e.windField =
|
|
1433
|
+
function At(e, t) {
|
|
1434
|
+
t && (e.state.t += 1), e.windField = $(e.state.t, e.windMotion), e.dayCycleTimes && kt(e, e.liveClock ? Date.now() : e.sceneTimeMs), ut(e), pt(e), Ye(e), Xe(e), Ze(e), st(e), ct(e), lt(e), $e(e), et(e);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
let { ctx: t, width: n, height: r, activeWeather:
|
|
1436
|
+
function jt(e) {
|
|
1437
|
+
let { ctx: t, width: n, height: r, activeWeather: s, activeNight: c, windMotion: l } = e, u = Ot(e), d = {
|
|
1438
1438
|
ctx: t,
|
|
1439
1439
|
width: n,
|
|
1440
1440
|
height: r,
|
|
1441
|
-
activeWeather:
|
|
1442
|
-
activeNight:
|
|
1443
|
-
windMotion:
|
|
1444
|
-
windField:
|
|
1445
|
-
...
|
|
1441
|
+
activeWeather: s,
|
|
1442
|
+
activeNight: u.dayCycle ? !u.dayCycle.isDay : c,
|
|
1443
|
+
windMotion: l,
|
|
1444
|
+
windField: $(0, l),
|
|
1445
|
+
...u
|
|
1446
1446
|
};
|
|
1447
|
-
|
|
1448
|
-
let
|
|
1449
|
-
|
|
1450
|
-
}),
|
|
1451
|
-
|
|
1447
|
+
d.dayCycleTimes && kt(d, d.liveClock ? Date.now() : d.sceneTimeMs);
|
|
1448
|
+
let f = document.hidden, p = o(), m = a((e) => {
|
|
1449
|
+
f = e;
|
|
1450
|
+
}), h = i((e) => {
|
|
1451
|
+
p = e;
|
|
1452
|
+
});
|
|
1453
|
+
if (p) return At(d, !1), () => {
|
|
1454
|
+
m(), h();
|
|
1455
|
+
};
|
|
1456
|
+
let g = 0, _ = () => {
|
|
1457
|
+
g = requestAnimationFrame(_), !f && (p || At(d, !0));
|
|
1452
1458
|
};
|
|
1453
|
-
return
|
|
1454
|
-
cancelAnimationFrame(
|
|
1459
|
+
return _(), () => {
|
|
1460
|
+
cancelAnimationFrame(g), m(), h();
|
|
1455
1461
|
};
|
|
1456
1462
|
}
|
|
1457
|
-
var
|
|
1463
|
+
var Mt = {
|
|
1458
1464
|
weatherBackground: "cos-weatherBackground-Mnm22",
|
|
1459
1465
|
canvas: "cos-canvas-nvqMt",
|
|
1460
1466
|
loadingOverlay: "cos-loadingOverlay-O58B7",
|
|
1461
1467
|
loadingSpinner: "cos-loadingSpinner-NQ9yG",
|
|
1462
1468
|
"weather-loading-spin": "cos-weather-loading-spin-IPFWZ"
|
|
1463
|
-
},
|
|
1464
|
-
let
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1469
|
+
}, Nt = ({ width: r, height: i, fill: a = !1, weather: o = "partlyCloudy", time: u = "14:00", live: d = !1, latitude: f, longitude: p, windLevel: m = 3, rainLevel: h = 5, snowLevel: g = 5, hailLevel: v = 2, fogLevel: x = 2, smogLevel: S = 2, onLiveWeather: C, loading: w = !1, ariaLabel: T, loadingText: ee = "天气加载中…" }) => {
|
|
1470
|
+
let { hostRef: te, width: E, height: D, hostStyle: O } = s({
|
|
1471
|
+
fill: a,
|
|
1472
|
+
width: r,
|
|
1473
|
+
height: i,
|
|
1474
|
+
defaultWidth: 800,
|
|
1475
|
+
defaultHeight: 450
|
|
1476
|
+
}), k = n(null), A = Fe(d, f != null && p != null ? {
|
|
1477
|
+
latitude: f,
|
|
1478
|
+
longitude: p
|
|
1479
|
+
} : void 0), j = Y(d && A.weather ? A.weather : o), M = d && A.rainLevel != null ? A.rainLevel : h, N = d && A.snowLevel != null ? A.snowLevel : g, P = d && A.fogLevel != null ? A.fogLevel : x, F = d && A.hailLevel != null ? A.hailLevel : v, I = d && A.smogLevel != null ? A.smogLevel : S, L = he(j, M, N), R = y(u), z = A.current?.sunrise ?? null, B = A.current?.sunset ?? null, ne = A.current?.windSpeed ?? null, V = t(() => d && z != null && B != null ? {
|
|
1480
|
+
sunrise: z,
|
|
1481
|
+
sunset: B
|
|
1482
|
+
} : _(R), [
|
|
1483
|
+
d,
|
|
1484
|
+
z,
|
|
1485
|
+
B,
|
|
1486
|
+
R
|
|
1487
|
+
]), H = Je({
|
|
1488
|
+
live: d,
|
|
1489
|
+
windLevel: m,
|
|
1490
|
+
liveWindKmh: ne
|
|
1491
|
+
}), U = t(() => qe(H), [H]), W = d && A.current ? !A.current.isDay : !b(R, V).isDay, G = w || d && (A.status === "locating" || A.status === "fetching"), K = n(C);
|
|
1480
1492
|
return e(() => {
|
|
1481
|
-
|
|
1493
|
+
K.current = C;
|
|
1482
1494
|
}), e(() => {
|
|
1483
|
-
|
|
1484
|
-
}, [
|
|
1485
|
-
let e =
|
|
1495
|
+
A.weather && K.current?.(Y(A.weather));
|
|
1496
|
+
}, [A.weather]), e(() => {
|
|
1497
|
+
let e = k.current;
|
|
1486
1498
|
if (!e) return;
|
|
1487
1499
|
let t = window.devicePixelRatio || 1;
|
|
1488
|
-
e.width =
|
|
1500
|
+
e.width = E * t, e.height = D * t;
|
|
1489
1501
|
let n = e.getContext("2d");
|
|
1490
|
-
if (n) return n.setTransform(t, 0, 0, t, 0, 0),
|
|
1502
|
+
if (n) return n.setTransform(t, 0, 0, t, 0, 0), jt({
|
|
1491
1503
|
ctx: n,
|
|
1492
|
-
width:
|
|
1493
|
-
height:
|
|
1494
|
-
activeWeather:
|
|
1495
|
-
activeNight:
|
|
1496
|
-
dayCycleTimes:
|
|
1497
|
-
sceneTimeMs:
|
|
1498
|
-
liveClock:
|
|
1499
|
-
windMotion:
|
|
1500
|
-
rainLevel:
|
|
1501
|
-
snowLevel:
|
|
1502
|
-
fogLevel:
|
|
1503
|
-
hailLevel:
|
|
1504
|
-
smogLevel:
|
|
1504
|
+
width: E,
|
|
1505
|
+
height: D,
|
|
1506
|
+
activeWeather: L,
|
|
1507
|
+
activeNight: W,
|
|
1508
|
+
dayCycleTimes: V,
|
|
1509
|
+
sceneTimeMs: R,
|
|
1510
|
+
liveClock: d,
|
|
1511
|
+
windMotion: U,
|
|
1512
|
+
rainLevel: M,
|
|
1513
|
+
snowLevel: N,
|
|
1514
|
+
fogLevel: P,
|
|
1515
|
+
hailLevel: F,
|
|
1516
|
+
smogLevel: I
|
|
1505
1517
|
});
|
|
1506
1518
|
}, [
|
|
1507
|
-
|
|
1508
|
-
|
|
1519
|
+
W,
|
|
1520
|
+
L,
|
|
1521
|
+
V,
|
|
1522
|
+
M,
|
|
1523
|
+
N,
|
|
1524
|
+
P,
|
|
1525
|
+
F,
|
|
1509
1526
|
I,
|
|
1510
|
-
E,
|
|
1511
1527
|
D,
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
width: r,
|
|
1524
|
-
height: i
|
|
1525
|
-
},
|
|
1526
|
-
children: [/* @__PURE__ */ a("canvas", {
|
|
1527
|
-
ref: C,
|
|
1528
|
-
className: $.canvas,
|
|
1528
|
+
d,
|
|
1529
|
+
R,
|
|
1530
|
+
E,
|
|
1531
|
+
U
|
|
1532
|
+
]), /* @__PURE__ */ l("div", {
|
|
1533
|
+
ref: te,
|
|
1534
|
+
className: Mt.weatherBackground,
|
|
1535
|
+
style: O,
|
|
1536
|
+
children: [/* @__PURE__ */ c("canvas", {
|
|
1537
|
+
ref: k,
|
|
1538
|
+
className: Mt.canvas,
|
|
1529
1539
|
style: {
|
|
1530
|
-
width:
|
|
1531
|
-
height:
|
|
1540
|
+
width: E,
|
|
1541
|
+
height: D
|
|
1532
1542
|
},
|
|
1533
1543
|
role: "img",
|
|
1534
|
-
"aria-label": `天气背景:${
|
|
1535
|
-
}),
|
|
1536
|
-
className:
|
|
1544
|
+
"aria-label": T ?? `天气背景:${j}${W ? "(夜间)" : ""},${U.level}级风`
|
|
1545
|
+
}), G && /* @__PURE__ */ l("div", {
|
|
1546
|
+
className: Mt.loadingOverlay,
|
|
1537
1547
|
role: "status",
|
|
1538
1548
|
"aria-live": "polite",
|
|
1539
|
-
children: [/* @__PURE__ */
|
|
1540
|
-
className:
|
|
1549
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1550
|
+
className: Mt.loadingSpinner,
|
|
1541
1551
|
"aria-hidden": !0
|
|
1542
|
-
}), /* @__PURE__ */
|
|
1552
|
+
}), /* @__PURE__ */ c("span", { children: ee })]
|
|
1543
1553
|
})]
|
|
1544
1554
|
});
|
|
1545
1555
|
};
|
|
1546
1556
|
//#endregion
|
|
1547
|
-
export {
|
|
1557
|
+
export { D as DEFAULT_FOG_LEVEL, I as DEFAULT_HAIL_LEVEL, W as DEFAULT_RAIN_LEVEL, be as DEFAULT_SMOG_LEVEL, G as DEFAULT_SNOW_LEVEL, Re as DEFAULT_WIND_LEVEL, O as FOG_LEVEL_LABELS, L as HAIL_LEVEL_LABELS, U as MAX_PRECIP_LEVEL, H as MIN_PRECIP_LEVEL, se as RAIN_LEVEL_LABELS, xe as SMOG_LEVEL_LABELS, ce as SNOW_LEVEL_LABELS, Nt as WeatherBackground, Nt as default, qe as buildWindMotion, k as clampFogLevel, R as clampHailLevel, K as clampPrecipLevel, Z as clampSmogLevel, N as fogBankAlphaScale, F as fogLevelFromVisibility, P as fogLevelFromWmo, A as formatFogLevel, z as formatHailLevel, Pe as formatLocalHm, oe as formatPrecipLevel, Se as formatSmogLevel, V as hailLevelFromWmo, ne as hailSpec, M as intensifyFogConfig, ge as intensifyRainConfig, we as intensifySmogConfig, _e as intensifySnowCount, le as isRainWeather, ue as isSnowWeather, Ke as kmhToWindLevel, Oe as mapWmoCodeToWeatherType, Y as normalizeWeatherType, J as precipBand, ae as precipLabel, pe as rainLevelFromWeather, ve as rainLevelFromWmo, he as resolveSceneWeather, $ as sampleWindField, Te as smogBankAlphaScale, Ee as smogLevelFromVisibility, me as snowLevelFromWeather, ye as snowLevelFromWmo, j as supportsFogLevel, B as supportsHailLevel, de as supportsRainLevel, Ce as supportsSmogLevel, fe as supportsSnowLevel, Fe as useLiveWeather, Le as useSunTimes, Be as visualWindLevel, Ge as windLevelToKmh, We as windStreakSpec };
|