@sdata/web-vue 2.3.1 → 2.8.0
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/README.md +1 -1
- package/dist/sd.css +133 -187
- package/dist/sd.min.css +1 -1
- package/es/_hooks/use-responsive.d.ts +2 -2
- package/es/_hooks/use-theme-mode.d.ts +3 -0
- package/es/{calendar/hooks/use-calendar-theme.js → _hooks/use-theme-mode.js} +14 -10
- package/es/_utils/responsive-observe.d.ts +5 -4
- package/es/_utils/responsive-observe.js +2 -1
- package/es/alert/index.d.ts +3 -3
- package/es/anchor/index.d.ts +3 -3
- package/es/avatar/index.d.ts +20 -20
- package/es/border-beam/border-beam.js +5 -0
- package/es/border-beam/border-beam.vue.d.ts +52 -0
- package/es/border-beam/border-beam.vue_vue_type_script_setup_true_lang.js +623 -0
- package/es/border-beam/index.d.ts +106 -0
- package/es/border-beam/index.js +10 -0
- package/es/border-beam/pulseDriver.d.ts +2 -0
- package/es/border-beam/pulseDriver.js +74 -0
- package/es/border-beam/style/css.js +2 -0
- package/es/border-beam/style/index.css +21 -0
- package/es/border-beam/style/index.d.ts +2 -0
- package/es/border-beam/style/index.js +2 -0
- package/es/border-beam/style/index.scss +12 -0
- package/es/border-beam/style/token.scss +12 -0
- package/es/border-beam/styles.d.ts +42 -0
- package/es/border-beam/styles.js +3545 -0
- package/es/border-beam/types.d.ts +27 -0
- package/es/button/index.d.ts +24 -24
- package/es/calendar/components/index.vue.d.ts +1 -1
- package/es/calendar/components/index.vue_vue_type_script_setup_true_lang.js +3 -2
- package/es/calendar/index.d.ts +5 -5
- package/es/carousel/index.d.ts +3 -3
- package/es/checkbox/checkbox.d.ts +3 -3
- package/es/collapse/collapse-item.d.ts +5 -5
- package/es/collapse/index.d.ts +3 -3
- package/es/components.d.ts +1 -0
- package/es/config-provider/index.d.ts +21 -21
- package/es/date-picker/index.d.ts +14 -14
- package/es/date-picker/picker.vue.d.ts +2 -2
- package/es/date-picker/range-picker.vue.d.ts +2 -2
- package/es/descriptions/index.d.ts +24 -24
- package/es/drawer/index.d.ts +16 -15
- package/es/dropdown/index.d.ts +15 -15
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/form/index.d.ts +3 -3
- package/es/grid/grid-col.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/grid/grid.vue_vue_type_script_setup_true_lang.js +10 -10
- package/es/icon/icon-menu/icon-menu.js +5 -0
- package/es/icon/icon-menu/icon-menu.vue_vue_type_script_setup_true_lang.js +52 -0
- package/es/icon/icon-menu/index.js +9 -0
- package/es/index.css +133 -187
- package/es/index.d.ts +4 -2
- package/es/index.js +3 -2
- package/es/index.scss +1 -0
- package/es/input/index.d.ts +7 -7
- package/es/json-form/index.d.ts +9 -9
- package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/json-form/json-form.vue.d.ts +3 -3
- package/es/layout/content.vue.d.ts +2 -2
- package/es/layout/content.vue_vue_type_script_setup_true_lang.js +8 -3
- package/es/layout/context.d.ts +12 -9
- package/es/layout/context.js +11 -3
- package/es/layout/footer.vue.d.ts +2 -2
- package/es/layout/footer.vue_vue_type_script_setup_true_lang.js +8 -3
- package/es/layout/header.vue.d.ts +3 -30
- package/es/layout/header.vue_vue_type_script_setup_true_lang.js +9 -339
- package/es/layout/hooks/use-has-sider.d.ts +2 -0
- package/es/layout/hooks/use-has-sider.js +38 -0
- package/es/layout/index.d.ts +120 -371
- package/es/layout/index.js +2 -2
- package/es/layout/interface.d.ts +16 -46
- package/es/layout/layout.vue.d.ts +4 -2
- package/es/layout/layout.vue_vue_type_script_setup_true_lang.js +38 -14
- package/es/layout/sider.vue.d.ts +68 -178
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +243 -363
- package/es/layout/style/index.css +128 -186
- package/es/layout/style/index.scss +146 -234
- package/es/layout/style/token.scss +46 -26
- package/es/link/index.d.ts +6 -6
- package/es/list/index.d.ts +18 -18
- package/es/menu/base-menu.vue.d.ts +1 -1
- package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +14 -14
- package/es/menu/item.d.ts +1 -1
- package/es/menu/menu.d.ts +12 -12
- package/es/menu/menu.js +3 -3
- package/es/modal/index.d.ts +15 -15
- package/es/popconfirm/index.d.ts +12 -12
- package/es/popover/index.d.ts +12 -12
- package/es/progress/index.d.ts +6 -6
- package/es/qr-code/index.d.ts +3 -3
- package/es/radio/radio.d.ts +3 -3
- package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +7 -7
- package/es/result/index.d.ts +3 -3
- package/es/scrollbar/style/index.css +1 -1
- package/es/scrollbar/style/index.scss +4 -1
- package/es/sd-vue.js +3 -1
- package/es/select/select.d.ts +17 -17
- package/es/slider/index.d.ts +3 -3
- package/es/split/split.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/steps/index.d.ts +6 -6
- package/es/tabs/index.d.ts +6 -6
- package/es/tag/index.d.ts +6 -6
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/theme-provider/index.d.ts +9 -9
- package/es/time-picker/index.d.ts +6 -6
- package/es/timeline/index.d.ts +3 -3
- package/es/timeline/timeline.d.ts +1 -1
- package/es/tooltip/index.d.ts +3 -3
- package/es/tour/index.d.ts +3 -3
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/tree/node-switcher.vue.d.ts +1 -1
- package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +23 -23
- package/json/vetur-attributes.json +27 -153
- package/json/vetur-tags.json +13 -43
- package/json/web-types.json +43 -293
- package/package.json +10 -10
- package/es/calendar/hooks/use-calendar-theme.d.ts +0 -4
- package/es/layout/utils.d.ts +0 -1
- package/es/layout/utils.js +0 -11
|
@@ -0,0 +1,3545 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
//#region components/border-beam/styles.ts
|
|
3
|
+
/**
|
|
4
|
+
* Size presets for border radius and dimensions
|
|
5
|
+
*/
|
|
6
|
+
var sizePresets = {
|
|
7
|
+
"sm": {
|
|
8
|
+
borderRadius: 32,
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
width: 70,
|
|
11
|
+
height: 36
|
|
12
|
+
},
|
|
13
|
+
"md": {
|
|
14
|
+
borderRadius: 16,
|
|
15
|
+
borderWidth: 1
|
|
16
|
+
},
|
|
17
|
+
"line": {
|
|
18
|
+
borderRadius: 16,
|
|
19
|
+
borderWidth: 1
|
|
20
|
+
},
|
|
21
|
+
"pulse-outside": {
|
|
22
|
+
borderRadius: 16,
|
|
23
|
+
borderWidth: 1
|
|
24
|
+
},
|
|
25
|
+
"pulse-inner": {
|
|
26
|
+
borderRadius: 16,
|
|
27
|
+
borderWidth: 1
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Per-size theme presets matching the tuned v5 control panel defaults
|
|
32
|
+
*/
|
|
33
|
+
var sizeThemePresets = {
|
|
34
|
+
"sm": {
|
|
35
|
+
dark: {
|
|
36
|
+
strokeOpacity: .72,
|
|
37
|
+
innerOpacity: .46,
|
|
38
|
+
bloomOpacity: .58,
|
|
39
|
+
innerShadow: "rgba(255, 255, 255, 0.3)",
|
|
40
|
+
saturation: 1.3,
|
|
41
|
+
brightness: 1.5
|
|
42
|
+
},
|
|
43
|
+
light: {
|
|
44
|
+
strokeOpacity: .18,
|
|
45
|
+
innerOpacity: .38,
|
|
46
|
+
bloomOpacity: .26,
|
|
47
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
48
|
+
saturation: 1.8
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"md": {
|
|
52
|
+
dark: {
|
|
53
|
+
strokeOpacity: .56,
|
|
54
|
+
innerOpacity: .6,
|
|
55
|
+
bloomOpacity: .44,
|
|
56
|
+
innerShadow: "rgba(255, 255, 255, 0.27)",
|
|
57
|
+
saturation: 1.3,
|
|
58
|
+
brightness: 1.5
|
|
59
|
+
},
|
|
60
|
+
light: {
|
|
61
|
+
strokeOpacity: .18,
|
|
62
|
+
innerOpacity: .36,
|
|
63
|
+
bloomOpacity: .42,
|
|
64
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
65
|
+
saturation: 1.5
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"line": {
|
|
69
|
+
dark: {
|
|
70
|
+
strokeOpacity: 1.14,
|
|
71
|
+
innerOpacity: .7,
|
|
72
|
+
bloomOpacity: .8,
|
|
73
|
+
innerShadow: "rgba(255, 255, 255, 0.1)",
|
|
74
|
+
saturation: 1.2
|
|
75
|
+
},
|
|
76
|
+
light: {
|
|
77
|
+
strokeOpacity: .16,
|
|
78
|
+
innerOpacity: .32,
|
|
79
|
+
bloomOpacity: .3,
|
|
80
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
81
|
+
saturation: 1.95
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"pulse-outside": {
|
|
85
|
+
dark: {
|
|
86
|
+
strokeOpacity: .94,
|
|
87
|
+
innerOpacity: .5,
|
|
88
|
+
bloomOpacity: .5,
|
|
89
|
+
innerShadow: "transparent",
|
|
90
|
+
saturation: 1.3,
|
|
91
|
+
brightness: 2,
|
|
92
|
+
hairlineOpacity: 0
|
|
93
|
+
},
|
|
94
|
+
light: {
|
|
95
|
+
strokeOpacity: 1.96,
|
|
96
|
+
innerOpacity: 1.04,
|
|
97
|
+
bloomOpacity: .42,
|
|
98
|
+
innerShadow: "transparent",
|
|
99
|
+
saturation: .6,
|
|
100
|
+
brightness: 1.7,
|
|
101
|
+
hairlineOpacity: 0
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"pulse-inner": {
|
|
105
|
+
dark: {
|
|
106
|
+
strokeOpacity: 1.54,
|
|
107
|
+
innerOpacity: .56,
|
|
108
|
+
bloomOpacity: .72,
|
|
109
|
+
innerShadow: "transparent",
|
|
110
|
+
saturation: 1.3,
|
|
111
|
+
brightness: 1
|
|
112
|
+
},
|
|
113
|
+
light: {
|
|
114
|
+
strokeOpacity: .32,
|
|
115
|
+
innerOpacity: .4,
|
|
116
|
+
bloomOpacity: .8,
|
|
117
|
+
innerShadow: "transparent",
|
|
118
|
+
saturation: .75,
|
|
119
|
+
brightness: 1.3
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
_objectSpread2({}, sizeThemePresets.md.dark), _objectSpread2({}, sizeThemePresets.md.light);
|
|
124
|
+
/**
|
|
125
|
+
* Color palettes for each color variant
|
|
126
|
+
*/
|
|
127
|
+
var colorPalettes = {
|
|
128
|
+
colorful: {
|
|
129
|
+
border: [
|
|
130
|
+
{
|
|
131
|
+
color: "rgb(255, 50, 100)",
|
|
132
|
+
pos: "33% -7.4%",
|
|
133
|
+
size: "70px 40px"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
color: "rgb(40, 140, 255)",
|
|
137
|
+
pos: "12% -5%",
|
|
138
|
+
size: "60px 35px"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
color: "rgb(50, 200, 80)",
|
|
142
|
+
pos: "2.1% 68.3%",
|
|
143
|
+
size: "40px 70px"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
color: "rgb(30, 185, 170)",
|
|
147
|
+
pos: "2.1% 68.3%",
|
|
148
|
+
size: "20px 35px"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
color: "rgb(100, 70, 255)",
|
|
152
|
+
pos: "74.4% 100%",
|
|
153
|
+
size: "180px 32px"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
color: "rgb(40, 140, 255)",
|
|
157
|
+
pos: "55% 100%",
|
|
158
|
+
size: "85px 26px"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
color: "rgb(255, 120, 40)",
|
|
162
|
+
pos: "93.9% 0%",
|
|
163
|
+
size: "74px 32px"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
color: "rgb(240, 50, 180)",
|
|
167
|
+
pos: "100% 27.1%",
|
|
168
|
+
size: "26px 42px"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
color: "rgb(180, 40, 240)",
|
|
172
|
+
pos: "100% 27.1%",
|
|
173
|
+
size: "52px 48px"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
spike: {
|
|
177
|
+
primary: "rgb(255, 60, 80)",
|
|
178
|
+
secondary: "rgba(40, 190, 180, 0.98)"
|
|
179
|
+
},
|
|
180
|
+
spikeLt: {
|
|
181
|
+
primary: "rgb(200, 30, 60)",
|
|
182
|
+
secondary: "rgb(20, 150, 140)"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
mono: {
|
|
186
|
+
border: [
|
|
187
|
+
{
|
|
188
|
+
color: "rgb(180, 180, 180)",
|
|
189
|
+
pos: "33% -7.4%",
|
|
190
|
+
size: "70px 40px"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
color: "rgb(140, 140, 140)",
|
|
194
|
+
pos: "12% -5%",
|
|
195
|
+
size: "60px 35px"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
color: "rgb(160, 160, 160)",
|
|
199
|
+
pos: "2.1% 68.3%",
|
|
200
|
+
size: "40px 70px"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
color: "rgb(130, 130, 130)",
|
|
204
|
+
pos: "2.1% 68.3%",
|
|
205
|
+
size: "20px 35px"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
color: "rgb(170, 170, 170)",
|
|
209
|
+
pos: "74.4% 100%",
|
|
210
|
+
size: "180px 32px"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
color: "rgb(150, 150, 150)",
|
|
214
|
+
pos: "55% 100%",
|
|
215
|
+
size: "85px 26px"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
color: "rgb(190, 190, 190)",
|
|
219
|
+
pos: "93.9% 0%",
|
|
220
|
+
size: "74px 32px"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
color: "rgb(145, 145, 145)",
|
|
224
|
+
pos: "100% 27.1%",
|
|
225
|
+
size: "26px 42px"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
color: "rgb(165, 165, 165)",
|
|
229
|
+
pos: "100% 27.1%",
|
|
230
|
+
size: "52px 48px"
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
spike: {
|
|
234
|
+
primary: "rgb(200, 200, 200)",
|
|
235
|
+
secondary: "rgb(170, 170, 170)"
|
|
236
|
+
},
|
|
237
|
+
spikeLt: {
|
|
238
|
+
primary: "rgb(80, 80, 80)",
|
|
239
|
+
secondary: "rgb(120, 120, 120)"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
ocean: {
|
|
243
|
+
border: [
|
|
244
|
+
{
|
|
245
|
+
color: "rgb(100, 80, 220)",
|
|
246
|
+
pos: "33% -7.4%",
|
|
247
|
+
size: "70px 40px"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
color: "rgb(60, 120, 255)",
|
|
251
|
+
pos: "12% -5%",
|
|
252
|
+
size: "60px 35px"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
color: "rgb(80, 100, 200)",
|
|
256
|
+
pos: "2.1% 68.3%",
|
|
257
|
+
size: "40px 70px"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
color: "rgb(50, 140, 220)",
|
|
261
|
+
pos: "2.1% 68.3%",
|
|
262
|
+
size: "20px 35px"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
color: "rgb(120, 80, 255)",
|
|
266
|
+
pos: "74.4% 100%",
|
|
267
|
+
size: "180px 32px"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
color: "rgb(70, 130, 255)",
|
|
271
|
+
pos: "55% 100%",
|
|
272
|
+
size: "85px 26px"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
color: "rgb(140, 100, 240)",
|
|
276
|
+
pos: "93.9% 0%",
|
|
277
|
+
size: "74px 32px"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
color: "rgb(90, 110, 230)",
|
|
281
|
+
pos: "100% 27.1%",
|
|
282
|
+
size: "26px 42px"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
color: "rgb(130, 70, 255)",
|
|
286
|
+
pos: "100% 27.1%",
|
|
287
|
+
size: "52px 48px"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
spike: {
|
|
291
|
+
primary: "rgb(100, 120, 255)",
|
|
292
|
+
secondary: "rgba(130, 100, 220, 0.98)"
|
|
293
|
+
},
|
|
294
|
+
spikeLt: {
|
|
295
|
+
primary: "rgb(60, 60, 180)",
|
|
296
|
+
secondary: "rgb(80, 100, 200)"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
sunset: {
|
|
300
|
+
border: [
|
|
301
|
+
{
|
|
302
|
+
color: "rgb(255, 80, 50)",
|
|
303
|
+
pos: "33% -7.4%",
|
|
304
|
+
size: "70px 40px"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
color: "rgb(255, 160, 40)",
|
|
308
|
+
pos: "12% -5%",
|
|
309
|
+
size: "60px 35px"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
color: "rgb(255, 120, 60)",
|
|
313
|
+
pos: "2.1% 68.3%",
|
|
314
|
+
size: "40px 70px"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
color: "rgb(255, 200, 50)",
|
|
318
|
+
pos: "2.1% 68.3%",
|
|
319
|
+
size: "20px 35px"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
color: "rgb(255, 100, 80)",
|
|
323
|
+
pos: "74.4% 100%",
|
|
324
|
+
size: "180px 32px"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
color: "rgb(255, 180, 60)",
|
|
328
|
+
pos: "55% 100%",
|
|
329
|
+
size: "85px 26px"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
color: "rgb(255, 60, 60)",
|
|
333
|
+
pos: "93.9% 0%",
|
|
334
|
+
size: "74px 32px"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
color: "rgb(255, 140, 50)",
|
|
338
|
+
pos: "100% 27.1%",
|
|
339
|
+
size: "26px 42px"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
color: "rgb(255, 90, 70)",
|
|
343
|
+
pos: "100% 27.1%",
|
|
344
|
+
size: "52px 48px"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
spike: {
|
|
348
|
+
primary: "rgb(255, 140, 80)",
|
|
349
|
+
secondary: "rgba(255, 100, 60, 0.98)"
|
|
350
|
+
},
|
|
351
|
+
spikeLt: {
|
|
352
|
+
primary: "rgb(200, 80, 40)",
|
|
353
|
+
secondary: "rgb(220, 120, 30)"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Small size color palettes (compact gradients for button-sized elements)
|
|
359
|
+
*/
|
|
360
|
+
var smallColorPalettes = {
|
|
361
|
+
colorful: {
|
|
362
|
+
border: [
|
|
363
|
+
{
|
|
364
|
+
color: "rgb(50, 200, 80)",
|
|
365
|
+
pos: "2% 68%",
|
|
366
|
+
size: "9px 18px"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
color: "rgb(30, 185, 170)",
|
|
370
|
+
pos: "2% 68%",
|
|
371
|
+
size: "4px 8px"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
color: "rgb(255, 120, 40)",
|
|
375
|
+
pos: "72% -3%",
|
|
376
|
+
size: "59px 9px"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
color: "rgb(100, 70, 255)",
|
|
380
|
+
pos: "74% 100%",
|
|
381
|
+
size: "42px 7px"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
color: "rgb(240, 50, 180)",
|
|
385
|
+
pos: "100% 27%",
|
|
386
|
+
size: "10px 17px"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
color: "rgb(180, 40, 240)",
|
|
390
|
+
pos: "100% 27%",
|
|
391
|
+
size: "10px 18px"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
color: "rgb(40, 140, 255)",
|
|
395
|
+
pos: "100% 27%",
|
|
396
|
+
size: "5px 10px"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
color: "rgb(255, 50, 100)",
|
|
400
|
+
pos: "100% 27%",
|
|
401
|
+
size: "11px 12px"
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
inner: [
|
|
405
|
+
{
|
|
406
|
+
color: "rgba(50, 200, 80, 0.5)",
|
|
407
|
+
pos: "2% 68%",
|
|
408
|
+
size: "9px 18px"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
color: "rgba(30, 185, 170, 0.45)",
|
|
412
|
+
pos: "2% 68%",
|
|
413
|
+
size: "4px 8px"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
color: "rgba(255, 120, 40, 0.35)",
|
|
417
|
+
pos: "72% -3%",
|
|
418
|
+
size: "59px 9px"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
color: "rgba(100, 70, 255, 0.35)",
|
|
422
|
+
pos: "74% 100%",
|
|
423
|
+
size: "42px 7px"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
color: "rgba(240, 50, 180, 0.3)",
|
|
427
|
+
pos: "100% 27%",
|
|
428
|
+
size: "10px 17px"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
color: "rgba(180, 40, 240, 0.4)",
|
|
432
|
+
pos: "100% 27%",
|
|
433
|
+
size: "10px 18px"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
color: "rgba(40, 140, 255, 0.3)",
|
|
437
|
+
pos: "100% 27%",
|
|
438
|
+
size: "5px 10px"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
color: "rgba(255, 50, 100, 0.3)",
|
|
442
|
+
pos: "100% 27%",
|
|
443
|
+
size: "11px 12px"
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
mono: {
|
|
448
|
+
border: [
|
|
449
|
+
{
|
|
450
|
+
color: "rgb(160, 160, 160)",
|
|
451
|
+
pos: "2% 68%",
|
|
452
|
+
size: "9px 18px"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
color: "rgb(140, 140, 140)",
|
|
456
|
+
pos: "2% 68%",
|
|
457
|
+
size: "4px 8px"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
color: "rgb(180, 180, 180)",
|
|
461
|
+
pos: "72% -3%",
|
|
462
|
+
size: "59px 9px"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
color: "rgb(150, 150, 150)",
|
|
466
|
+
pos: "74% 100%",
|
|
467
|
+
size: "42px 7px"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
color: "rgb(170, 170, 170)",
|
|
471
|
+
pos: "100% 27%",
|
|
472
|
+
size: "10px 17px"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
color: "rgb(155, 155, 155)",
|
|
476
|
+
pos: "100% 27%",
|
|
477
|
+
size: "10px 18px"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
color: "rgb(145, 145, 145)",
|
|
481
|
+
pos: "100% 27%",
|
|
482
|
+
size: "5px 10px"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
color: "rgb(165, 165, 165)",
|
|
486
|
+
pos: "100% 27%",
|
|
487
|
+
size: "11px 12px"
|
|
488
|
+
}
|
|
489
|
+
],
|
|
490
|
+
inner: [
|
|
491
|
+
{
|
|
492
|
+
color: "rgba(160, 160, 160, 0.25)",
|
|
493
|
+
pos: "2% 68%",
|
|
494
|
+
size: "9px 18px"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
color: "rgba(140, 140, 140, 0.22)",
|
|
498
|
+
pos: "2% 68%",
|
|
499
|
+
size: "4px 8px"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
color: "rgba(180, 180, 180, 0.17)",
|
|
503
|
+
pos: "72% -3%",
|
|
504
|
+
size: "59px 9px"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
color: "rgba(150, 150, 150, 0.17)",
|
|
508
|
+
pos: "74% 100%",
|
|
509
|
+
size: "42px 7px"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
color: "rgba(170, 170, 170, 0.15)",
|
|
513
|
+
pos: "100% 27%",
|
|
514
|
+
size: "10px 17px"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
color: "rgba(155, 155, 155, 0.20)",
|
|
518
|
+
pos: "100% 27%",
|
|
519
|
+
size: "10px 18px"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
color: "rgba(145, 145, 145, 0.15)",
|
|
523
|
+
pos: "100% 27%",
|
|
524
|
+
size: "5px 10px"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
color: "rgba(165, 165, 165, 0.15)",
|
|
528
|
+
pos: "100% 27%",
|
|
529
|
+
size: "11px 12px"
|
|
530
|
+
}
|
|
531
|
+
]
|
|
532
|
+
},
|
|
533
|
+
ocean: {
|
|
534
|
+
border: [
|
|
535
|
+
{
|
|
536
|
+
color: "rgb(60, 140, 200)",
|
|
537
|
+
pos: "2% 68%",
|
|
538
|
+
size: "9px 18px"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
color: "rgb(50, 120, 180)",
|
|
542
|
+
pos: "2% 68%",
|
|
543
|
+
size: "4px 8px"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
color: "rgb(100, 80, 220)",
|
|
547
|
+
pos: "72% -3%",
|
|
548
|
+
size: "59px 9px"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
color: "rgb(80, 100, 255)",
|
|
552
|
+
pos: "74% 100%",
|
|
553
|
+
size: "42px 7px"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
color: "rgb(120, 70, 240)",
|
|
557
|
+
pos: "100% 27%",
|
|
558
|
+
size: "10px 17px"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
color: "rgb(90, 80, 220)",
|
|
562
|
+
pos: "100% 27%",
|
|
563
|
+
size: "10px 18px"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
color: "rgb(70, 110, 255)",
|
|
567
|
+
pos: "100% 27%",
|
|
568
|
+
size: "5px 10px"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
color: "rgb(110, 90, 230)",
|
|
572
|
+
pos: "100% 27%",
|
|
573
|
+
size: "11px 12px"
|
|
574
|
+
}
|
|
575
|
+
],
|
|
576
|
+
inner: [
|
|
577
|
+
{
|
|
578
|
+
color: "rgba(60, 140, 200, 0.5)",
|
|
579
|
+
pos: "2% 68%",
|
|
580
|
+
size: "9px 18px"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
color: "rgba(50, 120, 180, 0.45)",
|
|
584
|
+
pos: "2% 68%",
|
|
585
|
+
size: "4px 8px"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
color: "rgba(100, 80, 220, 0.35)",
|
|
589
|
+
pos: "72% -3%",
|
|
590
|
+
size: "59px 9px"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
color: "rgba(80, 100, 255, 0.35)",
|
|
594
|
+
pos: "74% 100%",
|
|
595
|
+
size: "42px 7px"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
color: "rgba(120, 70, 240, 0.3)",
|
|
599
|
+
pos: "100% 27%",
|
|
600
|
+
size: "10px 17px"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
color: "rgba(90, 80, 220, 0.4)",
|
|
604
|
+
pos: "100% 27%",
|
|
605
|
+
size: "10px 18px"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
color: "rgba(70, 110, 255, 0.3)",
|
|
609
|
+
pos: "100% 27%",
|
|
610
|
+
size: "5px 10px"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
color: "rgba(110, 90, 230, 0.3)",
|
|
614
|
+
pos: "100% 27%",
|
|
615
|
+
size: "11px 12px"
|
|
616
|
+
}
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
sunset: {
|
|
620
|
+
border: [
|
|
621
|
+
{
|
|
622
|
+
color: "rgb(255, 180, 50)",
|
|
623
|
+
pos: "2% 68%",
|
|
624
|
+
size: "9px 18px"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
color: "rgb(255, 150, 40)",
|
|
628
|
+
pos: "2% 68%",
|
|
629
|
+
size: "4px 8px"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
color: "rgb(255, 80, 60)",
|
|
633
|
+
pos: "72% -3%",
|
|
634
|
+
size: "59px 9px"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
color: "rgb(255, 100, 80)",
|
|
638
|
+
pos: "74% 100%",
|
|
639
|
+
size: "42px 7px"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
color: "rgb(255, 60, 80)",
|
|
643
|
+
pos: "100% 27%",
|
|
644
|
+
size: "10px 17px"
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
color: "rgb(255, 120, 60)",
|
|
648
|
+
pos: "100% 27%",
|
|
649
|
+
size: "10px 18px"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
color: "rgb(255, 200, 50)",
|
|
653
|
+
pos: "100% 27%",
|
|
654
|
+
size: "5px 10px"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
color: "rgb(255, 90, 70)",
|
|
658
|
+
pos: "100% 27%",
|
|
659
|
+
size: "11px 12px"
|
|
660
|
+
}
|
|
661
|
+
],
|
|
662
|
+
inner: [
|
|
663
|
+
{
|
|
664
|
+
color: "rgba(255, 180, 50, 0.5)",
|
|
665
|
+
pos: "2% 68%",
|
|
666
|
+
size: "9px 18px"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
color: "rgba(255, 150, 40, 0.45)",
|
|
670
|
+
pos: "2% 68%",
|
|
671
|
+
size: "4px 8px"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
color: "rgba(255, 80, 60, 0.35)",
|
|
675
|
+
pos: "72% -3%",
|
|
676
|
+
size: "59px 9px"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
color: "rgba(255, 100, 80, 0.35)",
|
|
680
|
+
pos: "74% 100%",
|
|
681
|
+
size: "42px 7px"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
color: "rgba(255, 60, 80, 0.3)",
|
|
685
|
+
pos: "100% 27%",
|
|
686
|
+
size: "10px 17px"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
color: "rgba(255, 120, 60, 0.4)",
|
|
690
|
+
pos: "100% 27%",
|
|
691
|
+
size: "10px 18px"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
color: "rgba(255, 200, 50, 0.3)",
|
|
695
|
+
pos: "100% 27%",
|
|
696
|
+
size: "5px 10px"
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
color: "rgba(255, 90, 70, 0.3)",
|
|
700
|
+
pos: "100% 27%",
|
|
701
|
+
size: "11px 12px"
|
|
702
|
+
}
|
|
703
|
+
]
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* @param colorVariant
|
|
709
|
+
*/
|
|
710
|
+
function getSmallColorGradients(colorVariant) {
|
|
711
|
+
return smallColorPalettes[colorVariant].border.map((c) => {
|
|
712
|
+
const [w, h] = c.size.split(" ").map((s) => parseFloat(s));
|
|
713
|
+
return `radial-gradient(ellipse calc(${w}px * var(--beam-density, 1)) calc(${h}px * var(--beam-density, 1)) at ${c.pos}, ${c.color}, transparent)`;
|
|
714
|
+
}).join(",\n ");
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
*
|
|
718
|
+
* @param colorVariant
|
|
719
|
+
*/
|
|
720
|
+
function getSmallInnerGradients(colorVariant) {
|
|
721
|
+
return smallColorPalettes[colorVariant].inner.map((c) => {
|
|
722
|
+
const [w, h] = c.size.split(" ").map((s) => parseFloat(s));
|
|
723
|
+
return `radial-gradient(ellipse calc(${w}px * var(--beam-density, 1)) calc(${h}px * var(--beam-density, 1)) at ${c.pos}, ${c.color}, transparent)`;
|
|
724
|
+
}).join(",\n ");
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
*
|
|
728
|
+
* @param colorVariant
|
|
729
|
+
*/
|
|
730
|
+
function getColorGradients(colorVariant) {
|
|
731
|
+
return colorPalettes[colorVariant].border.map((c) => {
|
|
732
|
+
const [w, h] = c.size.split(" ").map((s) => parseFloat(s));
|
|
733
|
+
return `radial-gradient(ellipse calc(${w}px * var(--beam-density, 1)) calc(${h}px * var(--beam-density, 1)) at ${c.pos}, ${c.color}, transparent)`;
|
|
734
|
+
}).join(",\n ");
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
*
|
|
738
|
+
* @param colorVariant
|
|
739
|
+
*/
|
|
740
|
+
function getInnerGradients(colorVariant) {
|
|
741
|
+
const palette = colorPalettes[colorVariant];
|
|
742
|
+
const baseOpacity = colorVariant === "mono" ? .225 : .45;
|
|
743
|
+
return palette.border.map((c) => {
|
|
744
|
+
const rgba = c.color.replace("rgb(", "rgba(").replace(")", `, ${baseOpacity})`);
|
|
745
|
+
return `radial-gradient(ellipse ${c.size.split(" ").map((s) => {
|
|
746
|
+
return `calc(${Math.round(parseInt(s) * .9)}px * var(--beam-density, 1))`;
|
|
747
|
+
}).join(" ")} at ${c.pos}, ${rgba}, transparent)`;
|
|
748
|
+
}).join(",\n ");
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
*
|
|
752
|
+
* @param colorVariant
|
|
753
|
+
* @param isDark
|
|
754
|
+
*/
|
|
755
|
+
function getSpikeColors(colorVariant, isDark) {
|
|
756
|
+
const palette = colorPalettes[colorVariant];
|
|
757
|
+
return isDark ? palette.spike : palette.spikeLt;
|
|
758
|
+
}
|
|
759
|
+
var lineColorPalettes = {
|
|
760
|
+
colorful: {
|
|
761
|
+
dark: [
|
|
762
|
+
{
|
|
763
|
+
color: "rgb(255, 50, 100)",
|
|
764
|
+
sizeW: 36,
|
|
765
|
+
sizeH: 36,
|
|
766
|
+
offsetX: 0,
|
|
767
|
+
offsetY: 2
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
color: "rgb(40, 180, 220)",
|
|
771
|
+
sizeW: 30,
|
|
772
|
+
sizeH: 32,
|
|
773
|
+
offsetX: 39,
|
|
774
|
+
offsetY: 0
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
color: "rgb(50, 200, 80)",
|
|
778
|
+
sizeW: 33,
|
|
779
|
+
sizeH: 28,
|
|
780
|
+
offsetX: -36,
|
|
781
|
+
offsetY: 2
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
color: "rgb(180, 40, 240)",
|
|
785
|
+
sizeW: 29,
|
|
786
|
+
sizeH: 34,
|
|
787
|
+
offsetX: -54,
|
|
788
|
+
offsetY: 0
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
color: "rgb(255, 160, 30)",
|
|
792
|
+
sizeW: 27,
|
|
793
|
+
sizeH: 30,
|
|
794
|
+
offsetX: 51,
|
|
795
|
+
offsetY: -1
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
color: "rgb(100, 70, 255)",
|
|
799
|
+
sizeW: 36,
|
|
800
|
+
sizeH: 24,
|
|
801
|
+
offsetX: 21,
|
|
802
|
+
offsetY: 1
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
color: "rgb(40, 140, 255)",
|
|
806
|
+
sizeW: 30,
|
|
807
|
+
sizeH: 22,
|
|
808
|
+
offsetX: -21,
|
|
809
|
+
offsetY: 0
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
color: "rgb(240, 50, 180)",
|
|
813
|
+
sizeW: 25,
|
|
814
|
+
sizeH: 28,
|
|
815
|
+
offsetX: 66,
|
|
816
|
+
offsetY: 1
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
color: "rgb(30, 185, 170)",
|
|
820
|
+
sizeW: 23,
|
|
821
|
+
sizeH: 30,
|
|
822
|
+
offsetX: -66,
|
|
823
|
+
offsetY: -1
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
light: [
|
|
827
|
+
{
|
|
828
|
+
color: "rgb(255, 50, 100)",
|
|
829
|
+
sizeW: 45,
|
|
830
|
+
sizeH: 36,
|
|
831
|
+
offsetX: 0,
|
|
832
|
+
offsetY: 2
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
color: "rgb(40, 140, 255)",
|
|
836
|
+
sizeW: 35,
|
|
837
|
+
sizeH: 32,
|
|
838
|
+
offsetX: 65,
|
|
839
|
+
offsetY: 0
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
color: "rgb(50, 200, 80)",
|
|
843
|
+
sizeW: 40,
|
|
844
|
+
sizeH: 28,
|
|
845
|
+
offsetX: -60,
|
|
846
|
+
offsetY: 2
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
color: "rgb(180, 40, 240)",
|
|
850
|
+
sizeW: 35,
|
|
851
|
+
sizeH: 34,
|
|
852
|
+
offsetX: -90,
|
|
853
|
+
offsetY: 0
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
color: "rgb(30, 185, 170)",
|
|
857
|
+
sizeW: 38,
|
|
858
|
+
sizeH: 30,
|
|
859
|
+
offsetX: 85,
|
|
860
|
+
offsetY: -1
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
color: "rgb(100, 70, 255)",
|
|
864
|
+
sizeW: 50,
|
|
865
|
+
sizeH: 24,
|
|
866
|
+
offsetX: 35,
|
|
867
|
+
offsetY: 1
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
color: "rgb(40, 140, 255)",
|
|
871
|
+
sizeW: 40,
|
|
872
|
+
sizeH: 22,
|
|
873
|
+
offsetX: -35,
|
|
874
|
+
offsetY: 0
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
color: "rgb(255, 120, 40)",
|
|
878
|
+
sizeW: 35,
|
|
879
|
+
sizeH: 28,
|
|
880
|
+
offsetX: 110,
|
|
881
|
+
offsetY: 1
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
color: "rgb(240, 50, 180)",
|
|
885
|
+
sizeW: 30,
|
|
886
|
+
sizeH: 30,
|
|
887
|
+
offsetX: -110,
|
|
888
|
+
offsetY: -1
|
|
889
|
+
}
|
|
890
|
+
]
|
|
891
|
+
},
|
|
892
|
+
mono: {
|
|
893
|
+
dark: [
|
|
894
|
+
{
|
|
895
|
+
color: "rgb(200, 200, 200)",
|
|
896
|
+
sizeW: 36,
|
|
897
|
+
sizeH: 36,
|
|
898
|
+
offsetX: 0,
|
|
899
|
+
offsetY: 2
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
color: "rgb(170, 170, 170)",
|
|
903
|
+
sizeW: 30,
|
|
904
|
+
sizeH: 32,
|
|
905
|
+
offsetX: 39,
|
|
906
|
+
offsetY: 0
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
color: "rgb(155, 155, 155)",
|
|
910
|
+
sizeW: 33,
|
|
911
|
+
sizeH: 28,
|
|
912
|
+
offsetX: -36,
|
|
913
|
+
offsetY: 2
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
color: "rgb(185, 185, 185)",
|
|
917
|
+
sizeW: 29,
|
|
918
|
+
sizeH: 34,
|
|
919
|
+
offsetX: -54,
|
|
920
|
+
offsetY: 0
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
color: "rgb(165, 165, 165)",
|
|
924
|
+
sizeW: 27,
|
|
925
|
+
sizeH: 30,
|
|
926
|
+
offsetX: 51,
|
|
927
|
+
offsetY: -1
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
color: "rgb(180, 180, 180)",
|
|
931
|
+
sizeW: 36,
|
|
932
|
+
sizeH: 24,
|
|
933
|
+
offsetX: 21,
|
|
934
|
+
offsetY: 1
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
color: "rgb(160, 160, 160)",
|
|
938
|
+
sizeW: 30,
|
|
939
|
+
sizeH: 22,
|
|
940
|
+
offsetX: -21,
|
|
941
|
+
offsetY: 0
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
color: "rgb(175, 175, 175)",
|
|
945
|
+
sizeW: 25,
|
|
946
|
+
sizeH: 28,
|
|
947
|
+
offsetX: 66,
|
|
948
|
+
offsetY: 1
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
color: "rgb(190, 190, 190)",
|
|
952
|
+
sizeW: 23,
|
|
953
|
+
sizeH: 30,
|
|
954
|
+
offsetX: -66,
|
|
955
|
+
offsetY: -1
|
|
956
|
+
}
|
|
957
|
+
],
|
|
958
|
+
light: [
|
|
959
|
+
{
|
|
960
|
+
color: "rgb(100, 100, 100)",
|
|
961
|
+
sizeW: 45,
|
|
962
|
+
sizeH: 36,
|
|
963
|
+
offsetX: 0,
|
|
964
|
+
offsetY: 2
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
color: "rgb(80, 80, 80)",
|
|
968
|
+
sizeW: 35,
|
|
969
|
+
sizeH: 32,
|
|
970
|
+
offsetX: 65,
|
|
971
|
+
offsetY: 0
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
color: "rgb(90, 90, 90)",
|
|
975
|
+
sizeW: 40,
|
|
976
|
+
sizeH: 28,
|
|
977
|
+
offsetX: -60,
|
|
978
|
+
offsetY: 2
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
color: "rgb(70, 70, 70)",
|
|
982
|
+
sizeW: 35,
|
|
983
|
+
sizeH: 34,
|
|
984
|
+
offsetX: -90,
|
|
985
|
+
offsetY: 0
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
color: "rgb(85, 85, 85)",
|
|
989
|
+
sizeW: 38,
|
|
990
|
+
sizeH: 30,
|
|
991
|
+
offsetX: 85,
|
|
992
|
+
offsetY: -1
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
color: "rgb(95, 95, 95)",
|
|
996
|
+
sizeW: 50,
|
|
997
|
+
sizeH: 24,
|
|
998
|
+
offsetX: 35,
|
|
999
|
+
offsetY: 1
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
color: "rgb(75, 75, 75)",
|
|
1003
|
+
sizeW: 40,
|
|
1004
|
+
sizeH: 22,
|
|
1005
|
+
offsetX: -35,
|
|
1006
|
+
offsetY: 0
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
color: "rgb(105, 105, 105)",
|
|
1010
|
+
sizeW: 35,
|
|
1011
|
+
sizeH: 28,
|
|
1012
|
+
offsetX: 110,
|
|
1013
|
+
offsetY: 1
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
color: "rgb(65, 65, 65)",
|
|
1017
|
+
sizeW: 30,
|
|
1018
|
+
sizeH: 30,
|
|
1019
|
+
offsetX: -110,
|
|
1020
|
+
offsetY: -1
|
|
1021
|
+
}
|
|
1022
|
+
]
|
|
1023
|
+
},
|
|
1024
|
+
ocean: {
|
|
1025
|
+
dark: [
|
|
1026
|
+
{
|
|
1027
|
+
color: "rgb(100, 80, 220)",
|
|
1028
|
+
sizeW: 36,
|
|
1029
|
+
sizeH: 36,
|
|
1030
|
+
offsetX: 0,
|
|
1031
|
+
offsetY: 2
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
color: "rgb(60, 120, 255)",
|
|
1035
|
+
sizeW: 30,
|
|
1036
|
+
sizeH: 32,
|
|
1037
|
+
offsetX: 39,
|
|
1038
|
+
offsetY: 0
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
color: "rgb(80, 100, 200)",
|
|
1042
|
+
sizeW: 33,
|
|
1043
|
+
sizeH: 28,
|
|
1044
|
+
offsetX: -36,
|
|
1045
|
+
offsetY: 2
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
color: "rgb(130, 70, 255)",
|
|
1049
|
+
sizeW: 29,
|
|
1050
|
+
sizeH: 34,
|
|
1051
|
+
offsetX: -54,
|
|
1052
|
+
offsetY: 0
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
color: "rgb(70, 130, 255)",
|
|
1056
|
+
sizeW: 27,
|
|
1057
|
+
sizeH: 30,
|
|
1058
|
+
offsetX: 51,
|
|
1059
|
+
offsetY: -1
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
color: "rgb(120, 80, 255)",
|
|
1063
|
+
sizeW: 36,
|
|
1064
|
+
sizeH: 24,
|
|
1065
|
+
offsetX: 21,
|
|
1066
|
+
offsetY: 1
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
color: "rgb(90, 110, 230)",
|
|
1070
|
+
sizeW: 30,
|
|
1071
|
+
sizeH: 22,
|
|
1072
|
+
offsetX: -21,
|
|
1073
|
+
offsetY: 0
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
color: "rgb(110, 90, 240)",
|
|
1077
|
+
sizeW: 25,
|
|
1078
|
+
sizeH: 28,
|
|
1079
|
+
offsetX: 66,
|
|
1080
|
+
offsetY: 1
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
color: "rgb(140, 100, 255)",
|
|
1084
|
+
sizeW: 23,
|
|
1085
|
+
sizeH: 30,
|
|
1086
|
+
offsetX: -66,
|
|
1087
|
+
offsetY: -1
|
|
1088
|
+
}
|
|
1089
|
+
],
|
|
1090
|
+
light: [
|
|
1091
|
+
{
|
|
1092
|
+
color: "rgb(80, 60, 200)",
|
|
1093
|
+
sizeW: 45,
|
|
1094
|
+
sizeH: 36,
|
|
1095
|
+
offsetX: 0,
|
|
1096
|
+
offsetY: 2
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
color: "rgb(50, 100, 220)",
|
|
1100
|
+
sizeW: 35,
|
|
1101
|
+
sizeH: 32,
|
|
1102
|
+
offsetX: 65,
|
|
1103
|
+
offsetY: 0
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
color: "rgb(70, 90, 190)",
|
|
1107
|
+
sizeW: 40,
|
|
1108
|
+
sizeH: 28,
|
|
1109
|
+
offsetX: -60,
|
|
1110
|
+
offsetY: 2
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
color: "rgb(110, 60, 220)",
|
|
1114
|
+
sizeW: 35,
|
|
1115
|
+
sizeH: 34,
|
|
1116
|
+
offsetX: -90,
|
|
1117
|
+
offsetY: 0
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
color: "rgb(60, 110, 230)",
|
|
1121
|
+
sizeW: 38,
|
|
1122
|
+
sizeH: 30,
|
|
1123
|
+
offsetX: 85,
|
|
1124
|
+
offsetY: -1
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
color: "rgb(100, 70, 240)",
|
|
1128
|
+
sizeW: 50,
|
|
1129
|
+
sizeH: 24,
|
|
1130
|
+
offsetX: 35,
|
|
1131
|
+
offsetY: 1
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
color: "rgb(80, 100, 210)",
|
|
1135
|
+
sizeW: 40,
|
|
1136
|
+
sizeH: 22,
|
|
1137
|
+
offsetX: -35,
|
|
1138
|
+
offsetY: 0
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
color: "rgb(90, 80, 225)",
|
|
1142
|
+
sizeW: 35,
|
|
1143
|
+
sizeH: 28,
|
|
1144
|
+
offsetX: 110,
|
|
1145
|
+
offsetY: 1
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
color: "rgb(120, 90, 245)",
|
|
1149
|
+
sizeW: 30,
|
|
1150
|
+
sizeH: 30,
|
|
1151
|
+
offsetX: -110,
|
|
1152
|
+
offsetY: -1
|
|
1153
|
+
}
|
|
1154
|
+
]
|
|
1155
|
+
},
|
|
1156
|
+
sunset: {
|
|
1157
|
+
dark: [
|
|
1158
|
+
{
|
|
1159
|
+
color: "rgb(255, 100, 60)",
|
|
1160
|
+
sizeW: 36,
|
|
1161
|
+
sizeH: 36,
|
|
1162
|
+
offsetX: 0,
|
|
1163
|
+
offsetY: 2
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
color: "rgb(255, 180, 50)",
|
|
1167
|
+
sizeW: 30,
|
|
1168
|
+
sizeH: 32,
|
|
1169
|
+
offsetX: 39,
|
|
1170
|
+
offsetY: 0
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
color: "rgb(255, 140, 70)",
|
|
1174
|
+
sizeW: 33,
|
|
1175
|
+
sizeH: 28,
|
|
1176
|
+
offsetX: -36,
|
|
1177
|
+
offsetY: 2
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
color: "rgb(255, 80, 80)",
|
|
1181
|
+
sizeW: 29,
|
|
1182
|
+
sizeH: 34,
|
|
1183
|
+
offsetX: -54,
|
|
1184
|
+
offsetY: 0
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
color: "rgb(255, 200, 60)",
|
|
1188
|
+
sizeW: 27,
|
|
1189
|
+
sizeH: 30,
|
|
1190
|
+
offsetX: 51,
|
|
1191
|
+
offsetY: -1
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
color: "rgb(255, 120, 50)",
|
|
1195
|
+
sizeW: 36,
|
|
1196
|
+
sizeH: 24,
|
|
1197
|
+
offsetX: 21,
|
|
1198
|
+
offsetY: 1
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
color: "rgb(255, 160, 80)",
|
|
1202
|
+
sizeW: 30,
|
|
1203
|
+
sizeH: 22,
|
|
1204
|
+
offsetX: -21,
|
|
1205
|
+
offsetY: 0
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
color: "rgb(255, 90, 60)",
|
|
1209
|
+
sizeW: 25,
|
|
1210
|
+
sizeH: 28,
|
|
1211
|
+
offsetX: 66,
|
|
1212
|
+
offsetY: 1
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
color: "rgb(255, 70, 70)",
|
|
1216
|
+
sizeW: 23,
|
|
1217
|
+
sizeH: 30,
|
|
1218
|
+
offsetX: -66,
|
|
1219
|
+
offsetY: -1
|
|
1220
|
+
}
|
|
1221
|
+
],
|
|
1222
|
+
light: [
|
|
1223
|
+
{
|
|
1224
|
+
color: "rgb(220, 80, 40)",
|
|
1225
|
+
sizeW: 45,
|
|
1226
|
+
sizeH: 36,
|
|
1227
|
+
offsetX: 0,
|
|
1228
|
+
offsetY: 2
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
color: "rgb(230, 150, 30)",
|
|
1232
|
+
sizeW: 35,
|
|
1233
|
+
sizeH: 32,
|
|
1234
|
+
offsetX: 65,
|
|
1235
|
+
offsetY: 0
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
color: "rgb(210, 110, 50)",
|
|
1239
|
+
sizeW: 40,
|
|
1240
|
+
sizeH: 28,
|
|
1241
|
+
offsetX: -60,
|
|
1242
|
+
offsetY: 2
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
color: "rgb(200, 60, 60)",
|
|
1246
|
+
sizeW: 35,
|
|
1247
|
+
sizeH: 34,
|
|
1248
|
+
offsetX: -90,
|
|
1249
|
+
offsetY: 0
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
color: "rgb(220, 170, 40)",
|
|
1253
|
+
sizeW: 38,
|
|
1254
|
+
sizeH: 30,
|
|
1255
|
+
offsetX: 85,
|
|
1256
|
+
offsetY: -1
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
color: "rgb(210, 100, 30)",
|
|
1260
|
+
sizeW: 50,
|
|
1261
|
+
sizeH: 24,
|
|
1262
|
+
offsetX: 35,
|
|
1263
|
+
offsetY: 1
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
color: "rgb(230, 130, 60)",
|
|
1267
|
+
sizeW: 40,
|
|
1268
|
+
sizeH: 22,
|
|
1269
|
+
offsetX: -35,
|
|
1270
|
+
offsetY: 0
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
color: "rgb(190, 70, 50)",
|
|
1274
|
+
sizeW: 35,
|
|
1275
|
+
sizeH: 28,
|
|
1276
|
+
offsetX: 110,
|
|
1277
|
+
offsetY: 1
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
color: "rgb(180, 50, 50)",
|
|
1281
|
+
sizeW: 30,
|
|
1282
|
+
sizeH: 30,
|
|
1283
|
+
offsetX: -110,
|
|
1284
|
+
offsetY: -1
|
|
1285
|
+
}
|
|
1286
|
+
]
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
/**
|
|
1290
|
+
*
|
|
1291
|
+
* @param colorVariant
|
|
1292
|
+
* @param isDark
|
|
1293
|
+
* @param id
|
|
1294
|
+
*/
|
|
1295
|
+
function getLineColorGradients(colorVariant, isDark, id) {
|
|
1296
|
+
return lineColorPalettes[colorVariant][isDark ? "dark" : "light"].map((c) => {
|
|
1297
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
1298
|
+
const offsetYStr = c.offsetY === 0 ? "" : c.offsetY > 0 ? ` + ${c.offsetY}px` : ` - ${Math.abs(c.offsetY)}px`;
|
|
1299
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-density, 1) * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
1300
|
+
}).join(",\n ");
|
|
1301
|
+
}
|
|
1302
|
+
var lineInnerGradientData = {
|
|
1303
|
+
colorful: [
|
|
1304
|
+
{
|
|
1305
|
+
color: "rgba(255, 50, 100, 0.48)",
|
|
1306
|
+
sizeW: 33,
|
|
1307
|
+
sizeH: 30,
|
|
1308
|
+
offsetX: 0,
|
|
1309
|
+
offsetY: 0
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
color: "rgba(40, 180, 220, 0.42)",
|
|
1313
|
+
sizeW: 24,
|
|
1314
|
+
sizeH: 26,
|
|
1315
|
+
offsetX: 39,
|
|
1316
|
+
offsetY: -3
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
color: "rgba(50, 200, 80, 0.48)",
|
|
1320
|
+
sizeW: 27,
|
|
1321
|
+
sizeH: 24,
|
|
1322
|
+
offsetX: -36,
|
|
1323
|
+
offsetY: 0
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
color: "rgba(180, 40, 240, 0.42)",
|
|
1327
|
+
sizeW: 23,
|
|
1328
|
+
sizeH: 28,
|
|
1329
|
+
offsetX: -54,
|
|
1330
|
+
offsetY: -2
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
color: "rgba(255, 160, 30, 0.50)",
|
|
1334
|
+
sizeW: 24,
|
|
1335
|
+
sizeH: 24,
|
|
1336
|
+
offsetX: 51,
|
|
1337
|
+
offsetY: -1
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
color: "rgba(100, 70, 255, 0.45)",
|
|
1341
|
+
sizeW: 30,
|
|
1342
|
+
sizeH: 20,
|
|
1343
|
+
offsetX: 21,
|
|
1344
|
+
offsetY: 0
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
color: "rgba(40, 140, 255, 0.40)",
|
|
1348
|
+
sizeW: 25,
|
|
1349
|
+
sizeH: 18,
|
|
1350
|
+
offsetX: -21,
|
|
1351
|
+
offsetY: -2
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
color: "rgba(240, 50, 180, 0.45)",
|
|
1355
|
+
sizeW: 21,
|
|
1356
|
+
sizeH: 24,
|
|
1357
|
+
offsetX: 66,
|
|
1358
|
+
offsetY: 0
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
color: "rgba(30, 185, 170, 0.52)",
|
|
1362
|
+
sizeW: 18,
|
|
1363
|
+
sizeH: 26,
|
|
1364
|
+
offsetX: -66,
|
|
1365
|
+
offsetY: -1
|
|
1366
|
+
}
|
|
1367
|
+
],
|
|
1368
|
+
mono: [
|
|
1369
|
+
{
|
|
1370
|
+
color: "rgba(200, 200, 200, 0.48)",
|
|
1371
|
+
sizeW: 33,
|
|
1372
|
+
sizeH: 30,
|
|
1373
|
+
offsetX: 0,
|
|
1374
|
+
offsetY: 0
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
color: "rgba(170, 170, 170, 0.42)",
|
|
1378
|
+
sizeW: 24,
|
|
1379
|
+
sizeH: 26,
|
|
1380
|
+
offsetX: 39,
|
|
1381
|
+
offsetY: -3
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
color: "rgba(155, 155, 155, 0.48)",
|
|
1385
|
+
sizeW: 27,
|
|
1386
|
+
sizeH: 24,
|
|
1387
|
+
offsetX: -36,
|
|
1388
|
+
offsetY: 0
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
color: "rgba(185, 185, 185, 0.42)",
|
|
1392
|
+
sizeW: 23,
|
|
1393
|
+
sizeH: 28,
|
|
1394
|
+
offsetX: -54,
|
|
1395
|
+
offsetY: -2
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
color: "rgba(165, 165, 165, 0.50)",
|
|
1399
|
+
sizeW: 24,
|
|
1400
|
+
sizeH: 24,
|
|
1401
|
+
offsetX: 51,
|
|
1402
|
+
offsetY: -1
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
color: "rgba(180, 180, 180, 0.45)",
|
|
1406
|
+
sizeW: 30,
|
|
1407
|
+
sizeH: 20,
|
|
1408
|
+
offsetX: 21,
|
|
1409
|
+
offsetY: 0
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
color: "rgba(160, 160, 160, 0.40)",
|
|
1413
|
+
sizeW: 25,
|
|
1414
|
+
sizeH: 18,
|
|
1415
|
+
offsetX: -21,
|
|
1416
|
+
offsetY: -2
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
color: "rgba(175, 175, 175, 0.45)",
|
|
1420
|
+
sizeW: 21,
|
|
1421
|
+
sizeH: 24,
|
|
1422
|
+
offsetX: 66,
|
|
1423
|
+
offsetY: 0
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
color: "rgba(190, 190, 190, 0.52)",
|
|
1427
|
+
sizeW: 18,
|
|
1428
|
+
sizeH: 26,
|
|
1429
|
+
offsetX: -66,
|
|
1430
|
+
offsetY: -1
|
|
1431
|
+
}
|
|
1432
|
+
],
|
|
1433
|
+
ocean: [
|
|
1434
|
+
{
|
|
1435
|
+
color: "rgba(100, 80, 220, 0.48)",
|
|
1436
|
+
sizeW: 33,
|
|
1437
|
+
sizeH: 30,
|
|
1438
|
+
offsetX: 0,
|
|
1439
|
+
offsetY: 0
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
color: "rgba(60, 120, 255, 0.42)",
|
|
1443
|
+
sizeW: 24,
|
|
1444
|
+
sizeH: 26,
|
|
1445
|
+
offsetX: 39,
|
|
1446
|
+
offsetY: -3
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
color: "rgba(80, 100, 200, 0.48)",
|
|
1450
|
+
sizeW: 27,
|
|
1451
|
+
sizeH: 24,
|
|
1452
|
+
offsetX: -36,
|
|
1453
|
+
offsetY: 0
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
color: "rgba(130, 70, 255, 0.42)",
|
|
1457
|
+
sizeW: 23,
|
|
1458
|
+
sizeH: 28,
|
|
1459
|
+
offsetX: -54,
|
|
1460
|
+
offsetY: -2
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
color: "rgba(70, 130, 255, 0.50)",
|
|
1464
|
+
sizeW: 24,
|
|
1465
|
+
sizeH: 24,
|
|
1466
|
+
offsetX: 51,
|
|
1467
|
+
offsetY: -1
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
color: "rgba(120, 80, 255, 0.45)",
|
|
1471
|
+
sizeW: 30,
|
|
1472
|
+
sizeH: 20,
|
|
1473
|
+
offsetX: 21,
|
|
1474
|
+
offsetY: 0
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
color: "rgba(90, 110, 230, 0.40)",
|
|
1478
|
+
sizeW: 25,
|
|
1479
|
+
sizeH: 18,
|
|
1480
|
+
offsetX: -21,
|
|
1481
|
+
offsetY: -2
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
color: "rgba(110, 90, 240, 0.45)",
|
|
1485
|
+
sizeW: 21,
|
|
1486
|
+
sizeH: 24,
|
|
1487
|
+
offsetX: 66,
|
|
1488
|
+
offsetY: 0
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
color: "rgba(140, 100, 255, 0.52)",
|
|
1492
|
+
sizeW: 18,
|
|
1493
|
+
sizeH: 26,
|
|
1494
|
+
offsetX: -66,
|
|
1495
|
+
offsetY: -1
|
|
1496
|
+
}
|
|
1497
|
+
],
|
|
1498
|
+
sunset: [
|
|
1499
|
+
{
|
|
1500
|
+
color: "rgba(255, 100, 60, 0.48)",
|
|
1501
|
+
sizeW: 33,
|
|
1502
|
+
sizeH: 30,
|
|
1503
|
+
offsetX: 0,
|
|
1504
|
+
offsetY: 0
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
color: "rgba(255, 180, 50, 0.42)",
|
|
1508
|
+
sizeW: 24,
|
|
1509
|
+
sizeH: 26,
|
|
1510
|
+
offsetX: 39,
|
|
1511
|
+
offsetY: -3
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
color: "rgba(255, 140, 70, 0.48)",
|
|
1515
|
+
sizeW: 27,
|
|
1516
|
+
sizeH: 24,
|
|
1517
|
+
offsetX: -36,
|
|
1518
|
+
offsetY: 0
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
color: "rgba(255, 80, 80, 0.42)",
|
|
1522
|
+
sizeW: 23,
|
|
1523
|
+
sizeH: 28,
|
|
1524
|
+
offsetX: -54,
|
|
1525
|
+
offsetY: -2
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
color: "rgba(255, 200, 60, 0.50)",
|
|
1529
|
+
sizeW: 24,
|
|
1530
|
+
sizeH: 24,
|
|
1531
|
+
offsetX: 51,
|
|
1532
|
+
offsetY: -1
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
color: "rgba(255, 120, 50, 0.45)",
|
|
1536
|
+
sizeW: 30,
|
|
1537
|
+
sizeH: 20,
|
|
1538
|
+
offsetX: 21,
|
|
1539
|
+
offsetY: 0
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
color: "rgba(255, 160, 80, 0.40)",
|
|
1543
|
+
sizeW: 25,
|
|
1544
|
+
sizeH: 18,
|
|
1545
|
+
offsetX: -21,
|
|
1546
|
+
offsetY: -2
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
color: "rgba(255, 90, 60, 0.45)",
|
|
1550
|
+
sizeW: 21,
|
|
1551
|
+
sizeH: 24,
|
|
1552
|
+
offsetX: 66,
|
|
1553
|
+
offsetY: 0
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
color: "rgba(255, 70, 70, 0.52)",
|
|
1557
|
+
sizeW: 18,
|
|
1558
|
+
sizeH: 26,
|
|
1559
|
+
offsetX: -66,
|
|
1560
|
+
offsetY: -1
|
|
1561
|
+
}
|
|
1562
|
+
]
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
*
|
|
1566
|
+
* @param colorVariant
|
|
1567
|
+
* @param id
|
|
1568
|
+
*/
|
|
1569
|
+
function getLineInnerGradients(colorVariant, id) {
|
|
1570
|
+
return lineInnerGradientData[colorVariant].map((c) => {
|
|
1571
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
1572
|
+
const offsetYStr = c.offsetY === 0 ? "" : ` - ${Math.abs(c.offsetY)}px`;
|
|
1573
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-density, 1) * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
1574
|
+
}).join(",\n ");
|
|
1575
|
+
}
|
|
1576
|
+
var lineBloomColors = {
|
|
1577
|
+
colorful: {
|
|
1578
|
+
dark: { spikes: [
|
|
1579
|
+
{
|
|
1580
|
+
color1: "rgb(100, 70, 255)",
|
|
1581
|
+
color2: "rgba(100, 70, 255, 1)"
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
color1: "rgba(255, 170, 40, 0.59)",
|
|
1585
|
+
color2: "rgba(255, 170, 40, 0.29)"
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
color1: "rgb(50, 200, 100)",
|
|
1589
|
+
color2: "rgba(50, 200, 100, 1)"
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
color1: "rgba(200, 50, 240, 0.91)",
|
|
1593
|
+
color2: "rgba(200, 50, 240, 0.45)"
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
color1: "rgb(40, 140, 255)",
|
|
1597
|
+
color2: "rgba(40, 140, 255, 1)"
|
|
1598
|
+
}
|
|
1599
|
+
] },
|
|
1600
|
+
light: { spikes: [
|
|
1601
|
+
{
|
|
1602
|
+
color1: "rgb(80, 50, 200)",
|
|
1603
|
+
color2: "rgba(80, 50, 200, 0.8)"
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
color1: "rgba(210, 130, 0, 0.7)",
|
|
1607
|
+
color2: "rgba(210, 130, 0, 0.46)"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
color1: "rgb(30, 160, 70)",
|
|
1611
|
+
color2: "rgba(30, 160, 70, 0.82)"
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
color1: "rgb(160, 30, 190)",
|
|
1615
|
+
color2: "rgba(160, 30, 190, 0.7)"
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
color1: "rgb(30, 100, 200)",
|
|
1619
|
+
color2: "rgba(30, 100, 200, 0.78)"
|
|
1620
|
+
}
|
|
1621
|
+
] }
|
|
1622
|
+
},
|
|
1623
|
+
mono: {
|
|
1624
|
+
dark: { spikes: [
|
|
1625
|
+
{
|
|
1626
|
+
color1: "rgb(200, 200, 200)",
|
|
1627
|
+
color2: "rgba(200, 200, 200, 1)"
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
color1: "rgba(180, 180, 180, 0.59)",
|
|
1631
|
+
color2: "rgba(180, 180, 180, 0.29)"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
color1: "rgb(190, 190, 190)",
|
|
1635
|
+
color2: "rgba(190, 190, 190, 1)"
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
color1: "rgba(170, 170, 170, 0.91)",
|
|
1639
|
+
color2: "rgba(170, 170, 170, 0.45)"
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
color1: "rgb(185, 185, 185)",
|
|
1643
|
+
color2: "rgba(185, 185, 185, 1)"
|
|
1644
|
+
}
|
|
1645
|
+
] },
|
|
1646
|
+
light: { spikes: [
|
|
1647
|
+
{
|
|
1648
|
+
color1: "rgb(80, 80, 80)",
|
|
1649
|
+
color2: "rgba(80, 80, 80, 0.8)"
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
color1: "rgba(100, 100, 100, 0.7)",
|
|
1653
|
+
color2: "rgba(100, 100, 100, 0.46)"
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
color1: "rgb(70, 70, 70)",
|
|
1657
|
+
color2: "rgba(70, 70, 70, 0.82)"
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
color1: "rgb(90, 90, 90)",
|
|
1661
|
+
color2: "rgba(90, 90, 90, 0.7)"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
color1: "rgb(85, 85, 85)",
|
|
1665
|
+
color2: "rgba(85, 85, 85, 0.78)"
|
|
1666
|
+
}
|
|
1667
|
+
] }
|
|
1668
|
+
},
|
|
1669
|
+
ocean: {
|
|
1670
|
+
dark: { spikes: [
|
|
1671
|
+
{
|
|
1672
|
+
color1: "rgb(100, 80, 255)",
|
|
1673
|
+
color2: "rgb(100, 80, 255)"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
color1: "rgba(80, 130, 220, 0.59)",
|
|
1677
|
+
color2: "rgba(80, 130, 220, 0.29)"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
color1: "rgb(60, 100, 255)",
|
|
1681
|
+
color2: "rgb(60, 100, 255)"
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
color1: "rgba(90, 120, 200, 0.91)",
|
|
1685
|
+
color2: "rgba(90, 120, 200, 0.45)"
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
color1: "rgb(120, 90, 255)",
|
|
1689
|
+
color2: "rgb(120, 90, 255)"
|
|
1690
|
+
}
|
|
1691
|
+
] },
|
|
1692
|
+
light: { spikes: [
|
|
1693
|
+
{
|
|
1694
|
+
color1: "rgb(50, 40, 180)",
|
|
1695
|
+
color2: "rgba(50, 40, 180, 0.8)"
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
color1: "rgba(40, 80, 200, 0.7)",
|
|
1699
|
+
color2: "rgba(40, 80, 200, 0.46)"
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1702
|
+
color1: "rgb(30, 50, 190)",
|
|
1703
|
+
color2: "rgba(30, 50, 190, 0.82)"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
color1: "rgb(60, 90, 180)",
|
|
1707
|
+
color2: "rgba(60, 90, 180, 0.7)"
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
color1: "rgb(70, 60, 200)",
|
|
1711
|
+
color2: "rgba(70, 60, 200, 0.78)"
|
|
1712
|
+
}
|
|
1713
|
+
] }
|
|
1714
|
+
},
|
|
1715
|
+
sunset: {
|
|
1716
|
+
dark: { spikes: [
|
|
1717
|
+
{
|
|
1718
|
+
color1: "rgb(255, 100, 80)",
|
|
1719
|
+
color2: "rgb(255, 100, 80)"
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
color1: "rgba(255, 150, 80, 0.59)",
|
|
1723
|
+
color2: "rgba(255, 150, 80, 0.29)"
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
color1: "rgb(255, 80, 60)",
|
|
1727
|
+
color2: "rgb(255, 80, 60)"
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
color1: "rgba(255, 120, 50, 0.91)",
|
|
1731
|
+
color2: "rgba(255, 120, 50, 0.45)"
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
color1: "rgb(255, 140, 70)",
|
|
1735
|
+
color2: "rgb(255, 140, 70)"
|
|
1736
|
+
}
|
|
1737
|
+
] },
|
|
1738
|
+
light: { spikes: [
|
|
1739
|
+
{
|
|
1740
|
+
color1: "rgb(200, 60, 30)",
|
|
1741
|
+
color2: "rgba(200, 60, 30, 0.8)"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
color1: "rgba(220, 100, 20, 0.7)",
|
|
1745
|
+
color2: "rgba(220, 100, 20, 0.46)"
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
color1: "rgb(180, 40, 20)",
|
|
1749
|
+
color2: "rgba(180, 40, 20, 0.82)"
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
color1: "rgb(210, 80, 10)",
|
|
1753
|
+
color2: "rgba(210, 80, 10, 0.7)"
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
color1: "rgb(190, 70, 30)",
|
|
1757
|
+
color2: "rgba(190, 70, 30, 0.78)"
|
|
1758
|
+
}
|
|
1759
|
+
] }
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
/**
|
|
1763
|
+
*
|
|
1764
|
+
* @param color
|
|
1765
|
+
* @param alpha
|
|
1766
|
+
*/
|
|
1767
|
+
function withAlpha(color, alpha) {
|
|
1768
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*[\d.]+\s*\)$/);
|
|
1769
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${alpha})`;
|
|
1770
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
1771
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${alpha})`;
|
|
1772
|
+
return color;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
*
|
|
1776
|
+
* @param color
|
|
1777
|
+
* @param factor
|
|
1778
|
+
*/
|
|
1779
|
+
function attenuateSpike(color, factor) {
|
|
1780
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
1781
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${(parseFloat(rgbaMatch[4]) * factor).toFixed(2)})`;
|
|
1782
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
1783
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${factor.toFixed(2)})`;
|
|
1784
|
+
return color;
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
*
|
|
1788
|
+
* @param colorVariant
|
|
1789
|
+
* @param isDark
|
|
1790
|
+
* @param id
|
|
1791
|
+
*/
|
|
1792
|
+
function getLineBloomGradients(colorVariant, isDark, id) {
|
|
1793
|
+
const spikeColors = getSpikeColors(colorVariant, isDark);
|
|
1794
|
+
const bloomData = lineBloomColors[colorVariant][isDark ? "dark" : "light"];
|
|
1795
|
+
const isMono = colorVariant === "mono";
|
|
1796
|
+
const att = isMono ? .14 : 1;
|
|
1797
|
+
const sc1 = isMono ? attenuateSpike(spikeColors.primary, .14) : spikeColors.primary;
|
|
1798
|
+
const sc1_mid = isMono ? attenuateSpike(spikeColors.primary, .09) : spikeColors.primary;
|
|
1799
|
+
const sc2 = isMono ? attenuateSpike(spikeColors.secondary, .12) : spikeColors.secondary;
|
|
1800
|
+
const sc2_mid = isMono ? withAlpha(spikeColors.secondary, .06) : withAlpha(spikeColors.secondary, .49);
|
|
1801
|
+
const spikes = bloomData.spikes.map((s) => isMono ? {
|
|
1802
|
+
color1: attenuateSpike(s.color1, att),
|
|
1803
|
+
color2: attenuateSpike(s.color2, att * .7)
|
|
1804
|
+
} : s);
|
|
1805
|
+
const thinW1 = isMono ? "12px" : "0.8px";
|
|
1806
|
+
const thinW2 = isMono ? "14px" : "2px";
|
|
1807
|
+
const thinW3 = isMono ? "12px" : "1.2px";
|
|
1808
|
+
const thinW4 = isMono ? "10px" : "0.6px";
|
|
1809
|
+
const thinH1 = isMono ? "42px" : "92px";
|
|
1810
|
+
const thinH2 = isMono ? "38px" : "72px";
|
|
1811
|
+
const thinH3 = isMono ? "40px" : "85px";
|
|
1812
|
+
const thinH4 = isMono ? "32px" : "60px";
|
|
1813
|
+
const thinLW = isMono ? "12px" : "1px";
|
|
1814
|
+
const glowDotC = isMono ? "rgba(255, 255, 255, 0.5)" : "rgba(255, 255, 255, 1)";
|
|
1815
|
+
const glowDot20 = isMono ? "rgba(255, 255, 255, 0.45)" : "rgba(255, 255, 255, 0.9)";
|
|
1816
|
+
const glowDot50 = isMono ? "rgba(255, 255, 255, 0.25)" : "rgba(255, 255, 255, 0.5)";
|
|
1817
|
+
const glowAmbC = isMono ? "rgba(255, 255, 255, 0.15)" : "rgba(255, 255, 255, 0.3)";
|
|
1818
|
+
const glowAmb25 = isMono ? "rgba(255, 255, 255, 0.06)" : "rgba(255, 255, 255, 0.12)";
|
|
1819
|
+
const glowAmb55 = isMono ? "rgba(255, 255, 255, 0.015)" : "rgba(255, 255, 255, 0.03)";
|
|
1820
|
+
if (isDark) return `radial-gradient(ellipse calc(${thinW1} * var(--beam-density, 1) * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-density, 1) * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_mid} 30%, transparent 88%),
|
|
1821
|
+
radial-gradient(ellipse calc(10px * var(--beam-density, 1) * var(--beam-spike2-${id})) calc(35px * var(--beam-density, 1) * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_mid} 50%, transparent 95%),
|
|
1822
|
+
radial-gradient(ellipse calc(${thinW2} * var(--beam-density, 1) * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-density, 1) * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
1823
|
+
radial-gradient(ellipse calc(14px * var(--beam-density, 1) * var(--beam-spike2-${id})) calc(28px * var(--beam-density, 1) * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
1824
|
+
radial-gradient(ellipse calc(${thinW3} * var(--beam-density, 1) * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-density, 1) * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
1825
|
+
radial-gradient(ellipse calc(7px * var(--beam-density, 1) * var(--beam-spike-${id})) calc(45px * var(--beam-density, 1) * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
1826
|
+
radial-gradient(ellipse calc(${thinW4} * var(--beam-density, 1) * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-density, 1) * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
1827
|
+
radial-gradient(ellipse calc(21px * var(--beam-density, 1) * var(--beam-spike-${id})) calc(15px * var(--beam-density, 1) * var(--beam-spike2-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 1px), ${glowDotC} 0%, ${glowDot20} 20%, ${glowDot50} 50%, transparent 100%),
|
|
1828
|
+
radial-gradient(ellipse calc(42px * var(--beam-density, 1) * var(--beam-w-${id})) calc(40px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%, ${glowAmbC} 0%, ${glowAmb25} 25%, ${glowAmb55} 55%, transparent 80%)`;
|
|
1829
|
+
else return `radial-gradient(ellipse calc(${thinW1} * var(--beam-density, 1) * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-density, 1) * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${isMono ? attenuateSpike(spikeColors.primary, .11) : withAlpha(spikeColors.primary, .85)} 30%, transparent 88%),
|
|
1830
|
+
radial-gradient(ellipse calc(10px * var(--beam-density, 1) * var(--beam-spike2-${id})) calc(35px * var(--beam-density, 1) * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${isMono ? attenuateSpike(spikeColors.secondary, .09) : withAlpha(spikeColors.secondary, .7)} 50%, transparent 95%),
|
|
1831
|
+
radial-gradient(ellipse calc(${thinW2} * var(--beam-density, 1) * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-density, 1) * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
1832
|
+
radial-gradient(ellipse calc(14px * var(--beam-density, 1) * var(--beam-spike2-${id})) calc(28px * var(--beam-density, 1) * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
1833
|
+
radial-gradient(ellipse calc(${thinW3} * var(--beam-density, 1) * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-density, 1) * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
1834
|
+
radial-gradient(ellipse calc(7px * var(--beam-density, 1) * var(--beam-spike-${id})) calc(45px * var(--beam-density, 1) * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
1835
|
+
radial-gradient(ellipse calc(${thinLW} * var(--beam-density, 1) * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-density, 1) * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
1836
|
+
radial-gradient(ellipse calc(50px * var(--beam-density, 1) * var(--beam-w-${id})) calc(32px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100%), rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.18) 30%, rgba(0, 0, 0, 0.03) 60%, transparent 85%)`;
|
|
1837
|
+
}
|
|
1838
|
+
var PULSE_RING_MAP = [
|
|
1839
|
+
{
|
|
1840
|
+
region: 1,
|
|
1841
|
+
quad: "tl"
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
region: 2,
|
|
1845
|
+
quad: "tl"
|
|
1846
|
+
},
|
|
1847
|
+
{
|
|
1848
|
+
region: 3,
|
|
1849
|
+
quad: "bl"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
region: 1,
|
|
1853
|
+
quad: "bl"
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
region: 2,
|
|
1857
|
+
quad: "br"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
region: 3,
|
|
1861
|
+
quad: "br"
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
region: 1,
|
|
1865
|
+
quad: "tr"
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
region: 2,
|
|
1869
|
+
quad: "tr"
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
region: 3,
|
|
1873
|
+
quad: "tr"
|
|
1874
|
+
}
|
|
1875
|
+
];
|
|
1876
|
+
var PULSE_INNER_SIZES = [
|
|
1877
|
+
[65, 35],
|
|
1878
|
+
[55, 30],
|
|
1879
|
+
[35, 65],
|
|
1880
|
+
[15, 30],
|
|
1881
|
+
[173, 28],
|
|
1882
|
+
[80, 22],
|
|
1883
|
+
[69, 28],
|
|
1884
|
+
[22, 38],
|
|
1885
|
+
[47, 44]
|
|
1886
|
+
];
|
|
1887
|
+
var PULSE_INNER_BLOOM = [
|
|
1888
|
+
{
|
|
1889
|
+
ci: 0,
|
|
1890
|
+
region: 1,
|
|
1891
|
+
quad: "tl",
|
|
1892
|
+
w: 84,
|
|
1893
|
+
h: 48
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
ci: 1,
|
|
1897
|
+
region: 2,
|
|
1898
|
+
quad: "tl",
|
|
1899
|
+
w: 72,
|
|
1900
|
+
h: 42
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
ci: 2,
|
|
1904
|
+
region: 3,
|
|
1905
|
+
quad: "bl",
|
|
1906
|
+
w: 48,
|
|
1907
|
+
h: 84
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
ci: 4,
|
|
1911
|
+
region: 2,
|
|
1912
|
+
quad: "br",
|
|
1913
|
+
w: 216,
|
|
1914
|
+
h: 38
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
ci: 5,
|
|
1918
|
+
region: 3,
|
|
1919
|
+
quad: "br",
|
|
1920
|
+
w: 102,
|
|
1921
|
+
h: 31
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
ci: 6,
|
|
1925
|
+
region: 1,
|
|
1926
|
+
quad: "tr",
|
|
1927
|
+
w: 89,
|
|
1928
|
+
h: 38
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
ci: 8,
|
|
1932
|
+
region: 3,
|
|
1933
|
+
quad: "tr",
|
|
1934
|
+
w: 62,
|
|
1935
|
+
h: 58
|
|
1936
|
+
}
|
|
1937
|
+
];
|
|
1938
|
+
var PULSE_OUTER_CORE = [
|
|
1939
|
+
{
|
|
1940
|
+
ci: 0,
|
|
1941
|
+
region: 1,
|
|
1942
|
+
quad: "tl",
|
|
1943
|
+
w: 80,
|
|
1944
|
+
h: 19,
|
|
1945
|
+
x: "27%",
|
|
1946
|
+
y: "0%"
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
ci: 6,
|
|
1950
|
+
region: 2,
|
|
1951
|
+
quad: "tr",
|
|
1952
|
+
w: 74,
|
|
1953
|
+
h: 11,
|
|
1954
|
+
x: "73%",
|
|
1955
|
+
y: "-1%"
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
ci: 7,
|
|
1959
|
+
region: 3,
|
|
1960
|
+
quad: "tr",
|
|
1961
|
+
w: 15,
|
|
1962
|
+
h: 44,
|
|
1963
|
+
x: "100%",
|
|
1964
|
+
y: "33%"
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
ci: 8,
|
|
1968
|
+
region: 1,
|
|
1969
|
+
quad: "br",
|
|
1970
|
+
w: 19,
|
|
1971
|
+
h: 38,
|
|
1972
|
+
x: "101%",
|
|
1973
|
+
y: "72%"
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
ci: 4,
|
|
1977
|
+
region: 2,
|
|
1978
|
+
quad: "br",
|
|
1979
|
+
w: 84,
|
|
1980
|
+
h: 13,
|
|
1981
|
+
x: "67%",
|
|
1982
|
+
y: "100%"
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
ci: 1,
|
|
1986
|
+
region: 3,
|
|
1987
|
+
quad: "bl",
|
|
1988
|
+
w: 60,
|
|
1989
|
+
h: 21,
|
|
1990
|
+
x: "24%",
|
|
1991
|
+
y: "101%"
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
ci: 2,
|
|
1995
|
+
region: 1,
|
|
1996
|
+
quad: "bl",
|
|
1997
|
+
w: 17,
|
|
1998
|
+
h: 40,
|
|
1999
|
+
x: "0%",
|
|
2000
|
+
y: "60%"
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
ci: 3,
|
|
2004
|
+
region: 2,
|
|
2005
|
+
quad: "tl",
|
|
2006
|
+
w: 13,
|
|
2007
|
+
h: 32,
|
|
2008
|
+
x: "-1%",
|
|
2009
|
+
y: "28%"
|
|
2010
|
+
}
|
|
2011
|
+
];
|
|
2012
|
+
var PULSE_OUTER_BLOOM = [
|
|
2013
|
+
{
|
|
2014
|
+
ci: 0,
|
|
2015
|
+
region: 1,
|
|
2016
|
+
quad: "tl",
|
|
2017
|
+
w: 110,
|
|
2018
|
+
h: 30,
|
|
2019
|
+
x: "27%",
|
|
2020
|
+
y: "3%"
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
ci: 6,
|
|
2024
|
+
region: 2,
|
|
2025
|
+
quad: "tr",
|
|
2026
|
+
w: 100,
|
|
2027
|
+
h: 20,
|
|
2028
|
+
x: "73%",
|
|
2029
|
+
y: "1%"
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
ci: 7,
|
|
2033
|
+
region: 3,
|
|
2034
|
+
quad: "tr",
|
|
2035
|
+
w: 26,
|
|
2036
|
+
h: 62,
|
|
2037
|
+
x: "100%",
|
|
2038
|
+
y: "33%"
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
ci: 8,
|
|
2042
|
+
region: 1,
|
|
2043
|
+
quad: "br",
|
|
2044
|
+
w: 30,
|
|
2045
|
+
h: 56,
|
|
2046
|
+
x: "101%",
|
|
2047
|
+
y: "72%"
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
ci: 4,
|
|
2051
|
+
region: 2,
|
|
2052
|
+
quad: "br",
|
|
2053
|
+
w: 120,
|
|
2054
|
+
h: 22,
|
|
2055
|
+
x: "67%",
|
|
2056
|
+
y: "99%"
|
|
2057
|
+
},
|
|
2058
|
+
{
|
|
2059
|
+
ci: 1,
|
|
2060
|
+
region: 3,
|
|
2061
|
+
quad: "bl",
|
|
2062
|
+
w: 88,
|
|
2063
|
+
h: 32,
|
|
2064
|
+
x: "24%",
|
|
2065
|
+
y: "99%"
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
ci: 2,
|
|
2069
|
+
region: 1,
|
|
2070
|
+
quad: "bl",
|
|
2071
|
+
w: 28,
|
|
2072
|
+
h: 58,
|
|
2073
|
+
x: "0%",
|
|
2074
|
+
y: "60%"
|
|
2075
|
+
}
|
|
2076
|
+
];
|
|
2077
|
+
/**
|
|
2078
|
+
*
|
|
2079
|
+
* @param color
|
|
2080
|
+
* @param quad
|
|
2081
|
+
* @param id
|
|
2082
|
+
*/
|
|
2083
|
+
function withAlphaVar(color, quad, id) {
|
|
2084
|
+
const m = color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
2085
|
+
return `rgba(${m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255"}, var(--bop-${quad}-${id}))`;
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
*
|
|
2089
|
+
* @param color
|
|
2090
|
+
* @param w
|
|
2091
|
+
* @param h
|
|
2092
|
+
* @param region
|
|
2093
|
+
* @param quad
|
|
2094
|
+
* @param x
|
|
2095
|
+
* @param y
|
|
2096
|
+
* @param id
|
|
2097
|
+
*/
|
|
2098
|
+
function pulseGrad(color, w, h, region, quad, x, y, id) {
|
|
2099
|
+
return `radial-gradient(ellipse calc(${w}px * var(--beam-density, 1) * var(--bw${region}-${id}) * var(--pulse-glow-sx, 1)) calc(${h}px * var(--beam-density, 1) * var(--bh${region}-${id}) * var(--bgh-${id}) * var(--pulse-glow-sy, 1)) at calc(${x} + var(--bx${region}-${id})) calc(${y} + var(--by${region}-${id})), ${withAlphaVar(color, quad, id)}, transparent)`;
|
|
2100
|
+
}
|
|
2101
|
+
/**
|
|
2102
|
+
*
|
|
2103
|
+
* @param variant
|
|
2104
|
+
* @param id
|
|
2105
|
+
*/
|
|
2106
|
+
function pulseRingGradients(variant, id) {
|
|
2107
|
+
return colorPalettes[variant].border.map((c, i) => {
|
|
2108
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
2109
|
+
const [x, y] = c.pos.split(" ");
|
|
2110
|
+
const [w, h] = c.size.split(" ").map(parseFloat);
|
|
2111
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
2112
|
+
}).join(",\n ");
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
*
|
|
2116
|
+
* @param variant
|
|
2117
|
+
* @param id
|
|
2118
|
+
* @param isDark
|
|
2119
|
+
*/
|
|
2120
|
+
function pulseInnerGradients(variant, id, isDark) {
|
|
2121
|
+
const grads = colorPalettes[variant].border.map((c, i) => {
|
|
2122
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
2123
|
+
const [x, y] = c.pos.split(" ");
|
|
2124
|
+
const [w, h] = PULSE_INNER_SIZES[i];
|
|
2125
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
2126
|
+
});
|
|
2127
|
+
const cornerRGB = isDark ? "255, 255, 255" : "0, 0, 0";
|
|
2128
|
+
const cornerAlpha = isDark ? .18 : .08;
|
|
2129
|
+
const cornerGrads = [
|
|
2130
|
+
[
|
|
2131
|
+
"0%",
|
|
2132
|
+
"0%",
|
|
2133
|
+
"tl"
|
|
2134
|
+
],
|
|
2135
|
+
[
|
|
2136
|
+
"100%",
|
|
2137
|
+
"0%",
|
|
2138
|
+
"tr"
|
|
2139
|
+
],
|
|
2140
|
+
[
|
|
2141
|
+
"0%",
|
|
2142
|
+
"100%",
|
|
2143
|
+
"bl"
|
|
2144
|
+
],
|
|
2145
|
+
[
|
|
2146
|
+
"100%",
|
|
2147
|
+
"100%",
|
|
2148
|
+
"br"
|
|
2149
|
+
]
|
|
2150
|
+
].map(([x, y, q]) => `radial-gradient(ellipse calc(60px * var(--beam-density, 1)) calc(60px * var(--beam-density, 1)) at ${x} ${y}, rgba(${cornerRGB}, calc(${cornerAlpha} * var(--bop-${q}-${id}))), transparent 70%)`);
|
|
2151
|
+
return [...grads, ...cornerGrads].join(",\n ");
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
*
|
|
2155
|
+
* @param table
|
|
2156
|
+
* @param variant
|
|
2157
|
+
* @param id
|
|
2158
|
+
*/
|
|
2159
|
+
function pulseTableGradients(table, variant, id) {
|
|
2160
|
+
const palette = colorPalettes[variant].border;
|
|
2161
|
+
return table.map((e) => {
|
|
2162
|
+
var _e$x, _e$y;
|
|
2163
|
+
const c = palette[e.ci];
|
|
2164
|
+
const [px, py] = c.pos.split(" ");
|
|
2165
|
+
return pulseGrad(c.color, e.w, e.h, e.region, e.quad, (_e$x = e.x) !== null && _e$x !== void 0 ? _e$x : px, (_e$y = e.y) !== null && _e$y !== void 0 ? _e$y : py, id);
|
|
2166
|
+
}).join(",\n ");
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
*
|
|
2170
|
+
* @param table
|
|
2171
|
+
* @param variant
|
|
2172
|
+
* @param frozenAlpha
|
|
2173
|
+
*/
|
|
2174
|
+
function pulseTableGradientsStatic(table, variant, frozenAlpha) {
|
|
2175
|
+
const palette = colorPalettes[variant].border;
|
|
2176
|
+
const a = +frozenAlpha.toFixed(3);
|
|
2177
|
+
return table.map((e) => {
|
|
2178
|
+
var _e$x2, _e$y2;
|
|
2179
|
+
const c = palette[e.ci];
|
|
2180
|
+
const [px, py] = c.pos.split(" ");
|
|
2181
|
+
const x = (_e$x2 = e.x) !== null && _e$x2 !== void 0 ? _e$x2 : px;
|
|
2182
|
+
const y = (_e$y2 = e.y) !== null && _e$y2 !== void 0 ? _e$y2 : py;
|
|
2183
|
+
const m = c.color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
2184
|
+
const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
|
|
2185
|
+
return `radial-gradient(ellipse calc(${e.w}px * var(--beam-density, 1) * var(--pulse-glow-sx, 1)) calc(${e.h}px * var(--beam-density, 1) * var(--pulse-glow-sy, 1)) at ${x} ${y}, rgba(${rgb}, ${a}), transparent)`;
|
|
2186
|
+
}).join(",\n ");
|
|
2187
|
+
}
|
|
2188
|
+
/**
|
|
2189
|
+
*
|
|
2190
|
+
* @param id
|
|
2191
|
+
*/
|
|
2192
|
+
function pausedAnimationsRule(id) {
|
|
2193
|
+
return `
|
|
2194
|
+
[data-beam="${id}"][data-paused],
|
|
2195
|
+
[data-beam="${id}"][data-paused]::after,
|
|
2196
|
+
[data-beam="${id}"][data-paused]::before,
|
|
2197
|
+
[data-beam="${id}"][data-paused] [data-beam-bloom] {
|
|
2198
|
+
animation-play-state: paused !important;
|
|
2199
|
+
}`;
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
*
|
|
2203
|
+
* @param id
|
|
2204
|
+
*/
|
|
2205
|
+
function pulsePropertyRegs(id) {
|
|
2206
|
+
return `${[
|
|
2207
|
+
"bw1",
|
|
2208
|
+
"bh1",
|
|
2209
|
+
"bw2",
|
|
2210
|
+
"bh2",
|
|
2211
|
+
"bw3",
|
|
2212
|
+
"bh3",
|
|
2213
|
+
"bgh",
|
|
2214
|
+
"bop-tl",
|
|
2215
|
+
"bop-tr",
|
|
2216
|
+
"bop-bl",
|
|
2217
|
+
"bop-br"
|
|
2218
|
+
].map((n) => `@property --${n}-${id} {\n syntax: "<number>";\n initial-value: 1;\n inherits: true;\n}`).join("\n\n")}\n\n${[
|
|
2219
|
+
"bx1",
|
|
2220
|
+
"by1",
|
|
2221
|
+
"bx2",
|
|
2222
|
+
"by2",
|
|
2223
|
+
"bx3",
|
|
2224
|
+
"by3"
|
|
2225
|
+
].map((n) => `@property --${n}-${id} {\n syntax: "<length>";\n initial-value: 0px;\n inherits: true;\n}`).join("\n\n")}\n\n@property --beam-opacity-${id} {\n syntax: "<number>";\n initial-value: 0;\n inherits: true;\n}\n\n@property --beam-hue-${id} {\n syntax: "<angle>";\n initial-value: 0deg;\n inherits: true;\n}`;
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Theme/size/duration-tuned breathing parameters (shared by CSS + JS driver).
|
|
2229
|
+
* @param size
|
|
2230
|
+
* @param theme
|
|
2231
|
+
* @param duration
|
|
2232
|
+
*/
|
|
2233
|
+
function pulseParams(size, theme, duration) {
|
|
2234
|
+
const isDark = theme === "dark";
|
|
2235
|
+
const durScale = duration / 2.3;
|
|
2236
|
+
if (size === "pulse-inner") return {
|
|
2237
|
+
sp: .28,
|
|
2238
|
+
dr: isDark ? 33 : 40,
|
|
2239
|
+
op: isDark ? .48 : .45,
|
|
2240
|
+
gh: isDark ? .34 : .22,
|
|
2241
|
+
bs: (isDark ? 1.9 : 2.6) * durScale,
|
|
2242
|
+
ss: (isDark ? 2.6 : 4.6) * durScale,
|
|
2243
|
+
ghs: (isDark ? 2.4 : 5.5) * durScale,
|
|
2244
|
+
huePeriod: 16
|
|
2245
|
+
};
|
|
2246
|
+
return {
|
|
2247
|
+
sp: isDark ? .28 : .36,
|
|
2248
|
+
dr: isDark ? 14 : 19,
|
|
2249
|
+
op: isDark ? .46 : 0,
|
|
2250
|
+
gh: isDark ? .16 : .58,
|
|
2251
|
+
bs: (isDark ? 2.3 : 3.7) * durScale,
|
|
2252
|
+
ss: (isDark ? 6.4 : 4.6) * durScale,
|
|
2253
|
+
ghs: (isDark ? 2.4 : 3.8) * durScale,
|
|
2254
|
+
huePeriod: 14
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
/**
|
|
2258
|
+
* Build the oscillator table for an instance (matches the former keyframes).
|
|
2259
|
+
* @param id
|
|
2260
|
+
* @param p
|
|
2261
|
+
*/
|
|
2262
|
+
function pulseOscillatorDefs(id, p) {
|
|
2263
|
+
const { sp, dr, op, gh, bs, ss, ghs } = p;
|
|
2264
|
+
return [
|
|
2265
|
+
{
|
|
2266
|
+
prop: `--bw1-${id}`,
|
|
2267
|
+
a: 1 - sp,
|
|
2268
|
+
b: 1 + sp * 1.1,
|
|
2269
|
+
period: ss * .9,
|
|
2270
|
+
delay: 0,
|
|
2271
|
+
unit: ""
|
|
2272
|
+
},
|
|
2273
|
+
{
|
|
2274
|
+
prop: `--bh1-${id}`,
|
|
2275
|
+
a: 1 + sp * .9,
|
|
2276
|
+
b: 1 - sp * .85,
|
|
2277
|
+
period: ss * 1.26,
|
|
2278
|
+
delay: 0,
|
|
2279
|
+
unit: ""
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
prop: `--bx1-${id}`,
|
|
2283
|
+
a: -dr,
|
|
2284
|
+
b: dr * .9,
|
|
2285
|
+
period: bs * 1.6,
|
|
2286
|
+
delay: 0,
|
|
2287
|
+
unit: "px"
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
prop: `--by1-${id}`,
|
|
2291
|
+
a: dr * .55,
|
|
2292
|
+
b: -dr * .7,
|
|
2293
|
+
period: bs * 1.6,
|
|
2294
|
+
delay: 0,
|
|
2295
|
+
unit: "px"
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
prop: `--bw2-${id}`,
|
|
2299
|
+
a: 1 + sp,
|
|
2300
|
+
b: 1 - sp * .85,
|
|
2301
|
+
period: ss * 1.1,
|
|
2302
|
+
delay: 0,
|
|
2303
|
+
unit: ""
|
|
2304
|
+
},
|
|
2305
|
+
{
|
|
2306
|
+
prop: `--bh2-${id}`,
|
|
2307
|
+
a: 1 - sp * .8,
|
|
2308
|
+
b: 1 + sp * 1.05,
|
|
2309
|
+
period: ss * .81,
|
|
2310
|
+
delay: 0,
|
|
2311
|
+
unit: ""
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
prop: `--bx2-${id}`,
|
|
2315
|
+
a: dr * .8,
|
|
2316
|
+
b: -dr * .9,
|
|
2317
|
+
period: bs * 1.88,
|
|
2318
|
+
delay: 0,
|
|
2319
|
+
unit: "px"
|
|
2320
|
+
},
|
|
2321
|
+
{
|
|
2322
|
+
prop: `--by2-${id}`,
|
|
2323
|
+
a: -dr,
|
|
2324
|
+
b: dr * .65,
|
|
2325
|
+
period: bs * 1.88,
|
|
2326
|
+
delay: 0,
|
|
2327
|
+
unit: "px"
|
|
2328
|
+
},
|
|
2329
|
+
{
|
|
2330
|
+
prop: `--bw3-${id}`,
|
|
2331
|
+
a: 1 - sp * .6,
|
|
2332
|
+
b: 1 + sp * 1.15,
|
|
2333
|
+
period: ss * .98,
|
|
2334
|
+
delay: 0,
|
|
2335
|
+
unit: ""
|
|
2336
|
+
},
|
|
2337
|
+
{
|
|
2338
|
+
prop: `--bh3-${id}`,
|
|
2339
|
+
a: 1 + sp * .75,
|
|
2340
|
+
b: 1 - sp,
|
|
2341
|
+
period: ss * 1.4,
|
|
2342
|
+
delay: 0,
|
|
2343
|
+
unit: ""
|
|
2344
|
+
},
|
|
2345
|
+
{
|
|
2346
|
+
prop: `--bx3-${id}`,
|
|
2347
|
+
a: -dr * .6,
|
|
2348
|
+
b: dr,
|
|
2349
|
+
period: bs * 1.45,
|
|
2350
|
+
delay: 0,
|
|
2351
|
+
unit: "px"
|
|
2352
|
+
},
|
|
2353
|
+
{
|
|
2354
|
+
prop: `--by3-${id}`,
|
|
2355
|
+
a: -dr * .85,
|
|
2356
|
+
b: dr * .45,
|
|
2357
|
+
period: bs * 1.45,
|
|
2358
|
+
delay: 0,
|
|
2359
|
+
unit: "px"
|
|
2360
|
+
},
|
|
2361
|
+
{
|
|
2362
|
+
prop: `--bgh-${id}`,
|
|
2363
|
+
a: 1 - gh,
|
|
2364
|
+
b: 1 + gh,
|
|
2365
|
+
period: ghs,
|
|
2366
|
+
delay: 0,
|
|
2367
|
+
unit: ""
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
prop: `--bop-tl-${id}`,
|
|
2371
|
+
a: 1 - op,
|
|
2372
|
+
b: 1,
|
|
2373
|
+
period: bs,
|
|
2374
|
+
delay: 0,
|
|
2375
|
+
unit: ""
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
prop: `--bop-tr-${id}`,
|
|
2379
|
+
a: 1 - op,
|
|
2380
|
+
b: 1,
|
|
2381
|
+
period: bs * 1.32,
|
|
2382
|
+
delay: bs * .28,
|
|
2383
|
+
unit: ""
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
prop: `--bop-bl-${id}`,
|
|
2387
|
+
a: 1 - op,
|
|
2388
|
+
b: 1,
|
|
2389
|
+
period: bs * .84,
|
|
2390
|
+
delay: bs * .55,
|
|
2391
|
+
unit: ""
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
prop: `--bop-br-${id}`,
|
|
2395
|
+
a: 1 - op,
|
|
2396
|
+
b: 1,
|
|
2397
|
+
period: bs * 1.58,
|
|
2398
|
+
delay: bs * .83,
|
|
2399
|
+
unit: ""
|
|
2400
|
+
}
|
|
2401
|
+
];
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Returns the runtime config the JS driver needs to animate a pulse instance,
|
|
2405
|
+
* or null for non-pulse sizes.
|
|
2406
|
+
* @param size
|
|
2407
|
+
* @param theme
|
|
2408
|
+
* @param duration
|
|
2409
|
+
* @param hueRange
|
|
2410
|
+
* @param staticColors
|
|
2411
|
+
* @param id
|
|
2412
|
+
*/
|
|
2413
|
+
function getPulseDriverConfig(size, theme, duration, hueRange, staticColors, id) {
|
|
2414
|
+
if (size !== "pulse-inner" && size !== "pulse-outside") return null;
|
|
2415
|
+
const p = pulseParams(size, theme, duration);
|
|
2416
|
+
return {
|
|
2417
|
+
oscillators: pulseOscillatorDefs(id, p),
|
|
2418
|
+
hue: staticColors ? null : {
|
|
2419
|
+
prop: `--beam-hue-${id}`,
|
|
2420
|
+
range: 360,
|
|
2421
|
+
period: p.huePeriod,
|
|
2422
|
+
continuous: true
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
*
|
|
2428
|
+
* @param id
|
|
2429
|
+
* @param fadeName
|
|
2430
|
+
* @param fadeDur
|
|
2431
|
+
*/
|
|
2432
|
+
function pulseWrapperAnimation(id, fadeName, fadeDur) {
|
|
2433
|
+
return ` animation: ${fadeName}-${id} ${fadeDur}s ease forwards;`;
|
|
2434
|
+
}
|
|
2435
|
+
function flowOverlayCSS(options) {
|
|
2436
|
+
const { id, borderRadius } = options;
|
|
2437
|
+
return `
|
|
2438
|
+
[data-beam="${id}"] [data-beam-flow] {
|
|
2439
|
+
position: absolute;
|
|
2440
|
+
inset: 0;
|
|
2441
|
+
width: 100%;
|
|
2442
|
+
height: 100%;
|
|
2443
|
+
border-radius: ${borderRadius}px;
|
|
2444
|
+
pointer-events: none;
|
|
2445
|
+
z-index: 4;
|
|
2446
|
+
overflow: hidden;
|
|
2447
|
+
opacity: 0;
|
|
2448
|
+
transform: translateZ(0);
|
|
2449
|
+
will-change: opacity, filter;
|
|
2450
|
+
animation: beam-flow-spread-${id} 0.62s linear forwards;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
[data-beam="${id}"] [data-beam-flow-sheet] {
|
|
2454
|
+
opacity: 0.92;
|
|
2455
|
+
filter: blur(1.1px) drop-shadow(0 18px 34px rgba(255, 255, 255, 0.16));
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
[data-beam="${id}"] [data-beam-flow-front] {
|
|
2459
|
+
opacity: 0.78;
|
|
2460
|
+
stroke-linecap: round;
|
|
2461
|
+
transform-box: fill-box;
|
|
2462
|
+
transform-origin: center;
|
|
2463
|
+
filter: blur(2.2px) drop-shadow(0 0 18px currentColor);
|
|
2464
|
+
animation: beam-flow-front-${id} 0.62s linear forwards;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
[data-beam="${id}"] [data-beam-flow-front="highlight"] {
|
|
2468
|
+
opacity: 0.7;
|
|
2469
|
+
filter: blur(1.2px);
|
|
2470
|
+
animation-name: beam-flow-front-highlight-${id};
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
[data-beam="${id}"] [data-beam-flow-blob] {
|
|
2474
|
+
fill: white;
|
|
2475
|
+
opacity: 0.82;
|
|
2476
|
+
transform-box: fill-box;
|
|
2477
|
+
transform-origin: center;
|
|
2478
|
+
animation: beam-flow-blob-${id} 0.62s linear forwards;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
[data-beam="${id}"] [data-beam-flow-blob="shore-a"] {
|
|
2482
|
+
opacity: 0.44;
|
|
2483
|
+
animation-name: beam-flow-shore-a-${id};
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
[data-beam="${id}"] [data-beam-flow-blob="shore-b"] {
|
|
2487
|
+
opacity: 0.34;
|
|
2488
|
+
animation-name: beam-flow-shore-b-${id};
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
[data-beam="${id}"] [data-beam-flow-specular] {
|
|
2492
|
+
opacity: 0;
|
|
2493
|
+
filter: blur(18px);
|
|
2494
|
+
transform-box: fill-box;
|
|
2495
|
+
transform-origin: center;
|
|
2496
|
+
animation: beam-flow-specular-${id} 0.62s linear forwards;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
@keyframes beam-flow-spread-${id} {
|
|
2500
|
+
0% {
|
|
2501
|
+
opacity: calc(0.56 * var(--beam-strength, 1));
|
|
2502
|
+
filter: blur(1.4px) saturate(1.18);
|
|
2503
|
+
}
|
|
2504
|
+
35% {
|
|
2505
|
+
opacity: calc(0.5 * var(--beam-strength, 1));
|
|
2506
|
+
filter: blur(2.3px) saturate(1.24);
|
|
2507
|
+
}
|
|
2508
|
+
70% {
|
|
2509
|
+
opacity: calc(0.34 * var(--beam-strength, 1));
|
|
2510
|
+
filter: blur(3.4px) saturate(1.2);
|
|
2511
|
+
}
|
|
2512
|
+
100% {
|
|
2513
|
+
opacity: 0;
|
|
2514
|
+
filter: blur(6px) saturate(1.05);
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
@keyframes beam-flow-blob-${id} {
|
|
2519
|
+
0% { transform: scale(0.02); }
|
|
2520
|
+
25% { transform: scale(0.34, 0.3) rotate(-2deg); }
|
|
2521
|
+
50% { transform: scale(0.66, 0.58) rotate(-1deg); }
|
|
2522
|
+
75% { transform: scale(0.94, 0.88) rotate(1deg); }
|
|
2523
|
+
100% { transform: scale(1.18, 1.12); }
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
@keyframes beam-flow-shore-a-${id} {
|
|
2527
|
+
0% { transform: translate(0, 0) scale(0.01); }
|
|
2528
|
+
25% { transform: translate(5px, -3px) scale(0.38, 0.26) rotate(3deg); }
|
|
2529
|
+
50% { transform: translate(8px, -4px) scale(0.72, 0.52) rotate(2deg); }
|
|
2530
|
+
75% { transform: translate(4px, -2px) scale(1, 0.78) rotate(1deg); }
|
|
2531
|
+
100% { transform: translate(0, 0) scale(1.24, 1); }
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
@keyframes beam-flow-shore-b-${id} {
|
|
2535
|
+
0% { transform: translate(0, 0) scale(0.01); }
|
|
2536
|
+
25% { transform: translate(-6px, 4px) scale(0.28, 0.42) rotate(-4deg); }
|
|
2537
|
+
50% { transform: translate(-8px, 5px) scale(0.58, 0.78) rotate(-2deg); }
|
|
2538
|
+
75% { transform: translate(-4px, 2px) scale(0.9, 1.04) rotate(-1deg); }
|
|
2539
|
+
100% { transform: translate(0, 0) scale(1.16, 1.12); }
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
@keyframes beam-flow-specular-${id} {
|
|
2543
|
+
0% { opacity: 0.28; transform: scale(0.2); }
|
|
2544
|
+
35% { opacity: 0.2; transform: scale(0.86, 0.42) rotate(-3deg); }
|
|
2545
|
+
70% { opacity: 0.1; transform: scale(1.45, 0.64) rotate(2deg); }
|
|
2546
|
+
100% { opacity: 0; transform: scale(2.2, 0.86); }
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
@keyframes beam-flow-front-${id} {
|
|
2550
|
+
0% { opacity: 0; transform: scale(0.03); stroke-opacity: 0.95; }
|
|
2551
|
+
18% { opacity: 0.86; transform: scale(0.28, 0.22) rotate(-3deg); stroke-opacity: 0.92; }
|
|
2552
|
+
46% { opacity: 0.82; transform: scale(0.6, 0.5) rotate(-1deg); stroke-opacity: 0.8; }
|
|
2553
|
+
74% { opacity: 0.54; transform: scale(0.9, 0.84) rotate(1deg); stroke-opacity: 0.52; }
|
|
2554
|
+
100% { opacity: 0; transform: scale(1.16, 1.08); stroke-opacity: 0; }
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
@keyframes beam-flow-front-highlight-${id} {
|
|
2558
|
+
0% { opacity: 0; transform: scale(0.04); stroke-opacity: 0.86; }
|
|
2559
|
+
22% { opacity: 0.78; transform: scale(0.3, 0.2) rotate(2deg); stroke-opacity: 0.8; }
|
|
2560
|
+
52% { opacity: 0.62; transform: scale(0.65, 0.52) rotate(-2deg); stroke-opacity: 0.58; }
|
|
2561
|
+
80% { opacity: 0.3; transform: scale(0.96, 0.82) rotate(1deg); stroke-opacity: 0.26; }
|
|
2562
|
+
100% { opacity: 0; transform: scale(1.18, 1); stroke-opacity: 0; }
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2566
|
+
[data-beam="${id}"] [data-beam-flow],
|
|
2567
|
+
[data-beam="${id}"] [data-beam-flow-blob],
|
|
2568
|
+
[data-beam="${id}"] [data-beam-flow-front],
|
|
2569
|
+
[data-beam="${id}"] [data-beam-flow-specular] {
|
|
2570
|
+
display: none;
|
|
2571
|
+
animation: none !important;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
`;
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* Generate complete CSS for a BorderBeam instance
|
|
2578
|
+
* @param options
|
|
2579
|
+
*/
|
|
2580
|
+
function generateBeamCSS(options) {
|
|
2581
|
+
const { size } = options;
|
|
2582
|
+
if (size === "line") return generateLineVariantCSS(options);
|
|
2583
|
+
if (size === "sm") return generateSmallVariantCSS(options);
|
|
2584
|
+
if (size === "pulse-inner") return generatePulseInnerVariantCSS(options);
|
|
2585
|
+
if (size === "pulse-outside") return generatePulseOuterVariantCSS(options);
|
|
2586
|
+
return generateBorderVariantCSS(options);
|
|
2587
|
+
}
|
|
2588
|
+
/**
|
|
2589
|
+
*
|
|
2590
|
+
* @param options
|
|
2591
|
+
*/
|
|
2592
|
+
function generateSmallVariantCSS(options) {
|
|
2593
|
+
const { id, borderRadius, borderWidth, duration, strokeOpacity, innerOpacity, bloomOpacity, innerShadow, colorVariant, staticColors, brightness, saturation, hueRange, theme } = options;
|
|
2594
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
2595
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? .5 : 1;
|
|
2596
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
2597
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
2598
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
2599
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
2600
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
2601
|
+
@keyframes beam-hue-shift-${id} {
|
|
2602
|
+
0% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2603
|
+
50% { filter: hue-rotate(${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2604
|
+
100% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2605
|
+
}`;
|
|
2606
|
+
const isDark = theme === "dark";
|
|
2607
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
2608
|
+
from var(--beam-angle-${id}),
|
|
2609
|
+
transparent 0%, transparent 54%,
|
|
2610
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
2611
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
2612
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
2613
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
2614
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
2615
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
2616
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
2617
|
+
transparent 78%, transparent 100%
|
|
2618
|
+
)` : `conic-gradient(
|
|
2619
|
+
from var(--beam-angle-${id}),
|
|
2620
|
+
transparent 0%, transparent 54%,
|
|
2621
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
2622
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
2623
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
2624
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
2625
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
2626
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
2627
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
2628
|
+
transparent 78%, transparent 100%
|
|
2629
|
+
)`;
|
|
2630
|
+
const colorGradients = getSmallColorGradients(colorVariant);
|
|
2631
|
+
const innerGradients = getSmallInnerGradients(colorVariant);
|
|
2632
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
2633
|
+
from var(--beam-angle-${id}),
|
|
2634
|
+
transparent 0%, transparent 58%,
|
|
2635
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
2636
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
2637
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
2638
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
2639
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
2640
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
2641
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
2642
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
2643
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
2644
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
2645
|
+
transparent 82%
|
|
2646
|
+
)` : `conic-gradient(
|
|
2647
|
+
from var(--beam-angle-${id}),
|
|
2648
|
+
transparent 0%, transparent 58%,
|
|
2649
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
2650
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
2651
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
2652
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
2653
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
2654
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
2655
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
2656
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
2657
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
2658
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
2659
|
+
transparent 82%
|
|
2660
|
+
)`;
|
|
2661
|
+
const smallMask = `conic-gradient(
|
|
2662
|
+
from var(--beam-angle-${id}),
|
|
2663
|
+
transparent 0%, transparent 22%,
|
|
2664
|
+
rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0.4) 36%,
|
|
2665
|
+
white 46%, white 82%,
|
|
2666
|
+
rgba(255, 255, 255, 0.4) 88%, rgba(255, 255, 255, 0.12) 94%,
|
|
2667
|
+
transparent 97%, transparent 100%
|
|
2668
|
+
)`;
|
|
2669
|
+
return `
|
|
2670
|
+
@property --beam-angle-${id} {
|
|
2671
|
+
syntax: "<angle>";
|
|
2672
|
+
initial-value: 0deg;
|
|
2673
|
+
inherits: true;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
@property --beam-opacity-${id} {
|
|
2677
|
+
syntax: "<number>";
|
|
2678
|
+
initial-value: 0;
|
|
2679
|
+
inherits: true;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
[data-beam="${id}"] {
|
|
2683
|
+
position: relative;
|
|
2684
|
+
border-radius: ${borderRadius}px;
|
|
2685
|
+
overflow: hidden;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
[data-beam="${id}"][data-active] {
|
|
2689
|
+
animation:
|
|
2690
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
2691
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
[data-beam="${id}"][data-fading] {
|
|
2695
|
+
animation:
|
|
2696
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
2697
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
[data-beam="${id}"][data-active]::after,
|
|
2701
|
+
[data-beam="${id}"][data-fading]::after {
|
|
2702
|
+
content: "";
|
|
2703
|
+
position: absolute;
|
|
2704
|
+
inset: 0;
|
|
2705
|
+
border-radius: ${innerRadius}px;
|
|
2706
|
+
padding: ${borderWidth}px;
|
|
2707
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2708
|
+
background: ${whiteGradient},${colorGradients};
|
|
2709
|
+
-webkit-mask:
|
|
2710
|
+
conic-gradient(
|
|
2711
|
+
from var(--beam-angle-${id}),
|
|
2712
|
+
transparent 0%, transparent 30%,
|
|
2713
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2714
|
+
white 52%, white 80%,
|
|
2715
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2716
|
+
transparent 95%, transparent 100%
|
|
2717
|
+
),
|
|
2718
|
+
linear-gradient(#fff 0 0) content-box,
|
|
2719
|
+
linear-gradient(#fff 0 0);
|
|
2720
|
+
-webkit-mask-composite: source-in, xor;
|
|
2721
|
+
mask:
|
|
2722
|
+
conic-gradient(
|
|
2723
|
+
from var(--beam-angle-${id}),
|
|
2724
|
+
transparent 0%, transparent 30%,
|
|
2725
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2726
|
+
white 52%, white 80%,
|
|
2727
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2728
|
+
transparent 95%, transparent 100%
|
|
2729
|
+
),
|
|
2730
|
+
linear-gradient(#fff 0 0) content-box,
|
|
2731
|
+
linear-gradient(#fff 0 0);
|
|
2732
|
+
mask-composite: intersect, exclude;
|
|
2733
|
+
pointer-events: none;
|
|
2734
|
+
z-index: 2;
|
|
2735
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
2736
|
+
${hueShiftAnimation}
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
[data-beam="${id}"][data-active]::before,
|
|
2740
|
+
[data-beam="${id}"][data-fading]::before {
|
|
2741
|
+
content: "";
|
|
2742
|
+
position: absolute;
|
|
2743
|
+
inset: 0;
|
|
2744
|
+
border-radius: ${borderRadius}px;
|
|
2745
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2746
|
+
background: ${innerGradients};
|
|
2747
|
+
box-shadow: inset 0 0 5px 1px ${innerShadow};
|
|
2748
|
+
-webkit-mask-image: ${smallMask};
|
|
2749
|
+
-webkit-mask-composite: source-over;
|
|
2750
|
+
mask-image: ${smallMask};
|
|
2751
|
+
mask-composite: add;
|
|
2752
|
+
pointer-events: none;
|
|
2753
|
+
z-index: 1;
|
|
2754
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
2755
|
+
${hueShiftAnimation}
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
2759
|
+
display: none;
|
|
2760
|
+
position: absolute;
|
|
2761
|
+
inset: 0;
|
|
2762
|
+
border-radius: ${innerRadius}px;
|
|
2763
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2764
|
+
background: ${bloomGradient};
|
|
2765
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
2766
|
+
-webkit-mask-composite: xor;
|
|
2767
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
2768
|
+
mask-composite: exclude;
|
|
2769
|
+
padding: ${borderWidth}px;
|
|
2770
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
2771
|
+
pointer-events: none;
|
|
2772
|
+
z-index: 3;
|
|
2773
|
+
opacity: 0;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
2777
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
2778
|
+
display: block;
|
|
2779
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
@keyframes beam-spin-${id} {
|
|
2783
|
+
to { --beam-angle-${id}: 360deg; }
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
@keyframes beam-fade-in-${id} {
|
|
2787
|
+
to { --beam-opacity-${id}: 1; }
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
@keyframes beam-fade-out-${id} {
|
|
2791
|
+
from { --beam-opacity-${id}: 1; }
|
|
2792
|
+
to { --beam-opacity-${id}: 0; }
|
|
2793
|
+
}
|
|
2794
|
+
${hueShiftKeyframes}
|
|
2795
|
+
${pausedAnimationsRule(id)}
|
|
2796
|
+
${flowOverlayCSS(options)}
|
|
2797
|
+
`;
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
*
|
|
2801
|
+
* @param options
|
|
2802
|
+
*/
|
|
2803
|
+
function generateBorderVariantCSS(options) {
|
|
2804
|
+
const { id, borderRadius, borderWidth, duration, strokeOpacity, innerOpacity, bloomOpacity, innerShadow, colorVariant, staticColors, brightness, saturation, hueRange, theme } = options;
|
|
2805
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
2806
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? .5 : 1;
|
|
2807
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
2808
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
2809
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
2810
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
2811
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
2812
|
+
@keyframes beam-hue-shift-${id} {
|
|
2813
|
+
0% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2814
|
+
50% { filter: hue-rotate(${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2815
|
+
100% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
2816
|
+
}`;
|
|
2817
|
+
const isDark = theme === "dark";
|
|
2818
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
2819
|
+
from var(--beam-angle-${id}),
|
|
2820
|
+
transparent 0%, transparent 54%,
|
|
2821
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
2822
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
2823
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
2824
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
2825
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
2826
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
2827
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
2828
|
+
transparent 78%, transparent 100%
|
|
2829
|
+
)` : `conic-gradient(
|
|
2830
|
+
from var(--beam-angle-${id}),
|
|
2831
|
+
transparent 0%, transparent 54%,
|
|
2832
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
2833
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
2834
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
2835
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
2836
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
2837
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
2838
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
2839
|
+
transparent 78%, transparent 100%
|
|
2840
|
+
)`;
|
|
2841
|
+
const colorGradients = getColorGradients(colorVariant);
|
|
2842
|
+
const innerGradients = getInnerGradients(colorVariant);
|
|
2843
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
2844
|
+
from var(--beam-angle-${id}),
|
|
2845
|
+
transparent 0%, transparent 58%,
|
|
2846
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
2847
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
2848
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
2849
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
2850
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
2851
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
2852
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
2853
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
2854
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
2855
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
2856
|
+
transparent 82%
|
|
2857
|
+
)` : `conic-gradient(
|
|
2858
|
+
from var(--beam-angle-${id}),
|
|
2859
|
+
transparent 0%, transparent 58%,
|
|
2860
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
2861
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
2862
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
2863
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
2864
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
2865
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
2866
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
2867
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
2868
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
2869
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
2870
|
+
transparent 82%
|
|
2871
|
+
)`;
|
|
2872
|
+
return `
|
|
2873
|
+
@property --beam-angle-${id} {
|
|
2874
|
+
syntax: "<angle>";
|
|
2875
|
+
initial-value: 0deg;
|
|
2876
|
+
inherits: true;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
@property --beam-opacity-${id} {
|
|
2880
|
+
syntax: "<number>";
|
|
2881
|
+
initial-value: 0;
|
|
2882
|
+
inherits: true;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
[data-beam="${id}"] {
|
|
2886
|
+
position: relative;
|
|
2887
|
+
border-radius: ${borderRadius}px;
|
|
2888
|
+
overflow: hidden;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
[data-beam="${id}"][data-active] {
|
|
2892
|
+
animation:
|
|
2893
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
2894
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
[data-beam="${id}"][data-fading] {
|
|
2898
|
+
animation:
|
|
2899
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
2900
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
[data-beam="${id}"][data-active]::after,
|
|
2904
|
+
[data-beam="${id}"][data-fading]::after {
|
|
2905
|
+
content: "";
|
|
2906
|
+
position: absolute;
|
|
2907
|
+
inset: 0;
|
|
2908
|
+
border-radius: ${innerRadius}px;
|
|
2909
|
+
padding: ${borderWidth}px;
|
|
2910
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2911
|
+
background: ${whiteGradient},${colorGradients};
|
|
2912
|
+
-webkit-mask:
|
|
2913
|
+
conic-gradient(
|
|
2914
|
+
from var(--beam-angle-${id}),
|
|
2915
|
+
transparent 0%, transparent 30%,
|
|
2916
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2917
|
+
white 52%, white 80%,
|
|
2918
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2919
|
+
transparent 95%, transparent 100%
|
|
2920
|
+
),
|
|
2921
|
+
linear-gradient(#fff 0 0) content-box,
|
|
2922
|
+
linear-gradient(#fff 0 0);
|
|
2923
|
+
-webkit-mask-composite: source-in, xor;
|
|
2924
|
+
mask:
|
|
2925
|
+
conic-gradient(
|
|
2926
|
+
from var(--beam-angle-${id}),
|
|
2927
|
+
transparent 0%, transparent 30%,
|
|
2928
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2929
|
+
white 52%, white 80%,
|
|
2930
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2931
|
+
transparent 95%, transparent 100%
|
|
2932
|
+
),
|
|
2933
|
+
linear-gradient(#fff 0 0) content-box,
|
|
2934
|
+
linear-gradient(#fff 0 0);
|
|
2935
|
+
mask-composite: intersect, exclude;
|
|
2936
|
+
pointer-events: none;
|
|
2937
|
+
z-index: 2;
|
|
2938
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
2939
|
+
${hueShiftAnimation}
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
[data-beam="${id}"][data-active]::before,
|
|
2943
|
+
[data-beam="${id}"][data-fading]::before {
|
|
2944
|
+
content: "";
|
|
2945
|
+
position: absolute;
|
|
2946
|
+
inset: 0;
|
|
2947
|
+
border-radius: ${borderRadius}px;
|
|
2948
|
+
background: ${innerGradients};
|
|
2949
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
2950
|
+
-webkit-mask-image:
|
|
2951
|
+
conic-gradient(
|
|
2952
|
+
from var(--beam-angle-${id}),
|
|
2953
|
+
transparent 0%, transparent 30%,
|
|
2954
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2955
|
+
white 52%, white 80%,
|
|
2956
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2957
|
+
transparent 95%, transparent 100%
|
|
2958
|
+
),
|
|
2959
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
2960
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
2961
|
+
-webkit-mask-composite: source-in, source-over;
|
|
2962
|
+
mask-image:
|
|
2963
|
+
conic-gradient(
|
|
2964
|
+
from var(--beam-angle-${id}),
|
|
2965
|
+
transparent 0%, transparent 30%,
|
|
2966
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
2967
|
+
white 52%, white 80%,
|
|
2968
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
2969
|
+
transparent 95%, transparent 100%
|
|
2970
|
+
),
|
|
2971
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
2972
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
2973
|
+
mask-composite: intersect, add;
|
|
2974
|
+
pointer-events: none;
|
|
2975
|
+
z-index: 1;
|
|
2976
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
2977
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2978
|
+
${hueShiftAnimation}
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
2982
|
+
display: none;
|
|
2983
|
+
position: absolute;
|
|
2984
|
+
inset: 0;
|
|
2985
|
+
border-radius: ${innerRadius}px;
|
|
2986
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
2987
|
+
background: ${bloomGradient};
|
|
2988
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
2989
|
+
-webkit-mask-composite: xor;
|
|
2990
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
2991
|
+
mask-composite: exclude;
|
|
2992
|
+
padding: ${borderWidth}px;
|
|
2993
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
2994
|
+
pointer-events: none;
|
|
2995
|
+
z-index: 3;
|
|
2996
|
+
opacity: 0;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3000
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3001
|
+
display: block;
|
|
3002
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
@keyframes beam-spin-${id} {
|
|
3006
|
+
to { --beam-angle-${id}: 360deg; }
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
@keyframes beam-fade-in-${id} {
|
|
3010
|
+
to { --beam-opacity-${id}: 1; }
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
@keyframes beam-fade-out-${id} {
|
|
3014
|
+
from { --beam-opacity-${id}: 1; }
|
|
3015
|
+
to { --beam-opacity-${id}: 0; }
|
|
3016
|
+
}
|
|
3017
|
+
${hueShiftKeyframes}
|
|
3018
|
+
${pausedAnimationsRule(id)}
|
|
3019
|
+
${flowOverlayCSS(options)}
|
|
3020
|
+
`;
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* Pulse Inner — contained breathing glow
|
|
3024
|
+
* @param options
|
|
3025
|
+
*/
|
|
3026
|
+
function generatePulseInnerVariantCSS(options) {
|
|
3027
|
+
const { id, borderRadius, borderWidth, duration, strokeOpacity, innerOpacity, bloomOpacity, colorVariant, staticColors, brightness, saturation, theme } = options;
|
|
3028
|
+
const isDark = theme === "dark";
|
|
3029
|
+
const monoMul = colorVariant === "mono" ? .5 : 1;
|
|
3030
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
3031
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
3032
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
3033
|
+
const { op } = pulseParams("pulse-inner", theme, duration);
|
|
3034
|
+
const bloomBlur = 8;
|
|
3035
|
+
const b = brightness.toFixed(2);
|
|
3036
|
+
const s = saturation.toFixed(2);
|
|
3037
|
+
const ringAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(var(--beam-hue-${id})) brightness(${b}) saturate(${s});`;
|
|
3038
|
+
const bloomAnim = staticColors ? `filter: blur(${bloomBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${bloomBlur}px) hue-rotate(var(--beam-hue-${id})) brightness(${b}) saturate(${s});`;
|
|
3039
|
+
const ringGradients = pulseRingGradients(colorVariant, id);
|
|
3040
|
+
const innerGradients = pulseInnerGradients(colorVariant, id, isDark);
|
|
3041
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_INNER_BLOOM, colorVariant, 1 - op * .5);
|
|
3042
|
+
return `
|
|
3043
|
+
${pulsePropertyRegs(id)}
|
|
3044
|
+
|
|
3045
|
+
[data-beam="${id}"] {
|
|
3046
|
+
position: relative;
|
|
3047
|
+
border-radius: ${borderRadius}px;
|
|
3048
|
+
overflow: hidden;
|
|
3049
|
+
isolation: isolate;
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
[data-beam="${id}"][data-active] {
|
|
3053
|
+
${pulseWrapperAnimation(id, "beam-fade-in", .6)}
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
[data-beam="${id}"][data-fading] {
|
|
3057
|
+
${pulseWrapperAnimation(id, "beam-fade-out", .5)}
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
[data-beam="${id}"][data-active]::after,
|
|
3061
|
+
[data-beam="${id}"][data-fading]::after {
|
|
3062
|
+
content: "";
|
|
3063
|
+
position: absolute;
|
|
3064
|
+
inset: 0;
|
|
3065
|
+
border-radius: ${borderRadius}px;
|
|
3066
|
+
padding: ${borderWidth}px;
|
|
3067
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3068
|
+
background: ${ringGradients};
|
|
3069
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3070
|
+
-webkit-mask-composite: xor;
|
|
3071
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3072
|
+
mask-composite: exclude;
|
|
3073
|
+
pointer-events: none;
|
|
3074
|
+
z-index: 2;
|
|
3075
|
+
will-change: opacity, filter;
|
|
3076
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-strength, 1));
|
|
3077
|
+
${ringAnim}
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
[data-beam="${id}"][data-active]::before,
|
|
3081
|
+
[data-beam="${id}"][data-fading]::before {
|
|
3082
|
+
content: "";
|
|
3083
|
+
position: absolute;
|
|
3084
|
+
inset: 0;
|
|
3085
|
+
border-radius: ${borderRadius}px;
|
|
3086
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3087
|
+
background: ${innerGradients};
|
|
3088
|
+
-webkit-mask-image:
|
|
3089
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
3090
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
3091
|
+
-webkit-mask-composite: source-over;
|
|
3092
|
+
mask-image:
|
|
3093
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
3094
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
3095
|
+
mask-composite: add;
|
|
3096
|
+
pointer-events: none;
|
|
3097
|
+
z-index: 1;
|
|
3098
|
+
will-change: opacity, filter;
|
|
3099
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-strength, 1));
|
|
3100
|
+
${ringAnim}
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
3104
|
+
display: none;
|
|
3105
|
+
position: absolute;
|
|
3106
|
+
inset: 0;
|
|
3107
|
+
border-radius: ${borderRadius}px;
|
|
3108
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3109
|
+
background: ${bloomGradients};
|
|
3110
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3111
|
+
-webkit-mask-composite: xor;
|
|
3112
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3113
|
+
mask-composite: exclude;
|
|
3114
|
+
padding: ${borderWidth}px;
|
|
3115
|
+
pointer-events: none;
|
|
3116
|
+
z-index: 3;
|
|
3117
|
+
will-change: opacity;
|
|
3118
|
+
opacity: 0;
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3122
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3123
|
+
display: block;
|
|
3124
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-strength, 1));
|
|
3125
|
+
${bloomAnim}
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
3129
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
3130
|
+
${pausedAnimationsRule(id)}
|
|
3131
|
+
${flowOverlayCSS(options)}
|
|
3132
|
+
|
|
3133
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3134
|
+
[data-beam="${id}"][data-active],
|
|
3135
|
+
[data-beam="${id}"][data-fading],
|
|
3136
|
+
[data-beam="${id}"][data-active]::after,
|
|
3137
|
+
[data-beam="${id}"][data-fading]::after,
|
|
3138
|
+
[data-beam="${id}"][data-active]::before,
|
|
3139
|
+
[data-beam="${id}"][data-fading]::before,
|
|
3140
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3141
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3142
|
+
animation: none !important;
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
`;
|
|
3146
|
+
}
|
|
3147
|
+
/**
|
|
3148
|
+
* Pulse Outside — outward-blooming breathing glow
|
|
3149
|
+
* @param options
|
|
3150
|
+
*/
|
|
3151
|
+
function generatePulseOuterVariantCSS(options) {
|
|
3152
|
+
const { id, borderRadius, duration, strokeOpacity, innerOpacity, bloomOpacity, colorVariant, staticColors, brightness, saturation, theme, hairlineOpacity = 0 } = options;
|
|
3153
|
+
const isDark = theme === "dark";
|
|
3154
|
+
const monoMul = colorVariant === "mono" ? .5 : 1;
|
|
3155
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
3156
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
3157
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
3158
|
+
const hairRGB = isDark ? "70, 70, 70" : "0, 0, 0";
|
|
3159
|
+
const hairOp = hairlineOpacity.toFixed(2);
|
|
3160
|
+
const hairlineLine = `linear-gradient(rgba(${hairRGB}, ${hairOp}), rgba(${hairRGB}, ${hairOp}))`;
|
|
3161
|
+
const { op } = pulseParams("pulse-outside", theme, duration);
|
|
3162
|
+
const sw = .95;
|
|
3163
|
+
const sh = .9;
|
|
3164
|
+
const glowBlur = isDark ? 3 : 6;
|
|
3165
|
+
const bloomBlur = isDark ? 22.5 : 15;
|
|
3166
|
+
const b = brightness.toFixed(2);
|
|
3167
|
+
const s = saturation.toFixed(2);
|
|
3168
|
+
const strokeAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(var(--beam-hue-${id})) brightness(${b}) saturate(${s});`;
|
|
3169
|
+
const coreAnim = staticColors ? `filter: blur(${glowBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${glowBlur}px) hue-rotate(var(--beam-hue-${id})) brightness(${b}) saturate(${s});`;
|
|
3170
|
+
const bloomAnim = staticColors ? `filter: blur(${bloomBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${bloomBlur}px) hue-rotate(var(--beam-hue-${id})) brightness(${b}) saturate(${s});`;
|
|
3171
|
+
const strokeGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
3172
|
+
const coreGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
3173
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_OUTER_BLOOM, colorVariant, 1 - op * .5);
|
|
3174
|
+
const strokeBackground = hairlineOpacity > 0 ? `${strokeGradients},\n ${hairlineLine}` : strokeGradients;
|
|
3175
|
+
return `
|
|
3176
|
+
${pulsePropertyRegs(id)}
|
|
3177
|
+
|
|
3178
|
+
[data-beam="${id}"] {
|
|
3179
|
+
position: relative;
|
|
3180
|
+
border-radius: ${borderRadius}px;
|
|
3181
|
+
overflow: visible;
|
|
3182
|
+
isolation: isolate;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
[data-beam="${id}"][data-active] {
|
|
3186
|
+
${pulseWrapperAnimation(id, "beam-fade-in", .6)}
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
[data-beam="${id}"][data-fading] {
|
|
3190
|
+
${pulseWrapperAnimation(id, "beam-fade-out", .5)}
|
|
3191
|
+
}
|
|
3192
|
+
${hairlineOpacity > 0 ? `
|
|
3193
|
+
[data-beam="${id}"]::after {
|
|
3194
|
+
content: "";
|
|
3195
|
+
position: absolute;
|
|
3196
|
+
inset: 0;
|
|
3197
|
+
border-radius: ${borderRadius}px;
|
|
3198
|
+
padding: 1px;
|
|
3199
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3200
|
+
background: ${hairlineLine};
|
|
3201
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3202
|
+
-webkit-mask-composite: xor;
|
|
3203
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3204
|
+
mask-composite: exclude;
|
|
3205
|
+
pointer-events: none;
|
|
3206
|
+
z-index: 2;
|
|
3207
|
+
}
|
|
3208
|
+
` : ""}
|
|
3209
|
+
[data-beam="${id}"][data-active]::after,
|
|
3210
|
+
[data-beam="${id}"][data-fading]::after {
|
|
3211
|
+
content: "";
|
|
3212
|
+
position: absolute;
|
|
3213
|
+
inset: 0;
|
|
3214
|
+
border-radius: ${borderRadius}px;
|
|
3215
|
+
padding: 1px;
|
|
3216
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3217
|
+
background: ${strokeBackground};
|
|
3218
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3219
|
+
-webkit-mask-composite: xor;
|
|
3220
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
3221
|
+
mask-composite: exclude;
|
|
3222
|
+
pointer-events: none;
|
|
3223
|
+
z-index: 2;
|
|
3224
|
+
will-change: opacity, filter;
|
|
3225
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-strength, 1));
|
|
3226
|
+
${strokeAnim}
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
[data-beam="${id}"][data-active]::before,
|
|
3230
|
+
[data-beam="${id}"][data-fading]::before {
|
|
3231
|
+
content: "";
|
|
3232
|
+
position: absolute;
|
|
3233
|
+
inset: -10px;
|
|
3234
|
+
z-index: -1;
|
|
3235
|
+
border-radius: ${borderRadius + 10}px;
|
|
3236
|
+
background: ${coreGradients};
|
|
3237
|
+
transform: scale(${sw}, ${sh});
|
|
3238
|
+
pointer-events: none;
|
|
3239
|
+
will-change: opacity, filter;
|
|
3240
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-strength, 1));
|
|
3241
|
+
${coreAnim}
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
3245
|
+
display: none;
|
|
3246
|
+
position: absolute;
|
|
3247
|
+
inset: -30px;
|
|
3248
|
+
z-index: -1;
|
|
3249
|
+
border-radius: ${borderRadius + 30}px;
|
|
3250
|
+
background: ${bloomGradients};
|
|
3251
|
+
transform: scale(${sw}, ${sh});
|
|
3252
|
+
pointer-events: none;
|
|
3253
|
+
will-change: transform;
|
|
3254
|
+
opacity: 0;
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3258
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3259
|
+
display: block;
|
|
3260
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-strength, 1));
|
|
3261
|
+
${bloomAnim}
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
3265
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
3266
|
+
${pausedAnimationsRule(id)}
|
|
3267
|
+
${flowOverlayCSS(options)}
|
|
3268
|
+
|
|
3269
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3270
|
+
[data-beam="${id}"][data-active],
|
|
3271
|
+
[data-beam="${id}"][data-fading],
|
|
3272
|
+
[data-beam="${id}"][data-active]::after,
|
|
3273
|
+
[data-beam="${id}"][data-fading]::after,
|
|
3274
|
+
[data-beam="${id}"][data-active]::before,
|
|
3275
|
+
[data-beam="${id}"][data-fading]::before,
|
|
3276
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3277
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3278
|
+
animation: none !important;
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
`;
|
|
3282
|
+
}
|
|
3283
|
+
/**
|
|
3284
|
+
*
|
|
3285
|
+
* @param options
|
|
3286
|
+
*/
|
|
3287
|
+
function generateLineVariantCSS(options) {
|
|
3288
|
+
const { id, borderRadius, borderWidth, duration, strokeOpacity, innerOpacity, bloomOpacity, innerShadow, colorVariant, staticColors, brightness, saturation, hueRange, theme } = options;
|
|
3289
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
3290
|
+
const isDark = theme === "dark";
|
|
3291
|
+
const finalStrokeOpacity = strokeOpacity;
|
|
3292
|
+
const finalInnerOpacity = innerOpacity;
|
|
3293
|
+
const finalBloomOpacity = bloomOpacity;
|
|
3294
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
3295
|
+
const hueShiftBloomAnimation = staticColors ? "" : `animation: beam-hue-shift-bloom-${id} 8s ease-in-out infinite;`;
|
|
3296
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
3297
|
+
@keyframes beam-hue-shift-${id} {
|
|
3298
|
+
0% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3299
|
+
50% { filter: hue-rotate(${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3300
|
+
100% { filter: hue-rotate(-${hueRange}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
@keyframes beam-hue-shift-bloom-${id} {
|
|
3304
|
+
0% { filter: blur(8px) hue-rotate(-${hueRange + 10}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3305
|
+
50% { filter: blur(8px) hue-rotate(${hueRange + 10}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3306
|
+
100% { filter: blur(8px) hue-rotate(-${hueRange + 10}deg) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
3307
|
+
}`;
|
|
3308
|
+
const whiteHighlight = isDark ? `radial-gradient(
|
|
3309
|
+
ellipse calc(24px * var(--beam-density, 1) * var(--beam-w-${id})) calc(28px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
3310
|
+
rgba(255, 255, 255, 0.38) 0%,
|
|
3311
|
+
rgba(255, 255, 255, 0.12) 30%,
|
|
3312
|
+
transparent 65%
|
|
3313
|
+
)` : `radial-gradient(
|
|
3314
|
+
ellipse calc(35px * var(--beam-density, 1) * var(--beam-w-${id})) calc(28px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
3315
|
+
rgba(0, 0, 0, 0.6) 0%,
|
|
3316
|
+
rgba(0, 0, 0, 0.25) 35%,
|
|
3317
|
+
transparent 70%
|
|
3318
|
+
)`;
|
|
3319
|
+
const colorGradients = getLineColorGradients(colorVariant, isDark, id);
|
|
3320
|
+
const innerGradients = getLineInnerGradients(colorVariant, id);
|
|
3321
|
+
const bloomGradients = getLineBloomGradients(colorVariant, isDark, id);
|
|
3322
|
+
const monoBloomBlur = colorVariant === "mono" ? "filter: blur(6px);" : "";
|
|
3323
|
+
return `
|
|
3324
|
+
@property --beam-x-${id} {
|
|
3325
|
+
syntax: "<number>";
|
|
3326
|
+
initial-value: 0;
|
|
3327
|
+
inherits: true;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
@property --beam-w-${id} {
|
|
3331
|
+
syntax: "<number>";
|
|
3332
|
+
initial-value: 1;
|
|
3333
|
+
inherits: true;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
@property --beam-h-${id} {
|
|
3337
|
+
syntax: "<number>";
|
|
3338
|
+
initial-value: 1;
|
|
3339
|
+
inherits: true;
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
@property --beam-spike-${id} {
|
|
3343
|
+
syntax: "<number>";
|
|
3344
|
+
initial-value: 1;
|
|
3345
|
+
inherits: true;
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
@property --beam-spike2-${id} {
|
|
3349
|
+
syntax: "<number>";
|
|
3350
|
+
initial-value: 1;
|
|
3351
|
+
inherits: true;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
@property --beam-edge-${id} {
|
|
3355
|
+
syntax: "<number>";
|
|
3356
|
+
initial-value: 1;
|
|
3357
|
+
inherits: true;
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
@property --beam-opacity-${id} {
|
|
3361
|
+
syntax: "<number>";
|
|
3362
|
+
initial-value: 0;
|
|
3363
|
+
inherits: true;
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
[data-beam="${id}"] {
|
|
3367
|
+
position: relative;
|
|
3368
|
+
border-radius: ${borderRadius}px;
|
|
3369
|
+
overflow: hidden;
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
[data-beam="${id}"][data-active] {
|
|
3373
|
+
animation:
|
|
3374
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
3375
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
3376
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
3377
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
3378
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
3379
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3382
|
+
[data-beam="${id}"][data-fading] {
|
|
3383
|
+
animation:
|
|
3384
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
3385
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
3386
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
3387
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
3388
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
3389
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
[data-beam="${id}"][data-active]::after,
|
|
3393
|
+
[data-beam="${id}"][data-fading]::after {
|
|
3394
|
+
content: "";
|
|
3395
|
+
position: absolute;
|
|
3396
|
+
inset: 0;
|
|
3397
|
+
border-radius: ${innerRadius}px;
|
|
3398
|
+
padding: ${borderWidth}px;
|
|
3399
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3400
|
+
background: ${whiteHighlight}, ${colorGradients};
|
|
3401
|
+
-webkit-mask:
|
|
3402
|
+
radial-gradient(
|
|
3403
|
+
ellipse calc(78px * var(--beam-density, 1) * var(--beam-w-${id})) calc(60px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3404
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
3405
|
+
),
|
|
3406
|
+
linear-gradient(#fff 0 0) content-box,
|
|
3407
|
+
linear-gradient(#fff 0 0);
|
|
3408
|
+
-webkit-mask-composite: source-in, xor;
|
|
3409
|
+
mask:
|
|
3410
|
+
radial-gradient(
|
|
3411
|
+
ellipse calc(78px * var(--beam-density, 1) * var(--beam-w-${id})) calc(60px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3412
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
3413
|
+
),
|
|
3414
|
+
linear-gradient(#fff 0 0) content-box,
|
|
3415
|
+
linear-gradient(#fff 0 0);
|
|
3416
|
+
mask-composite: intersect, exclude;
|
|
3417
|
+
pointer-events: none;
|
|
3418
|
+
z-index: 2;
|
|
3419
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
3420
|
+
${hueShiftAnimation}
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
[data-beam="${id}"][data-active]::before,
|
|
3424
|
+
[data-beam="${id}"][data-fading]::before {
|
|
3425
|
+
content: "";
|
|
3426
|
+
position: absolute;
|
|
3427
|
+
inset: 0;
|
|
3428
|
+
border-radius: ${borderRadius}px;
|
|
3429
|
+
background: ${innerGradients};
|
|
3430
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
3431
|
+
-webkit-mask-image:
|
|
3432
|
+
radial-gradient(
|
|
3433
|
+
ellipse calc(78px * var(--beam-density, 1) * var(--beam-w-${id})) calc(60px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3434
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
3435
|
+
),
|
|
3436
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
3437
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
3438
|
+
-webkit-mask-composite: source-in, source-over;
|
|
3439
|
+
mask-image:
|
|
3440
|
+
radial-gradient(
|
|
3441
|
+
ellipse calc(78px * var(--beam-density, 1) * var(--beam-w-${id})) calc(60px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3442
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
3443
|
+
),
|
|
3444
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
3445
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
3446
|
+
mask-composite: intersect, add;
|
|
3447
|
+
pointer-events: none;
|
|
3448
|
+
z-index: 1;
|
|
3449
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
3450
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3451
|
+
${hueShiftAnimation}
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
3455
|
+
display: none;
|
|
3456
|
+
position: absolute;
|
|
3457
|
+
inset: 0;
|
|
3458
|
+
border-radius: ${innerRadius}px;
|
|
3459
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
3460
|
+
padding: 0;
|
|
3461
|
+
-webkit-mask: radial-gradient(
|
|
3462
|
+
ellipse calc(84px * var(--beam-density, 1) * var(--beam-w-${id})) calc(110px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3463
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
3464
|
+
);
|
|
3465
|
+
-webkit-mask-composite: source-over;
|
|
3466
|
+
mask: radial-gradient(
|
|
3467
|
+
ellipse calc(84px * var(--beam-density, 1) * var(--beam-w-${id})) calc(110px * var(--beam-density, 1) * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
3468
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
3469
|
+
);
|
|
3470
|
+
mask-composite: add;
|
|
3471
|
+
background: ${bloomGradients};
|
|
3472
|
+
${monoBloomBlur}
|
|
3473
|
+
pointer-events: none;
|
|
3474
|
+
z-index: 3;
|
|
3475
|
+
opacity: 0;
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
3479
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
3480
|
+
display: block;
|
|
3481
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-strength, 1));
|
|
3482
|
+
${hueShiftBloomAnimation}
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
@keyframes beam-travel-${id} {
|
|
3486
|
+
0% { --beam-x-${id}: 0.06; --beam-w-${id}: 0.5; }
|
|
3487
|
+
10% { --beam-x-${id}: 0.15; --beam-w-${id}: 0.8; }
|
|
3488
|
+
20% { --beam-x-${id}: 0.25; --beam-w-${id}: 1.1; }
|
|
3489
|
+
30% { --beam-x-${id}: 0.35; --beam-w-${id}: 1.3; }
|
|
3490
|
+
40% { --beam-x-${id}: 0.44; --beam-w-${id}: 1.45; }
|
|
3491
|
+
50% { --beam-x-${id}: 0.5; --beam-w-${id}: 1.5; }
|
|
3492
|
+
60% { --beam-x-${id}: 0.56; --beam-w-${id}: 1.45; }
|
|
3493
|
+
70% { --beam-x-${id}: 0.65; --beam-w-${id}: 1.3; }
|
|
3494
|
+
80% { --beam-x-${id}: 0.75; --beam-w-${id}: 1.1; }
|
|
3495
|
+
90% { --beam-x-${id}: 0.85; --beam-w-${id}: 0.8; }
|
|
3496
|
+
100% { --beam-x-${id}: 0.94; --beam-w-${id}: 0.5; }
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
@keyframes beam-edge-fade-${id} {
|
|
3500
|
+
0% { --beam-edge-${id}: 0; }
|
|
3501
|
+
12.5% { --beam-edge-${id}: 0; }
|
|
3502
|
+
32.5% { --beam-edge-${id}: 1; }
|
|
3503
|
+
67.5% { --beam-edge-${id}: 1; }
|
|
3504
|
+
87.5% { --beam-edge-${id}: 0; }
|
|
3505
|
+
100% { --beam-edge-${id}: 0; }
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
@keyframes beam-breathe-${id} {
|
|
3509
|
+
0%, 100% { --beam-h-${id}: 0.8; }
|
|
3510
|
+
25% { --beam-h-${id}: 1.25; }
|
|
3511
|
+
55% { --beam-h-${id}: 0.85; }
|
|
3512
|
+
80% { --beam-h-${id}: 1.3; }
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
@keyframes beam-spike-${id} {
|
|
3516
|
+
0% { --beam-spike-${id}: 0.8; }
|
|
3517
|
+
25% { --beam-spike-${id}: 1.3; }
|
|
3518
|
+
50% { --beam-spike-${id}: 0.9; }
|
|
3519
|
+
75% { --beam-spike-${id}: 1.4; }
|
|
3520
|
+
100% { --beam-spike-${id}: 0.8; }
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
@keyframes beam-spike2-${id} {
|
|
3524
|
+
0% { --beam-spike2-${id}: 1.2; }
|
|
3525
|
+
25% { --beam-spike2-${id}: 0.7; }
|
|
3526
|
+
50% { --beam-spike2-${id}: 1.4; }
|
|
3527
|
+
75% { --beam-spike2-${id}: 0.8; }
|
|
3528
|
+
100% { --beam-spike2-${id}: 1.2; }
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
@keyframes beam-fade-in-${id} {
|
|
3532
|
+
to { --beam-opacity-${id}: 1; }
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
@keyframes beam-fade-out-${id} {
|
|
3536
|
+
from { --beam-opacity-${id}: 1; }
|
|
3537
|
+
to { --beam-opacity-${id}: 0; }
|
|
3538
|
+
}
|
|
3539
|
+
${hueShiftKeyframes}
|
|
3540
|
+
${pausedAnimationsRule(id)}
|
|
3541
|
+
${flowOverlayCSS(options)}
|
|
3542
|
+
`;
|
|
3543
|
+
}
|
|
3544
|
+
//#endregion
|
|
3545
|
+
export { generateBeamCSS, getPulseDriverConfig, sizePresets, sizeThemePresets };
|