earthnut 0.1.2 → 0.1.3
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/BackgroundRipple/index.cjs +1 -0
- package/BackgroundRipple/index.mjs +1 -0
- package/Layout/index.cjs +1 -0
- package/Layout/index.mjs +1 -0
- package/README.md +28 -0
- package/components/button/button.d.ts +5 -0
- package/components/button/index.d.ts +3 -0
- package/components/index.d.ts +3 -0
- package/components/layout/EnLayoutContent.d.ts +3 -0
- package/components/layout/content.d.ts +11 -0
- package/components/layout/footer.d.ts +16 -0
- package/components/layout/generate-class.d.ts +2 -0
- package/components/layout/get-value.d.ts +4 -0
- package/components/layout/header.d.ts +18 -0
- package/components/layout/index.d.ts +2 -0
- package/components/layout/layout.d.ts +50 -0
- package/components/layout/sideBar.d.ts +24 -0
- package/components/layout/types.d.ts +101 -0
- package/components/menu/index.d.ts +0 -0
- package/components/menu/menu.d.ts +0 -0
- package/components/ripples/RipplesEle.d.ts +35 -0
- package/components/ripples/index.d.ts +4 -0
- package/components/ripples/types.d.ts +11 -0
- package/components/ripples/useOptionUpdate.d.ts +5 -0
- package/customHooks/index.d.ts +5 -0
- package/customHooks/useAnimationFrame.d.ts +42 -0
- package/customHooks/useInputIsComposing.d.ts +46 -0
- package/customHooks/useRipples/buildBackground/create-background-color.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/create-linear-gradient.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +7 -0
- package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +18 -0
- package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +12 -0
- package/customHooks/useRipples/buildBackground/load-image.d.ts +13 -0
- package/customHooks/useRipples/buildBackground/run-side.d.ts +9 -0
- package/customHooks/useRipples/buildBackground/type.d.ts +31 -0
- package/customHooks/useRipples/buildBackground/utils/bind-image.d.ts +4 -0
- package/customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/create-image-by-src.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/utils/get-background-style.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/hide-css-background.d.ts +10 -0
- package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +7 -0
- package/customHooks/useRipples/callback/destroy.d.ts +3 -0
- package/customHooks/useRipples/callback/drop.d.ts +3 -0
- package/customHooks/useRipples/callback/fade.d.ts +3 -0
- package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
- package/customHooks/useRipples/callback/scale.d.ts +2 -0
- package/customHooks/useRipples/index.d.ts +40 -0
- package/customHooks/useRipples/init/index.d.ts +5 -0
- package/customHooks/useRipples/init/initEvent.d.ts +5 -0
- package/customHooks/useRipples/init/initShaders.d.ts +7 -0
- package/customHooks/useRipples/init/initTexture.d.ts +7 -0
- package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +3 -0
- package/customHooks/useRipples/render/draw.d.ts +7 -0
- package/customHooks/useRipples/render/drawQuad.d.ts +7 -0
- package/customHooks/useRipples/render/dropAtPointer.d.ts +7 -0
- package/customHooks/useRipples/render/index.d.ts +6 -0
- package/customHooks/useRipples/render/swapBufferIndices.d.ts +5 -0
- package/customHooks/useRipples/render/update.d.ts +5 -0
- package/customHooks/useRipples/rippersData/defaultData.d.ts +5 -0
- package/customHooks/useRipples/rippersData/fadeData.d.ts +43 -0
- package/customHooks/useRipples/rippersData/index.d.ts +40 -0
- package/customHooks/useRipples/rippersData/loadConfig.d.ts +19 -0
- package/customHooks/useRipples/rippersData/renderData.d.ts +74 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +81 -0
- package/customHooks/useRipples/rippersData/vertexSource.d.ts +28 -0
- package/customHooks/useRipples/ripple.html.d.ts +6 -0
- package/customHooks/useRipples/ripplesClass.d.ts +51 -0
- package/customHooks/useRipples/tools.d.ts +31 -0
- package/customHooks/useRipples/types.d.ts +198 -0
- package/customHooks/useTimeId.d.ts +46 -0
- package/dog.d.ts +2 -0
- package/index.cjs +1 -0
- package/index.d.ts +5 -0
- package/index.js.LICENSE.txt +79 -0
- package/index.mjs +1 -0
- package/package.json +5 -5
- package/styles/common.scss +444 -0
- package/useAnimationFrame/index.cjs +1 -0
- package/useAnimationFrame/index.mjs +1 -0
- package/useInputIsComposing/index.cjs +1 -0
- package/useInputIsComposing/index.mjs +1 -0
- package/useRipples/index.cjs +1 -0
- package/useRipples/index.mjs +1 -0
- package/useTimeId/index.cjs +1 -0
- package/useTimeId/index.mjs +1 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
@mixin light {
|
|
2
|
+
// 基色
|
|
3
|
+
--primary-white: #ffffff;
|
|
4
|
+
--primary-black: #1b1b1b;
|
|
5
|
+
--primary-dust: #6f6f6f;
|
|
6
|
+
--primary-red: #d30038;
|
|
7
|
+
--primary-green: #007936;
|
|
8
|
+
--primary-blue: #0069c2;
|
|
9
|
+
--primary-yellow: #746a00;
|
|
10
|
+
--primary-super-yellow: #ffff00;
|
|
11
|
+
// 文本色
|
|
12
|
+
--text-primary: #1b1b1b;
|
|
13
|
+
--text-secondary: #4e4e4e;
|
|
14
|
+
--text-invert: var(--primary-white); // 文本反转色
|
|
15
|
+
--text-muted: var(--primary-dust); // 温和文本色
|
|
16
|
+
// 链接文本色
|
|
17
|
+
--text-link: #0069c2;
|
|
18
|
+
--text-visited: #551a8b;
|
|
19
|
+
--text-hover: var(--primary-red);
|
|
20
|
+
--text-visited: #551a8b;
|
|
21
|
+
--text-active: #858585;
|
|
22
|
+
--text-inactive: #9e9e9ea6; // 无效链接色
|
|
23
|
+
// 背景色
|
|
24
|
+
--background-primary: var(--primary-white);
|
|
25
|
+
--background-tab-level-1: var(--primary-black);
|
|
26
|
+
--background-tab-level-2: var(--primary-dust);
|
|
27
|
+
--background-tab-transparent: #6666;
|
|
28
|
+
--table-border-color: #000;
|
|
29
|
+
--curriculum-shadow: 4px 4px 8px 0 #b3b3b32e, -4px 4px 8px 0 #b3b3b326;
|
|
30
|
+
--curriculum-shadow-landing-about-ul: 0 4px 10px 0 #e3642a0f, 0 -2px 4px 0 #b25c350f;
|
|
31
|
+
--box-shadow: 1px 1px 12px #6666;
|
|
32
|
+
--box-shadow-primary: 1px 1px 12px #6666;
|
|
33
|
+
--box-shadow-primary-small: 1px 1px 3px #6666;
|
|
34
|
+
--box-shadow-primary-large: 1px 1px 24px #6666;
|
|
35
|
+
color-scheme: light;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin dark {
|
|
39
|
+
// 基色
|
|
40
|
+
--primary-white: #ffffff;
|
|
41
|
+
--primary-black: #1b1b1b;
|
|
42
|
+
--primary-dust: #858585;
|
|
43
|
+
--primary-red: #ff97a0;
|
|
44
|
+
--primary-green: #00d061;
|
|
45
|
+
--primary-blue: #8cb4ff;
|
|
46
|
+
--primary-yellow: #c7b700;
|
|
47
|
+
// 文本色
|
|
48
|
+
--text-primary: #fff;
|
|
49
|
+
--text-secondary: #cdcdcd;
|
|
50
|
+
--text-invert: var(--primary-black); // 文本反转色
|
|
51
|
+
--text-muted: var(--primary-dust); // 温和文本色
|
|
52
|
+
// 普通链接文本色
|
|
53
|
+
--text-link: #8cb4ff;
|
|
54
|
+
--text-visited: #ffadff;
|
|
55
|
+
--text-hover: var(--primary-red);
|
|
56
|
+
--text-active: #858585;
|
|
57
|
+
--text-inactive: #cdcdcda6; // 无效链接色
|
|
58
|
+
// 背景色
|
|
59
|
+
--background-primary: var(--primary-black);
|
|
60
|
+
--background-tab-level-1: #666666;
|
|
61
|
+
--background-tab-level-2: var(--primary-dust);
|
|
62
|
+
--background-tab-transparent: #6666;
|
|
63
|
+
--table-border-color: #ff3663;
|
|
64
|
+
--box-shadow: 1px 1px 12px #6666;
|
|
65
|
+
--box-shadow-primary: 1px 1px 12px #6666;
|
|
66
|
+
--box-shadow-primary-small: 1px 1px 3px #6666;
|
|
67
|
+
--box-shadow-primary-large: 1px 1px 24px #6666;
|
|
68
|
+
color-scheme: dark;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:root {
|
|
72
|
+
@include light();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (prefers-color-scheme: light) {
|
|
76
|
+
:root:not(.en-light):not(.en-dark) {
|
|
77
|
+
@include light();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
@media (prefers-color-scheme: dark) {
|
|
81
|
+
:root:not(.en-light):not(.en-dark) {
|
|
82
|
+
@include dark();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.en-light {
|
|
87
|
+
@include light();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.en-dark {
|
|
91
|
+
@include dark();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.en-center {
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: 50%;
|
|
97
|
+
top: 50%;
|
|
98
|
+
transform: translate(-50%, -50%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 文本显示一行,超出点点点 */
|
|
102
|
+
.en-text-in-one-line {
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
word-break: break-all;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.en-text-in-one-line-hide {
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
text-overflow: clip;
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
word-break: break-all;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** 文本显示两行,超出点点点 */
|
|
117
|
+
.en-text-in-two-line {
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
text-overflow: ellipsis;
|
|
120
|
+
display: -webkit-box;
|
|
121
|
+
-webkit-line-clamp: 2;
|
|
122
|
+
line-clamp: 2;
|
|
123
|
+
-webkit-box-orient: vertical;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* 彩色字 */
|
|
127
|
+
.en-color-text {
|
|
128
|
+
color: transparent;
|
|
129
|
+
background-image: linear-gradient(45deg, #ff0, #0f0, #f00, #0ff, #00f, #f0f, #ff0);
|
|
130
|
+
background-position: 0% 0%;
|
|
131
|
+
background-size: 400% 200%;
|
|
132
|
+
background-clip: text;
|
|
133
|
+
animation: 6s ease-in 0s infinite colorText alternate;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.en-red-bg {
|
|
137
|
+
background-color: #f12;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.en-float-left {
|
|
141
|
+
float: left;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.en-float-right,
|
|
145
|
+
.en-float {
|
|
146
|
+
float: right;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.en-clear-float,
|
|
150
|
+
.en-clear {
|
|
151
|
+
clear: both;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.en-loading {
|
|
155
|
+
position: relative;
|
|
156
|
+
width: 100%;
|
|
157
|
+
height: 100%;
|
|
158
|
+
background-color: transparent;
|
|
159
|
+
background-image:
|
|
160
|
+
radial-gradient(#f00, #f00 50%, transparent 50%, transparent),
|
|
161
|
+
radial-gradient(#af1, #af1 50%, transparent 50%, transparent),
|
|
162
|
+
radial-gradient(#0ff, #0ff 50%, transparent 50%, transparent),
|
|
163
|
+
radial-gradient(#f0f, #f0f 50%, transparent 50%, transparent);
|
|
164
|
+
background-repeat: no-repeat;
|
|
165
|
+
animation: 2.4s ease-in-out 0s infinite loading;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// 文本剧中
|
|
169
|
+
.en-text-center {
|
|
170
|
+
text-align: center;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// 文本靠右
|
|
174
|
+
.en-text-right {
|
|
175
|
+
text-align: end;
|
|
176
|
+
}
|
|
177
|
+
//小文本
|
|
178
|
+
.en-text-small {
|
|
179
|
+
font-size: 0.6rem;
|
|
180
|
+
}
|
|
181
|
+
@keyframes loading {
|
|
182
|
+
// 45 - 25 * Math.sin((Math.PI * 5) / 12)
|
|
183
|
+
// 位置公式 35 - 25 * Math.cos((Math.PI * 5) / 12)
|
|
184
|
+
|
|
185
|
+
100%,
|
|
186
|
+
0% {
|
|
187
|
+
background-size:
|
|
188
|
+
10% 10%,
|
|
189
|
+
10% 10%,
|
|
190
|
+
10% 10%,
|
|
191
|
+
10% 10%;
|
|
192
|
+
background-position:
|
|
193
|
+
25% 45%,
|
|
194
|
+
41.7% 45%,
|
|
195
|
+
58.3% 45%,
|
|
196
|
+
75% 45%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
20%,
|
|
200
|
+
80% {
|
|
201
|
+
background-size: 2.5% 2.5%;
|
|
202
|
+
background-position: 25% 45%;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
22% {
|
|
206
|
+
background-size:
|
|
207
|
+
3.75% 3.75%,
|
|
208
|
+
2.5% 2.5%,
|
|
209
|
+
2.5% 2.5%,
|
|
210
|
+
2.5% 2.5%;
|
|
211
|
+
background-position:
|
|
212
|
+
// 位置 1
|
|
213
|
+
25.85% 38.53%,
|
|
214
|
+
25% 45%,
|
|
215
|
+
25% 45%,
|
|
216
|
+
25% 45%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
24% {
|
|
220
|
+
background-size:
|
|
221
|
+
5% 5%,
|
|
222
|
+
2.5% 2.5%,
|
|
223
|
+
2.5% 2.5%,
|
|
224
|
+
2.5% 2.5%;
|
|
225
|
+
background-position:
|
|
226
|
+
// 位置 2
|
|
227
|
+
28.35% 32.5%,
|
|
228
|
+
25% 45%,
|
|
229
|
+
25% 45%,
|
|
230
|
+
25% 45%;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
26% {
|
|
234
|
+
background-size:
|
|
235
|
+
6.25% 6.25%,
|
|
236
|
+
2.5% 2.5%,
|
|
237
|
+
2.5% 2.5%,
|
|
238
|
+
2.5% 2.5%;
|
|
239
|
+
background-position:
|
|
240
|
+
// 位置 3
|
|
241
|
+
32.32% 27.32%,
|
|
242
|
+
25% 45%,
|
|
243
|
+
25% 45%,
|
|
244
|
+
25% 45%;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
28% {
|
|
248
|
+
background-size:
|
|
249
|
+
7.5% 7.5%,
|
|
250
|
+
3.75% 3.75%,
|
|
251
|
+
2.5% 2.5%,
|
|
252
|
+
2.5% 2.5%;
|
|
253
|
+
background-position:
|
|
254
|
+
// 位置 4
|
|
255
|
+
37.5% 23.35%,
|
|
256
|
+
// 位置 1
|
|
257
|
+
25.85% 38.53%,
|
|
258
|
+
25% 45%,
|
|
259
|
+
25% 45%;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
30% {
|
|
263
|
+
background-size:
|
|
264
|
+
8.75% 8.75%,
|
|
265
|
+
5% 5%,
|
|
266
|
+
2.5% 2.5%,
|
|
267
|
+
2.5% 2.5%;
|
|
268
|
+
background-position:
|
|
269
|
+
// 位置 5
|
|
270
|
+
43.53% 20.85%,
|
|
271
|
+
// 位置 2
|
|
272
|
+
28.35% 32.5%,
|
|
273
|
+
25% 45%,
|
|
274
|
+
25% 45%;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
32% {
|
|
278
|
+
background-size:
|
|
279
|
+
10% 10%,
|
|
280
|
+
6.25% 6.25%,
|
|
281
|
+
3.75% 3.75%,
|
|
282
|
+
2.5% 2.5%;
|
|
283
|
+
background-position:
|
|
284
|
+
// 位置 6
|
|
285
|
+
50% 20%,
|
|
286
|
+
// 位置 3
|
|
287
|
+
32.32% 27.32%,
|
|
288
|
+
// 位置 1
|
|
289
|
+
25.85% 38.53%,
|
|
290
|
+
25% 45%;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
34% {
|
|
294
|
+
background-size:
|
|
295
|
+
10% 10%,
|
|
296
|
+
7.5% 7.5%,
|
|
297
|
+
5% 5%,
|
|
298
|
+
2.5% 2.5%;
|
|
299
|
+
background-position:
|
|
300
|
+
// 位置 7
|
|
301
|
+
56.47% 20.85%,
|
|
302
|
+
// 位置 4
|
|
303
|
+
37.32% 23.35%,
|
|
304
|
+
// 位置 2
|
|
305
|
+
28.35% 32.5%,
|
|
306
|
+
// 位置 1
|
|
307
|
+
25.85% 38.53%;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
$Pi: 3.1415926;
|
|
311
|
+
|
|
312
|
+
@for $i from 18 through 33 {
|
|
313
|
+
#{calc($i / 50 * 100%)} {
|
|
314
|
+
background-position:
|
|
315
|
+
#{(50 - (25 * cos(($Pi * ($i - 10)) / 12))) *
|
|
316
|
+
1%}
|
|
317
|
+
#{(45 - 25 * sin(($Pi * ($i - 10)) / 12)) *
|
|
318
|
+
1%},
|
|
319
|
+
#{(50 - (25 * cos(($Pi * ($i - 13)) / 12))) *
|
|
320
|
+
1%}
|
|
321
|
+
#{(45 - 25 * sin(($Pi * ($i - 13)) / 12)) *
|
|
322
|
+
1%},
|
|
323
|
+
#{(50 - (25 * cos(($Pi * ($i - 15)) / 12))) *
|
|
324
|
+
1%}
|
|
325
|
+
#{(45 - 25 * sin(($Pi * ($i - 15)) / 12)) *
|
|
326
|
+
1%},
|
|
327
|
+
#{(50 - (25 * cos(($Pi * ($i - 17)) / 12))) *
|
|
328
|
+
1%}
|
|
329
|
+
#{(45 - 25 * sin(($Pi * ($i - 17)) / 12)) *
|
|
330
|
+
1%};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
68% {
|
|
335
|
+
background-size:
|
|
336
|
+
10% 10%,
|
|
337
|
+
7.5% 7.5%,
|
|
338
|
+
5% 5%,
|
|
339
|
+
2.5% 2.5%;
|
|
340
|
+
background-position:
|
|
341
|
+
// 位置 0
|
|
342
|
+
25% 45%,
|
|
343
|
+
// 位置 22
|
|
344
|
+
28.35% 57.45%,
|
|
345
|
+
// 位置 20
|
|
346
|
+
37.45% 66.65%,
|
|
347
|
+
// 位置 18
|
|
348
|
+
48% 70%;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
70% {
|
|
352
|
+
background-size:
|
|
353
|
+
8.75% 8.75%,
|
|
354
|
+
7.5% 7.5%,
|
|
355
|
+
5% 5%,
|
|
356
|
+
2.5% 2.5%;
|
|
357
|
+
background-position:
|
|
358
|
+
// 位置 0
|
|
359
|
+
25% 45%,
|
|
360
|
+
// 位置 23
|
|
361
|
+
25.85% 51.47%,
|
|
362
|
+
// 位置 21
|
|
363
|
+
32.32% 62.68%,
|
|
364
|
+
// 位置 19
|
|
365
|
+
43.53% 69.15%;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
72% {
|
|
369
|
+
background-size:
|
|
370
|
+
7.5% 7.5%,
|
|
371
|
+
7.5% 7.5%,
|
|
372
|
+
5% 5%,
|
|
373
|
+
2.5% 2.5%;
|
|
374
|
+
background-position:
|
|
375
|
+
// 位置 0
|
|
376
|
+
25% 45%,
|
|
377
|
+
// 位置 0
|
|
378
|
+
25% 45%,
|
|
379
|
+
// 位置 22
|
|
380
|
+
28.35% 57.45%,
|
|
381
|
+
// 位置 20
|
|
382
|
+
37.45% 66.65%;
|
|
383
|
+
}
|
|
384
|
+
74% {
|
|
385
|
+
background-size:
|
|
386
|
+
6.25% 6.25%,
|
|
387
|
+
6.25% 6.25%,
|
|
388
|
+
5% 5%,
|
|
389
|
+
2.5% 2.5%;
|
|
390
|
+
background-position:
|
|
391
|
+
// 位置 0
|
|
392
|
+
25% 45%,
|
|
393
|
+
// 位置 0
|
|
394
|
+
25% 45%,
|
|
395
|
+
// 位置 23
|
|
396
|
+
25.85% 51.47%,
|
|
397
|
+
// 位置 21
|
|
398
|
+
32.32% 62.68%;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
76% {
|
|
402
|
+
background-size:
|
|
403
|
+
5% 5%,
|
|
404
|
+
5% 5%,
|
|
405
|
+
5% 5%,
|
|
406
|
+
2.5% 2.5%;
|
|
407
|
+
background-position:
|
|
408
|
+
// 位置 0
|
|
409
|
+
25% 45%,
|
|
410
|
+
// 位置 0
|
|
411
|
+
25% 45%,
|
|
412
|
+
// 位置 0
|
|
413
|
+
25% 45%,
|
|
414
|
+
// 位置 22
|
|
415
|
+
28.35% 57.45%;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
78% {
|
|
419
|
+
background-size:
|
|
420
|
+
3.75% 3.75%,
|
|
421
|
+
3.75% 3.75%,
|
|
422
|
+
3.75% 3.75%,
|
|
423
|
+
2.5% 2.5%;
|
|
424
|
+
background-position:
|
|
425
|
+
// 位置 0
|
|
426
|
+
25% 45%,
|
|
427
|
+
// 位置 0
|
|
428
|
+
25% 45%,
|
|
429
|
+
// 位置 0
|
|
430
|
+
25% 45%,
|
|
431
|
+
// 位置 23
|
|
432
|
+
25.85% 51.47%;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
@keyframes colorText {
|
|
437
|
+
0% {
|
|
438
|
+
background-position: 400% 0%;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
100% {
|
|
442
|
+
background-position: 0% 0%;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";(()=>{"use strict";var e={953:e=>{e.exports=require("react")}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{useAnimationFrameId:()=>u});var o=t(953);function u(){var e=(0,o.useRef)(0);return(0,o.useEffect)(function(){return function(){e.current&&window.cancelAnimationFrame(e.current)}},[]),e}module.exports.earthnut=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";var r={649:(r,t,n)=>{r.exports=(e=>{var r={};return n.d(r,e),r})({useEffect:()=>e.useEffect,useRef:()=>e.useRef})}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var u=t[e]={exports:{}};return r[e](u,u.exports,n),u.exports}n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o={};n.d(o,{M:()=>a});var u=n(649);function a(){var e=(0,u.useRef)(0);return(0,u.useEffect)(function(){return function(){e.current&&window.cancelAnimationFrame(e.current)}},[]),e}const c=o.M;export{c as useAnimationFrameId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";(()=>{"use strict";var e={953:e=>{e.exports=require("react")}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{useInputIsComposing:()=>u});var o=t(953);function u(e){var r=(0,o.useRef)(!1);return(0,o.useEffect)(function(){var t=e.current;if(t){var n=function(){return r.current=!0},o=function(){return r.current=!1};return t.addEventListener("compositionstart",n),t.addEventListener("compositionend",o),function(){t.removeEventListener("compositionstart",n),t.removeEventListener("compositionend",o)}}},[]),r}module.exports.earthnut=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";var t={649:(t,r,n)=>{t.exports=(e=>{var t={};return n.d(t,e),t})({useEffect:()=>e.useEffect,useRef:()=>e.useRef})}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};n.d(o,{t:()=>i});var s=n(649);function i(e){var t=(0,s.useRef)(!1);return(0,s.useEffect)(function(){var r=e.current;if(r){var n=function(){return t.current=!0},o=function(){return t.current=!1};return r.addEventListener("compositionstart",n),r.addEventListener("compositionend",o),function(){r.removeEventListener("compositionstart",n),r.removeEventListener("compositionend",o)}}},[]),t}const u=o.t;export{u as useInputIsComposing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";(()=>{"use strict";var t={570:t=>{t.exports=require("a-type-of-js")},705:t=>{t.exports=require("a-js-tools")},953:t=>{t.exports=require("react")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{useRipples:()=>Zt});var i=r(953);const o=require("a-element-inline-style");var a=r(570);function l(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,l={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(l.id,i(r.VERTEX_SHADER,t)),r.attachShader(l.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(l.id),!r.getProgramParameter(l.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(l.id));r.useProgram(l.id),r.enableVertexAttribArray(0);for(var u=t+e,s=/uniform (\w+) (\w+)/g;!(0,a.isNull)(o=s.exec(u));){var c=o[2];l.locations[c]=r.getUniformLocation(l.id,c)}return l}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function s(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function c(t){return"none"===t||""===t}function f(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce(function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t},[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function p(t){"@babel/helpers - typeof";return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function d(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}var v=d(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),g(this,"canvas",void 0),g(this,"gl",void 0),g(this,"config",void 0),g(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,a.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(f,this,[])}),b=r(705),y={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function E(t){"@babel/helpers - typeof";return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==E(e)?e:e+""}Object.freeze(y);var T;new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}())({name:"earthnut",type:!1});function S(t){"@babel/helpers - typeof";return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x(n.key),n)}}function x(t){var e=function(t,e){if("object"!=S(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==S(e)?e:e+""}function k(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function _(t,e,r){return t.set(O(t,e),r),r}function D(t,e){return t.get(O(t,e))}function O(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function A(t){return function(t){if(Array.isArray(t))return I(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return I(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var F=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var u=l;u<=i;u++){var s=n[l][u],c=function(){return(0,b.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(u,2)))<=i?(0,b.getRandomInt)(120,180):(0,b.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var p=0;p<=f;p++)n[f][p]=n[p][f];for(var h=i;h<r;h++)for(var d=0;d<=i;d++)n[h][d]=n[r-h][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var y=i;y<r;y++)n[v][y]=n[v][r-y];var E=t%r;return e.list=[].concat(A(n.slice(E)),A(n.slice(0,E))),e},U=new(T=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),k(this,T,1),e=this,r="data",n=F(),(r=x(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){D(T,this)>100&&_(T,this,0),this.data=F(_(T,this,D(T,this)+3))}}])&&P(t.prototype,e),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function j(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,a.isNull)(i)||(0,a.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=U.data,o=i.diameter,a=i.list,l=t*o,u=0;u<n.length;u+=4){var s=u/4%l,c=s%t%o,f=Math.floor(s/t),p=a[c][f];n[u]=p[0],n[u+1]=p[1],n[u+2]=p[2],n[u+3]=p[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function N(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,b.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});U.build(),n.push({resource:j(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function C(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,a.isNull)(t))return Reflect.apply(N,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,a.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(N,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,a.isNull)(o))return Reflect.apply(N,this,[]);var l=e.backgroundInfo,u=l.width,c=l.height;i.width=u,i.height=c,o.clearRect(0,0,u,c);var f=(0,a.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=f,o.fillRect(0,0,u,c),o.fill(),e.isTransitioning&&!(0,a.isEmptyArray)(e.toBeList)?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var p={resource:i,kind:"background-color",tag:f,width:u,height:c};e.toBeList.push(p),e.run()}function B(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,a.isNull)(e))return Reflect.apply(C,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,a.isArray)(r.imgUrl))return Reflect.apply(C,this,[]);var i=(0,a.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map(function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t}).filter(function(t){return t.startsWith("rgb")||t.startsWith("#")});if(i.length<2)return Reflect.apply(C,this,[]);var o=document.createElement("canvas"),l=o.getContext("2d");if((0,a.isNull)(l))return Reflect.apply(C,this,[]);var u=t.backgroundInfo,s=u.width,c=u.height;o.width=s,o.height=c,l.fillStyle="#fff",l.fillRect(0,0,s,c);var f=l.createLinearGradient(0,0,0,c);i.forEach(function(t,e){return f.addColorStop(e/(i.length-1),t)}),l.fillStyle=f,l.fillRect(0,0,s,c),t.isTransitioning&&!(0,a.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:c}),t.run()}function L(t){return function(t){if(Array.isArray(t))return M(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return M(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,a.isNull)(e))Reflect.apply(B,this,[]);else{var i,o,l=e.lastUseStyle,u=n.backgroundInfo,s=u.width,c=u.height,f=(0,a.isString)(r.imgUrl)&&r.imgUrl||(i=l.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,a.isNull)(o)?null:o[1]);if(e.imageSource=f,f){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(f,s,c);p.onload=function(){clearTimeout(n.transparentId),n.isTransitioning&&!(0,a.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(L(n.toBeList.slice(1).filter(function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-c)>2||t.tag!==f)}))):n.toBeList=[],n.toBeList.push({resource:p,width:s,height:c,kind:"image",tag:f}),n.run()},p.onerror=function(){Reflect.apply(B,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(B,this,[])}}function W(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach(function(t){return e.style.setProperty(t[0],t[1],"important")})}}function G(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function z(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function H(t){"@babel/helpers - typeof";return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function Y(t,e,r){return(e=$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var K=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Y(this,"quad",null),Y(this,"lastRaindropsFallTime",0),Y(this,"parentElement",void 0),Y(this,"mutationObserver",void 0),Y(this,"resizeObserver",void 0),Y(this,"renderProgram",void 0),Y(this,"imageSource",""),Y(this,"dropProgram",void 0),Y(this,"updateProgram",void 0),Y(this,"textures",[]),Y(this,"backgroundTexture",[]),Y(this,"textureDelta",void 0),Y(this,"framebuffers",[]),Y(this,"bufferWriteIndex",0),Y(this,"bufferReadIndex",1),Y(this,"originStyle",void 0),Y(this,"lastUseStyle",void 0),Y(this,"events",{}),Y(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(W,n,[]),this.originStyle=this.lastUseStyle=G(this.parentElement),this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=G(o.parentElement),l=Object.values(i);if((0,a.isEmptyArray)(b.enArr.difference(e,l)))return;var u=c(i.backgroundImage),f=s(i.backgroundColor);if(u&&f)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(W,n,[])}})}),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver(function(t){t.forEach(function(t){t.target===o.parentElement&&Reflect.apply(r,n,[])})}),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(z,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach(function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])}),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&q(t.prototype,e),r&&q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function V(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r,n,i,o=t.parentElement,l=window.getComputedStyle(o),u=l.backgroundSize,s=l.backgroundAttachment,c=l.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):Z(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var h=e.backgroundInfo||{width:100,height:100},d=h.width,g=h.height;if("cover"===u){var m=Math.max(p.width/d,p.height/g);n=d*m,i=g*m}else if("contain"===u){var v=Math.min(p.width/d,p.height/g);n=d*v,i=g*v}else{var b=u.split(" ");n=b[0]||"",i=b[1]||n,Z(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),Z(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var y=f&&f[0]||"0%",E=f&&f[1]||"0%";y=Z(y)?(p.left+(p.width-Number(n))*parseFloat(y)/100).toString():(p.left+parseFloat(y)).toString(),E=Z(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(y)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function Z(t){return t.endsWith("%")}function J(){var t=this.gl,e=this.renderData;(0,a.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function Q(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(u,this,[i,0]),Reflect.apply(u,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(J,this,[]),t.disable(t.BLEND)}}function tt(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function et(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,l=e.bufferWriteIndex,s=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,o[l]),Reflect.apply(u,this,[i[s]]),t.useProgram(n.id),Reflect.apply(J,this,[]),Reflect.apply(tt,this,[])}}function rt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,l=r.running,u=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(V,this,[]),l?(s||(r.lastRunningState=!0,this.show()),u&&this.raindropsFall(),o&&this.fade(),Reflect.apply(et,this,[]),Reflect.apply(Q,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(rt,t,[])})}}function nt(t,e,r){var n=this.renderData;if(!(0,a.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),l=parseInt(o.borderLeftWidth)||0,u=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),c=t.clientX-s.left-l,f=t.clientY-s.top-u;this.drop(c,f,e,r)}}function it(){var t=this,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(nt,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach(function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})})}}var ot="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function at(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.textureDelta;e.dropProgram=l(ot,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=l(ot,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=l("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function lt(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function ut(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,a.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,l=n.backgroundInfo,u=l.width,s=l.height,c=function(t){return(0,a.isZero)(t&t-1)},f=c(u)&&c(s)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,f),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,f),o.dataset.render_img=t.tag,o.dataset.render_width=t.width+"px",o.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function st(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,l=r.resolution,u=this.gl,s=1/l;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach(function(t){return u.getExtension(t)});for(var c=this.config.arrayType,f=c?new c(l*l*4):null,p=this.config,h=0;h<2;h++){var d=u.createTexture(),g=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,g),u.bindTexture(u.TEXTURE_2D,d),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,l,l,0,u.RGBA,p.type,f),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,e.quad),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),u.STATIC_DRAW),Reflect.apply(at,this,[]),Reflect.apply(lt,this,[]),Reflect.apply(X,this,[]),u.clearColor(0,0,0,0),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(it,this,[]),Reflect.apply(ut,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(rt,t,[])})}}function ct(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(X,this,[])}}function ft(){var t=this.renderData,e=this.fadeData;(0,a.isNull)(t)||(t.destroy(),Object.keys(t).forEach(function(e){return t[e]=null}),this.renderData=null),e.destroy(),Object.keys(e).forEach(function(t){return e[t]=null}),this.fadeData=null,this.gl&&(this.gl=null)}function pt(t,e,r,n){var i=this.renderData,o=this.options,l=this.gl;if(!(0,a.isNull)(i)){var s=i.parentElement,c=i.dropProgram,f=i.textures,p=i.framebuffers,h=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=s.offsetWidth,v=s.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);l.viewport(0,0,g,g),l.bindFramebuffer(l.FRAMEBUFFER,p[h]),Reflect.apply(u,this,[f[d]]),l.useProgram(c.id),l.uniform2fv(c.locations.center,y),l.uniform1f(c.locations.radius,r),l.uniform1f(c.locations.strength,n),Reflect.apply(J,this,[]),Reflect.apply(tt,this,[])}}function ht(t){"@babel/helpers - typeof";return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mt(n.key),n)}}function gt(t,e,r){return(e=mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mt(t){var e=function(t,e){if("object"!=ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ht(e)?e:e+""}function vt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function bt(t,e){return t.get(Et(t,e))}function yt(t,e,r){return t.set(Et(t,e),r),r}function Et(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=new WeakMap,xt=new WeakMap,kt=new WeakMap,_t=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vt(this,wt,y.accelerating),vt(this,Rt,y.interactive),vt(this,Tt,y.resolution),vt(this,St,y.perturbance),vt(this,Pt,y.dropRadius),gt(this,"imgUrl",y.imgUrl),vt(this,xt,y.idleFluctuations),vt(this,kt,y.raindropsTimeInterval),gt(this,"crossOrigin","no-cors"),gt(this,"visible",!1),gt(this,"running",!1),gt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return bt(wt,this)},set:function(t){t>100||t<2||yt(wt,this,t)}},{key:"interactive",get:function(){return bt(Rt,this)},set:function(t){(0,a.isBoolean)(t)&&yt(Rt,this,t)}},{key:"resolution",get:function(){return bt(Tt,this)},set:function(t){t<100||t>550||yt(Tt,this,t)}},{key:"perturbance",get:function(){return bt(St,this)},set:function(t){t<1e-4||t>1||yt(St,this,t)}},{key:"dropRadius",get:function(){return bt(Pt,this)},set:function(t){!isFinite(t)||t<10||yt(Pt,this,t)}},{key:"idleFluctuations",get:function(){return bt(xt,this)},set:function(t){(0,a.isBoolean)(t)&&yt(xt,this,t)}},{key:"raindropsTimeInterval",get:function(){return bt(kt,this)},set:function(t){t<10||t>12e3||yt(kt,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&dt(t.prototype,e),r&&dt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Dt(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout(function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(Dt,t,[]);"image"!==r.lastDrawImage.kind&&r.run()},2*e.raindropsTimeInterval)}function Ot(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,a.isNull)(t))return Reflect.apply(At,this,["还没有准备好,即将退出"]);if((0,a.isEmptyArray)(n))return Reflect.apply(At,this,["由于缺少当前渲染的背景,退出"]);if(0===e.drawProgress&&n.forEach(function(t){}),e.drawProgress>1e3){if(e.lastDrawImage=n.shift(),Reflect.apply(ut,this,[e.lastDrawImage]),(0,a.isEmptyArray)(n)){var i=t.lastUseStyle;((0,a.isNull)(r.imgUrl)||(0,a.isBusinessEmptyString)(r.imgUrl)||(0,a.isZero)(r.imgUrl.length))&&s(i.backgroundColor)&&c(i.backgroundImage)&&Reflect.apply(N,this,[!1])}return Reflect.apply(At,this,["当前执行完毕,开启下次执行"])}var o=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var u=document.createElement("canvas"),f=u.getContext("2d");if((0,a.isNull)(f)||(0,a.isNull)(o.resource)||(0,a.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(Dt,this,[]);var p=l.width,h=l.height;u.width=p,u.height=h,f.clearRect(0,0,p,h),f.drawImage(o.resource,0,0,p,h),f.globalAlpha=e.drawProgress/1e3,f.drawImage(n[0].resource,0,0,p,h),f.globalAlpha=1;var d={resource:u,width:p,height:h,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ut,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}function At(t){this.fadeData.isTransitioning=!1,Reflect.apply(Dt,this,[])}function It(t){"@babel/helpers - typeof";return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jt(n.key),n)}}function Ut(t,e,r){return(e=jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}var Nt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ut(this,"backgroundInfo",{width:0,height:0}),Ut(this,"transparentId",setTimeout(Boolean)),Ut(this,"lastDrawImage",void 0),Ut(this,"toBeList",[]),Ut(this,"drawProgress",0),Ut(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,a.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:j(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ct(t){"@babel/helpers - typeof";return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Lt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(r),!0).forEach(function(e){qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yt(n.key),n)}}function Xt(t,e,r){return e=Gt(e),function(t,e){if(e&&("object"==Ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Wt()?Reflect.construct(e,r||[],Gt(t).constructor):e.apply(t,r))}function Wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Wt=function(){return!!t})()}function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gt(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Ht(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function qt(t,e,r){return(e=Yt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yt(t){var e=function(t,e){if("object"!=Ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ct(e)?e:e+""}function $t(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var Kt=new WeakMap,Vt=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),qt(n=Xt(this,e,[t]),"renderData",null),qt(n,"options",void 0),qt(n,"fadeData",void 0),qt(n,"defaults",y),qt(n,"initialized",!1),Ht(n,Kt,(0,b.debounce)(ct,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new _t(Lt(Lt({},n.defaults),r)),n.renderData=new K(t,n.reloadBackground,n),n.fadeData=new Nt(n),(0,a.isFalse)(n.initState)||(0,a.isNull)(t.parentElement)||(0,a.isNull)(n.config)||(0,a.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,o.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(st,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,a.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,l=e.dropRadius,u=Date.now();if(!(u-i<o)){t.lastRaindropsFallTime=u;var s=function(t){return(0,b.getRandomInt)(t)},c=n.width,f=n.height;this.drop(s(c),s(f),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(pt,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ot,this,[])}},{key:"reloadBackground",value:function(){$t(Kt,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(ft,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(W,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(z,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(X,this,[])):this.options[t]=e}}])&&Mt(r.prototype,n),i&&Mt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(v);function Zt(t,e){var r=(0,i.useRef)(null);return(0,i.useEffect)(function(){if(!(0,a.isNull)(t.current))return r.current=new Vt(t.current,e&&e.option),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}},[]),r}module.exports.earthnut=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as t from"a-js-tools";import*as e from"a-type-of-js";import*as r from"react";import{setStyle as n}from"a-element-inline-style";var i={161:(e,r,n)=>{e.exports=(t=>{var e={};return n.d(e,t),e})({debounce:()=>t.debounce,enArr:()=>t.enArr,getRandomInt:()=>t.getRandomInt,getRandomString:()=>t.getRandomString})},362:(t,r,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({isArray:()=>e.isArray,isBoolean:()=>e.isBoolean,isBusinessEmptyString:()=>e.isBusinessEmptyString,isEmptyArray:()=>e.isEmptyArray,isFalse:()=>e.isFalse,isNull:()=>e.isNull,isString:()=>e.isString,isZero:()=>e.isZero})},649:(t,e,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({useEffect:()=>r.useEffect,useRef:()=>r.useRef})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return i[t](r,r.exports,a),r.exports}a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var l={};a.d(l,{n:()=>te});var s=a(649),u=a(362);function f(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,t)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var l=t+e,s=/uniform (\w+) (\w+)/g;!(0,u.isNull)(o=s.exec(l));){var f=o[2];a.locations[f]=r.getUniformLocation(a.id,f)}return a}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function p(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function h(t){return"none"===t||""===t}function d(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce(function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t},[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var s=null,u=0;u<i.length;u++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[u].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){s=i[u];break}return s}function g(t){"@babel/helpers - typeof";return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function v(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=function(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==g(e)?e:e+""}var E=v(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,"canvas",void 0),y(this,"gl",void 0),y(this,"config",void 0),y(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,u.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(d,this,[])}),R=a(161),w={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function T(t){"@babel/helpers - typeof";return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,P(n.key),n)}}function P(t){var e=function(t,e){if("object"!=T(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==T(e)?e:e+""}Object.freeze(w);var x;new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&S(t.prototype,e),r&&S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}())({name:"earthnut",type:!1});function k(t){"@babel/helpers - typeof";return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function A(t){var e=function(t,e){if("object"!=k(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==k(e)?e:e+""}function D(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function O(t,e,r){return t.set(F(t,e),r),r}function I(t,e){return t.get(F(t,e))}function F(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function U(t){return function(t){if(Array.isArray(t))return j(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var N=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var s=l;s<=i;s++){var u=n[l][s],f=function(){return(0,R.getRandomInt)(255,190)};u[0]=f(),u[1]=f(),u[2]=f(),u[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(s,2)))<=i?(0,R.getRandomInt)(120,180):(0,R.getRandomInt)(160,240)}for(var c=0;c<=i;c++)for(var p=0;p<=c;p++)n[c][p]=n[p][c];for(var h=i;h<r;h++)for(var d=0;d<=i;d++)n[h][d]=n[r-h][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var y=i;y<r;y++)n[v][y]=n[v][r-y];var b=t%r;return e.list=[].concat(U(n.slice(b)),U(n.slice(0,b))),e},B=new(x=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,x,1),e=this,r="data",n=N(),(r=A(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){I(x,this)>100&&O(x,this,0),this.data=N(O(x,this,I(x,this)+3))}}])&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function C(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,u.isNull)(i)||(0,u.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=B.data,o=i.diameter,a=i.list,l=t*o,s=0;s<n.length;s+=4){var u=s/4%l,f=u%t%o,c=Math.floor(u/t),p=a[f][c];n[s]=p[0],n[s+1]=p[1],n[s+2]=p[2],n[s+3]=p[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function L(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,R.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});B.build(),n.push({resource:C(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function M(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,u.isNull)(t))return Reflect.apply(L,this,[]);var n=t.originStyle;if(p(n.backgroundColor)&&(!(0,u.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(L,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,u.isNull)(o))return Reflect.apply(L,this,[]);var a=e.backgroundInfo,l=a.width,s=a.height;i.width=l,i.height=s,o.clearRect(0,0,l,s);var f=(0,u.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=f,o.fillRect(0,0,l,s),o.fill(),e.isTransitioning&&!(0,u.isEmptyArray)(e.toBeList)?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var c={resource:i,kind:"background-color",tag:f,width:l,height:s};e.toBeList.push(c),e.run()}function X(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,u.isNull)(e))return Reflect.apply(M,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,u.isArray)(r.imgUrl))return Reflect.apply(M,this,[]);var i=(0,u.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map(function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t}).filter(function(t){return t.startsWith("rgb")||t.startsWith("#")});if(i.length<2)return Reflect.apply(M,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,u.isNull)(a))return Reflect.apply(M,this,[]);var l=t.backgroundInfo,s=l.width,f=l.height;o.width=s,o.height=f,a.fillStyle="#fff",a.fillRect(0,0,s,f);var c=a.createLinearGradient(0,0,0,f);i.forEach(function(t,e){return c.addColorStop(e/(i.length-1),t)}),a.fillStyle=c,a.fillRect(0,0,s,f),t.isTransitioning&&!(0,u.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:f}),t.run()}function W(t){return function(t){if(Array.isArray(t))return G(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function z(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,u.isNull)(e))Reflect.apply(X,this,[]);else{var i,o,a=e.lastUseStyle,l=n.backgroundInfo,s=l.width,f=l.height,c=(0,u.isString)(r.imgUrl)&&r.imgUrl||(i=a.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,u.isNull)(o)?null:o[1]);if(e.imageSource=c,c){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(c,s,f);p.onload=function(){clearTimeout(n.transparentId),n.isTransitioning&&!(0,u.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(W(n.toBeList.slice(1).filter(function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-f)>2||t.tag!==c)}))):n.toBeList=[],n.toBeList.push({resource:p,width:s,height:f,kind:"image",tag:c}),n.run()},p.onerror=function(){Reflect.apply(X,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(X,this,[])}}function H(){var t=this.renderData;if(!(0,u.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach(function(t){return e.style.setProperty(t[0],t[1],"important")})}}function Y(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function q(){var t=this.renderData;if(!(0,u.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function Z(t){"@babel/helpers - typeof";return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V(n.key),n)}}function K(t,e,r){return(e=V(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V(t){var e=function(t,e){if("object"!=Z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Z(e)?e:e+""}var J=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),K(this,"quad",null),K(this,"lastRaindropsFallTime",0),K(this,"parentElement",void 0),K(this,"mutationObserver",void 0),K(this,"resizeObserver",void 0),K(this,"renderProgram",void 0),K(this,"imageSource",""),K(this,"dropProgram",void 0),K(this,"updateProgram",void 0),K(this,"textures",[]),K(this,"backgroundTexture",[]),K(this,"textureDelta",void 0),K(this,"framebuffers",[]),K(this,"bufferWriteIndex",0),K(this,"bufferReadIndex",1),K(this,"originStyle",void 0),K(this,"lastUseStyle",void 0),K(this,"events",{}),K(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(H,n,[]),this.originStyle=this.lastUseStyle=Y(this.parentElement),this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=Y(o.parentElement),a=Object.values(i);if((0,u.isEmptyArray)(R.enArr.difference(e,a)))return;var l=h(i.backgroundImage),s=p(i.backgroundColor);if(l&&s)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(H,n,[])}})}),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver(function(t){t.forEach(function(t){t.target===o.parentElement&&Reflect.apply(r,n,[])})}),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(q,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach(function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])}),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&$(t.prototype,e),r&&$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Q(){var t=this.renderData,e=this.fadeData;if(!(0,u.isNull)(t)){var r,n,i,o=t.parentElement,a=window.getComputedStyle(o),l=a.backgroundSize,s=a.backgroundAttachment,f=a.backgroundPosition,c=/\s+/.test(r=f)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):tt(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var h=e.backgroundInfo||{width:100,height:100},d=h.width,g=h.height;if("cover"===l){var m=Math.max(p.width/d,p.height/g);n=d*m,i=g*m}else if("contain"===l){var v=Math.min(p.width/d,p.height/g);n=d*v,i=g*v}else{var y=l.split(" ");n=y[0]||"",i=y[1]||n,tt(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),tt(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var b=c&&c[0]||"0%",E=c&&c[1]||"0%";b=tt(b)?(p.left+(p.width-Number(n))*parseFloat(b)/100).toString():(p.left+parseFloat(b)).toString(),E=tt(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(b)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var R=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/R,this.canvas.height/R])}}function tt(t){return t.endsWith("%")}function et(){var t=this.gl,e=this.renderData;(0,u.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function rt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,u.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(c,this,[i,0]),Reflect.apply(c,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(et,this,[]),t.disable(t.BLEND)}}function nt(){var t=this.renderData;if(!(0,u.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function it(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,u.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,a=e.bufferWriteIndex,l=e.bufferReadIndex,s=r.resolution;t.viewport(0,0,s,s),t.bindFramebuffer(t.FRAMEBUFFER,o[a]),Reflect.apply(c,this,[i[l]]),t.useProgram(n.id),Reflect.apply(et,this,[]),Reflect.apply(nt,this,[])}}function ot(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,a=r.running,l=r.idleFluctuations,s=r.lastRunningState,f=getComputedStyle(i);n.backgroundInfo={width:parseInt(f.width),height:parseInt(f.height)},Reflect.apply(Q,this,[]),a?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),o&&this.fade(),Reflect.apply(it,this,[]),Reflect.apply(rt,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ot,t,[])})}}function at(t,e,r){var n=this.renderData;if(!(0,u.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,l=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),f=t.clientX-s.left-a,c=t.clientY-s.top-l;this.drop(f,c,e,r)}}function lt(){var t=this,e=this.renderData,r=this.options;if(!(0,u.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(at,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach(function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})})}}var st="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function ut(){var t=this.gl,e=this.renderData;if(!(0,u.isNull)(e)){var r=e.textureDelta;e.dropProgram=f(st,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=f(st,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=f("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function ft(){var t=this.gl,e=this.renderData;if(!(0,u.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function ct(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,u.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,a=n.backgroundInfo,l=a.width,s=a.height,f=function(t){return(0,u.isZero)(t&t-1)},c=f(l)&&f(s)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),o.dataset.render_img=t.tag,o.dataset.render_width=t.width+"px",o.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function pt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,u.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,a=r.resolution,l=this.gl,s=1/a;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach(function(t){return l.getExtension(t)});for(var f=this.config.arrayType,c=f?new f(a*a*4):null,p=this.config,h=0;h<2;h++){var d=l.createTexture(),g=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,g),l.bindTexture(l.TEXTURE_2D,d),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,a,a,0,l.RGBA,p.type,c),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,e.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(ut,this,[]),Reflect.apply(ft,this,[]),Reflect.apply(z,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(lt,this,[]),Reflect.apply(ct,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(ot,t,[])})}}function ht(){var t=this.renderData,e=this.fadeData;if(!(0,u.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(z,this,[])}}function dt(){var t=this.renderData,e=this.fadeData;(0,u.isNull)(t)||(t.destroy(),Object.keys(t).forEach(function(e){return t[e]=null}),this.renderData=null),e.destroy(),Object.keys(e).forEach(function(t){return e[t]=null}),this.fadeData=null,this.gl&&(this.gl=null)}function gt(t,e,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,u.isNull)(i)){var l=i.parentElement,s=i.dropProgram,f=i.textures,p=i.framebuffers,h=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=l.offsetWidth,v=l.offsetHeight,y=Math.max(m,v);r/=y;var b=new Float32Array([(2*t-m)/y,(v-2*e)/y]);a.viewport(0,0,g,g),a.bindFramebuffer(a.FRAMEBUFFER,p[h]),Reflect.apply(c,this,[f[d]]),a.useProgram(s.id),a.uniform2fv(s.locations.center,b),a.uniform1f(s.locations.radius,r),a.uniform1f(s.locations.strength,n),Reflect.apply(et,this,[]),Reflect.apply(nt,this,[])}}function mt(t){"@babel/helpers - typeof";return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function vt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bt(n.key),n)}}function yt(t,e,r){return(e=bt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bt(t){var e=function(t,e){if("object"!=mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mt(e)?e:e+""}function Et(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Rt(t,e){return t.get(Tt(t,e))}function wt(t,e,r){return t.set(Tt(t,e),r),r}function Tt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var St=new WeakMap,Pt=new WeakMap,xt=new WeakMap,kt=new WeakMap,_t=new WeakMap,At=new WeakMap,Dt=new WeakMap,Ot=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Et(this,St,w.accelerating),Et(this,Pt,w.interactive),Et(this,xt,w.resolution),Et(this,kt,w.perturbance),Et(this,_t,w.dropRadius),yt(this,"imgUrl",w.imgUrl),Et(this,At,w.idleFluctuations),Et(this,Dt,w.raindropsTimeInterval),yt(this,"crossOrigin","no-cors"),yt(this,"visible",!1),yt(this,"running",!1),yt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return Rt(St,this)},set:function(t){t>100||t<2||wt(St,this,t)}},{key:"interactive",get:function(){return Rt(Pt,this)},set:function(t){(0,u.isBoolean)(t)&&wt(Pt,this,t)}},{key:"resolution",get:function(){return Rt(xt,this)},set:function(t){t<100||t>550||wt(xt,this,t)}},{key:"perturbance",get:function(){return Rt(kt,this)},set:function(t){t<1e-4||t>1||wt(kt,this,t)}},{key:"dropRadius",get:function(){return Rt(_t,this)},set:function(t){!isFinite(t)||t<10||wt(_t,this,t)}},{key:"idleFluctuations",get:function(){return Rt(At,this)},set:function(t){(0,u.isBoolean)(t)&&wt(At,this,t)}},{key:"raindropsTimeInterval",get:function(){return Rt(Dt,this)},set:function(t){t<10||t>12e3||wt(Dt,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&vt(t.prototype,e),r&&vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function It(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout(function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(It,t,[]);"image"!==r.lastDrawImage.kind&&r.run()},2*e.raindropsTimeInterval)}function Ft(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,u.isNull)(t))return Reflect.apply(Ut,this,["还没有准备好,即将退出"]);if((0,u.isEmptyArray)(n))return Reflect.apply(Ut,this,["由于缺少当前渲染的背景,退出"]);if(0===e.drawProgress&&n.forEach(function(t){}),e.drawProgress>1e3){if(e.lastDrawImage=n.shift(),Reflect.apply(ct,this,[e.lastDrawImage]),(0,u.isEmptyArray)(n)){var i=t.lastUseStyle;((0,u.isNull)(r.imgUrl)||(0,u.isBusinessEmptyString)(r.imgUrl)||(0,u.isZero)(r.imgUrl.length))&&p(i.backgroundColor)&&h(i.backgroundImage)&&Reflect.apply(L,this,[!1])}return Reflect.apply(Ut,this,["当前执行完毕,开启下次执行"])}var o=e.lastDrawImage,a=e.backgroundInfo;e.drawProgress+=18;var l=document.createElement("canvas"),s=l.getContext("2d");if((0,u.isNull)(s)||(0,u.isNull)(o.resource)||(0,u.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(It,this,[]);var f=a.width,c=a.height;l.width=f,l.height=c,s.clearRect(0,0,f,c),s.drawImage(o.resource,0,0,f,c),s.globalAlpha=e.drawProgress/1e3,s.drawImage(n[0].resource,0,0,f,c),s.globalAlpha=1;var d={resource:l,width:f,height:c,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ct,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}function Ut(t){this.fadeData.isTransitioning=!1,Reflect.apply(It,this,[])}function jt(t){"@babel/helpers - typeof";return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ct(n.key),n)}}function Bt(t,e,r){return(e=Ct(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ct(t){var e=function(t,e){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==jt(e)?e:e+""}var Lt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Bt(this,"backgroundInfo",{width:0,height:0}),Bt(this,"transparentId",setTimeout(Boolean)),Bt(this,"lastDrawImage",void 0),Bt(this,"toBeList",[]),Bt(this,"drawProgress",0),Bt(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,u.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:C(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Nt(t.prototype,e),r&&Nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Mt(t){"@babel/helpers - typeof";return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(t)}function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Wt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(e){$t(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kt(n.key),n)}}function zt(t,e,r){return e=Yt(e),function(t,e){if(e&&("object"==Mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ht()?Reflect.construct(e,r||[],Yt(t).constructor):e.apply(t,r))}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ht=function(){return!!t})()}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function qt(t,e){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qt(t,e)}function Zt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function $t(t,e,r){return(e=Kt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kt(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}function Vt(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var Jt=new WeakMap,Qt=function(){function t(e,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$t(i=zt(this,t,[e]),"renderData",null),$t(i,"options",void 0),$t(i,"fadeData",void 0),$t(i,"defaults",w),$t(i,"initialized",!1),Zt(i,Jt,(0,R.debounce)(ht,{this:i})),Object.defineProperties(i,{defaults:{value:i.defaults,writable:!1,enumerable:!1,configurable:!1}}),i.options=new Ot(Wt(Wt({},i.defaults),r)),i.renderData=new J(e,i.reloadBackground,i),i.fadeData=new Lt(i),(0,u.isFalse)(i.initState)||(0,u.isNull)(e.parentElement)||(0,u.isNull)(i.config)||(0,u.isNull)(i.gl)?i.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,n(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(e),Reflect.apply(pt,i,[])),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qt(t,e)}(t,E),e=t,(r=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,u.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,a=e.dropRadius,l=Date.now();if(!(l-i<o)){t.lastRaindropsFallTime=l;var s=function(t){return(0,R.getRandomInt)(t)},f=n.width,c=n.height;this.drop(s(f),s(c),a,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(gt,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ft,this,[])}},{key:"reloadBackground",value:function(){Vt(Jt,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(dt,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(H,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(q,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(z,this,[])):this.options[t]=e}}])&&Gt(e.prototype,r),i&&Gt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,i}();function te(t,e){var r=(0,s.useRef)(null);return(0,s.useEffect)(function(){if(!(0,u.isNull)(t.current))return r.current=new Qt(t.current,e&&e.option),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}},[]),r}const ee=l.n;export{ee as useRipples};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";(()=>{"use strict";var e={953:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var u=r[o]={exports:{}};return e[o](u,u.exports,t),u.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};t.r(o),t.d(o,{useTimeId:()=>u});var n=t(953);function u(){var e=(0,n.useRef)(void 0);return(0,n.useEffect)(function(){return function(){e.current&&clearTimeout(e.current)}},[]),e}module.exports.earthnut=o})();
|