@invergent/ui-sdk 0.0.0-stage → 2.19.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 +62 -2
- package/dist/accordion.cjs +97 -0
- package/dist/accordion.cjs.map +1 -0
- package/dist/accordion.d.cts +10 -0
- package/dist/accordion.d.ts +10 -0
- package/dist/accordion.js +92 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.cjs +82 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.d.cts +14 -0
- package/dist/alert.d.ts +14 -0
- package/dist/alert.js +77 -0
- package/dist/alert.js.map +1 -0
- package/dist/avatar.cjs +110 -0
- package/dist/avatar.cjs.map +1 -0
- package/dist/avatar.d.cts +14 -0
- package/dist/avatar.d.ts +14 -0
- package/dist/avatar.js +103 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.cjs +47 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.d.cts +13 -0
- package/dist/badge.d.ts +13 -0
- package/dist/badge.js +44 -0
- package/dist/badge.js.map +1 -0
- package/dist/brand-beam.cjs +2303 -0
- package/dist/brand-beam.cjs.map +1 -0
- package/dist/brand-beam.d.cts +36 -0
- package/dist/brand-beam.d.ts +36 -0
- package/dist/brand-beam.js +2301 -0
- package/dist/brand-beam.js.map +1 -0
- package/dist/button.cjs +17 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.d.cts +14 -0
- package/dist/button.d.ts +14 -0
- package/dist/button.js +4 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +109 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.d.cts +14 -0
- package/dist/card.d.ts +14 -0
- package/dist/card.js +101 -0
- package/dist/card.js.map +1 -0
- package/dist/chart.cjs +275 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.cts +47 -0
- package/dist/chart.d.ts +47 -0
- package/dist/chart.js +247 -0
- package/dist/chart.js.map +1 -0
- package/dist/checkbox.cjs +41 -0
- package/dist/checkbox.cjs.map +1 -0
- package/dist/checkbox.d.cts +7 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.js +39 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.cjs +92 -0
- package/dist/chip.cjs.map +1 -0
- package/dist/chip.d.cts +33 -0
- package/dist/chip.d.ts +33 -0
- package/dist/chip.js +86 -0
- package/dist/chip.js.map +1 -0
- package/dist/choice-card.cjs +127 -0
- package/dist/choice-card.cjs.map +1 -0
- package/dist/choice-card.d.cts +20 -0
- package/dist/choice-card.d.ts +20 -0
- package/dist/choice-card.js +124 -0
- package/dist/choice-card.js.map +1 -0
- package/dist/chunk-2UHRDVPT.cjs +183 -0
- package/dist/chunk-2UHRDVPT.cjs.map +1 -0
- package/dist/chunk-5CRE35VX.js +20 -0
- package/dist/chunk-5CRE35VX.js.map +1 -0
- package/dist/chunk-6ARYCL4L.cjs +30 -0
- package/dist/chunk-6ARYCL4L.cjs.map +1 -0
- package/dist/chunk-6JCVTRUK.js +21 -0
- package/dist/chunk-6JCVTRUK.js.map +1 -0
- package/dist/chunk-6YHDDRIM.cjs +13 -0
- package/dist/chunk-6YHDDRIM.cjs.map +1 -0
- package/dist/chunk-A44JJ6NH.js +58 -0
- package/dist/chunk-A44JJ6NH.js.map +1 -0
- package/dist/chunk-CPAFEXKR.js +63 -0
- package/dist/chunk-CPAFEXKR.js.map +1 -0
- package/dist/chunk-CTIEUG5L.js +28 -0
- package/dist/chunk-CTIEUG5L.js.map +1 -0
- package/dist/chunk-DSDDDYG3.cjs +60 -0
- package/dist/chunk-DSDDDYG3.cjs.map +1 -0
- package/dist/chunk-IB7LTHEQ.js +55 -0
- package/dist/chunk-IB7LTHEQ.js.map +1 -0
- package/dist/chunk-ID7MWMJO.cjs +162 -0
- package/dist/chunk-ID7MWMJO.cjs.map +1 -0
- package/dist/chunk-IVMZANP7.cjs +67 -0
- package/dist/chunk-IVMZANP7.cjs.map +1 -0
- package/dist/chunk-L73QIINW.js +157 -0
- package/dist/chunk-L73QIINW.js.map +1 -0
- package/dist/chunk-LZGII7SX.js +11 -0
- package/dist/chunk-LZGII7SX.js.map +1 -0
- package/dist/chunk-M677T75H.js +24 -0
- package/dist/chunk-M677T75H.js.map +1 -0
- package/dist/chunk-OAVCB3MR.cjs +26 -0
- package/dist/chunk-OAVCB3MR.cjs.map +1 -0
- package/dist/chunk-RVX6SN4U.cjs +23 -0
- package/dist/chunk-RVX6SN4U.cjs.map +1 -0
- package/dist/chunk-T74Z3WTK.js +151 -0
- package/dist/chunk-T74Z3WTK.js.map +1 -0
- package/dist/chunk-UOUXW63J.cjs +22 -0
- package/dist/chunk-UOUXW63J.cjs.map +1 -0
- package/dist/chunk-VBICNC43.cjs +61 -0
- package/dist/chunk-VBICNC43.cjs.map +1 -0
- package/dist/collapsible-header.cjs +66 -0
- package/dist/collapsible-header.cjs.map +1 -0
- package/dist/collapsible-header.d.cts +15 -0
- package/dist/collapsible-header.d.ts +15 -0
- package/dist/collapsible-header.js +63 -0
- package/dist/collapsible-header.js.map +1 -0
- package/dist/collapsible.cjs +38 -0
- package/dist/collapsible.cjs.map +1 -0
- package/dist/collapsible.d.cts +8 -0
- package/dist/collapsible.d.ts +8 -0
- package/dist/collapsible.js +34 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/color-picker.cjs +60 -0
- package/dist/color-picker.cjs.map +1 -0
- package/dist/color-picker.d.cts +12 -0
- package/dist/color-picker.d.ts +12 -0
- package/dist/color-picker.js +57 -0
- package/dist/color-picker.js.map +1 -0
- package/dist/confirm-dialog.cjs +72 -0
- package/dist/confirm-dialog.cjs.map +1 -0
- package/dist/confirm-dialog.d.cts +19 -0
- package/dist/confirm-dialog.d.ts +19 -0
- package/dist/confirm-dialog.js +70 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/control-styles.cjs +16 -0
- package/dist/control-styles.cjs.map +1 -0
- package/dist/control-styles.d.cts +7 -0
- package/dist/control-styles.d.ts +7 -0
- package/dist/control-styles.js +10 -0
- package/dist/control-styles.js.map +1 -0
- package/dist/dialog.cjs +50 -0
- package/dist/dialog.cjs.map +1 -0
- package/dist/dialog.d.cts +20 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.js +5 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dropdown-menu.cjs +265 -0
- package/dist/dropdown-menu.cjs.map +1 -0
- package/dist/dropdown-menu.d.cts +32 -0
- package/dist/dropdown-menu.d.ts +32 -0
- package/dist/dropdown-menu.js +249 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/empty-state.cjs +50 -0
- package/dist/empty-state.cjs.map +1 -0
- package/dist/empty-state.d.cts +23 -0
- package/dist/empty-state.d.ts +23 -0
- package/dist/empty-state.js +47 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/field.cjs +221 -0
- package/dist/field.cjs.map +1 -0
- package/dist/field.d.cts +30 -0
- package/dist/field.d.ts +30 -0
- package/dist/field.js +210 -0
- package/dist/field.js.map +1 -0
- package/dist/input-group.cjs +148 -0
- package/dist/input-group.cjs.map +1 -0
- package/dist/input-group.d.cts +20 -0
- package/dist/input-group.d.ts +20 -0
- package/dist/input-group.js +141 -0
- package/dist/input-group.js.map +1 -0
- package/dist/input.cjs +13 -0
- package/dist/input.cjs.map +1 -0
- package/dist/input.d.cts +6 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +4 -0
- package/dist/input.js.map +1 -0
- package/dist/label.cjs +13 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.cts +7 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.js +4 -0
- package/dist/label.js.map +1 -0
- package/dist/lib/utils.cjs +12 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.d.cts +5 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +3 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/list-row.cjs +188 -0
- package/dist/list-row.cjs.map +1 -0
- package/dist/list-row.d.cts +51 -0
- package/dist/list-row.d.ts +51 -0
- package/dist/list-row.js +164 -0
- package/dist/list-row.js.map +1 -0
- package/dist/pill-tabs.cjs +109 -0
- package/dist/pill-tabs.cjs.map +1 -0
- package/dist/pill-tabs.d.cts +24 -0
- package/dist/pill-tabs.d.ts +24 -0
- package/dist/pill-tabs.js +107 -0
- package/dist/pill-tabs.js.map +1 -0
- package/dist/popover.cjs +88 -0
- package/dist/popover.cjs.map +1 -0
- package/dist/popover.d.cts +13 -0
- package/dist/popover.d.ts +13 -0
- package/dist/popover.js +80 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress-bar.cjs +28 -0
- package/dist/progress-bar.cjs.map +1 -0
- package/dist/progress-bar.d.cts +11 -0
- package/dist/progress-bar.d.ts +11 -0
- package/dist/progress-bar.js +26 -0
- package/dist/progress-bar.js.map +1 -0
- package/dist/scroll-area.cjs +63 -0
- package/dist/scroll-area.cjs.map +1 -0
- package/dist/scroll-area.d.cts +8 -0
- package/dist/scroll-area.d.ts +8 -0
- package/dist/scroll-area.js +60 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/section-label.cjs +30 -0
- package/dist/section-label.cjs.map +1 -0
- package/dist/section-label.d.cts +13 -0
- package/dist/section-label.d.ts +13 -0
- package/dist/section-label.js +28 -0
- package/dist/section-label.js.map +1 -0
- package/dist/segmented-control.cjs +75 -0
- package/dist/segmented-control.cjs.map +1 -0
- package/dist/segmented-control.d.cts +26 -0
- package/dist/segmented-control.d.ts +26 -0
- package/dist/segmented-control.js +53 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select.cjs +193 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.d.cts +18 -0
- package/dist/select.d.ts +18 -0
- package/dist/select.js +182 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.cjs +13 -0
- package/dist/separator.cjs.map +1 -0
- package/dist/separator.d.cts +7 -0
- package/dist/separator.d.ts +7 -0
- package/dist/separator.js +4 -0
- package/dist/separator.js.map +1 -0
- package/dist/sidebar.cjs +29 -0
- package/dist/sidebar.cjs.map +1 -0
- package/dist/sidebar.d.cts +58 -0
- package/dist/sidebar.d.ts +58 -0
- package/dist/sidebar.js +4 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/skeleton.cjs +19 -0
- package/dist/skeleton.cjs.map +1 -0
- package/dist/skeleton.d.cts +5 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +17 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/sonner.cjs +40 -0
- package/dist/sonner.cjs.map +1 -0
- package/dist/sonner.d.cts +6 -0
- package/dist/sonner.d.ts +6 -0
- package/dist/sonner.js +38 -0
- package/dist/sonner.js.map +1 -0
- package/dist/sparkline.cjs +44 -0
- package/dist/sparkline.cjs.map +1 -0
- package/dist/sparkline.d.cts +12 -0
- package/dist/sparkline.d.ts +12 -0
- package/dist/sparkline.js +42 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/spinner.cjs +13 -0
- package/dist/spinner.cjs.map +1 -0
- package/dist/spinner.d.cts +5 -0
- package/dist/spinner.d.ts +5 -0
- package/dist/spinner.js +11 -0
- package/dist/spinner.js.map +1 -0
- package/dist/stat-card.cjs +65 -0
- package/dist/stat-card.cjs.map +1 -0
- package/dist/stat-card.d.cts +22 -0
- package/dist/stat-card.d.ts +22 -0
- package/dist/stat-card.js +61 -0
- package/dist/stat-card.js.map +1 -0
- package/dist/status-dot.cjs +32 -0
- package/dist/status-dot.cjs.map +1 -0
- package/dist/status-dot.d.cts +11 -0
- package/dist/status-dot.d.ts +11 -0
- package/dist/status-dot.js +29 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/switch.cjs +38 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.d.cts +9 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.js +36 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.cjs +118 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +13 -0
- package/dist/table.d.ts +13 -0
- package/dist/table.js +109 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +124 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.d.cts +15 -0
- package/dist/tabs.d.ts +15 -0
- package/dist/tabs.js +118 -0
- package/dist/tabs.js.map +1 -0
- package/dist/text-link.cjs +51 -0
- package/dist/text-link.cjs.map +1 -0
- package/dist/text-link.d.cts +15 -0
- package/dist/text-link.d.ts +15 -0
- package/dist/text-link.js +48 -0
- package/dist/text-link.js.map +1 -0
- package/dist/textarea.cjs +13 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.d.cts +6 -0
- package/dist/textarea.d.ts +6 -0
- package/dist/textarea.js +4 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme.css +109 -0
- package/dist/toggle-group.cjs +155 -0
- package/dist/toggle-group.cjs.map +1 -0
- package/dist/toggle-group.d.cts +31 -0
- package/dist/toggle-group.d.ts +31 -0
- package/dist/toggle-group.js +130 -0
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle.cjs +21 -0
- package/dist/toggle.cjs.map +1 -0
- package/dist/toggle.d.cts +23 -0
- package/dist/toggle.d.ts +23 -0
- package/dist/toggle.js +4 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tokens.css +77 -0
- package/dist/tooltip.cjs +25 -0
- package/dist/tooltip.cjs.map +1 -0
- package/dist/tooltip.d.cts +10 -0
- package/dist/tooltip.d.ts +10 -0
- package/dist/tooltip.js +4 -0
- package/dist/tooltip.js.map +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,2303 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
// src/brand-beam.tsx
|
|
7
|
+
|
|
8
|
+
// src/border-beam/styles.ts
|
|
9
|
+
var sizePresets = {
|
|
10
|
+
sm: {
|
|
11
|
+
borderRadius: 32,
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
width: 70,
|
|
14
|
+
height: 36
|
|
15
|
+
},
|
|
16
|
+
md: {
|
|
17
|
+
borderRadius: 16,
|
|
18
|
+
borderWidth: 1
|
|
19
|
+
},
|
|
20
|
+
line: {
|
|
21
|
+
borderRadius: 16,
|
|
22
|
+
borderWidth: 1
|
|
23
|
+
},
|
|
24
|
+
"pulse-outside": {
|
|
25
|
+
borderRadius: 16,
|
|
26
|
+
borderWidth: 1
|
|
27
|
+
},
|
|
28
|
+
"pulse-inner": {
|
|
29
|
+
borderRadius: 16,
|
|
30
|
+
borderWidth: 1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var sizeThemePresets = {
|
|
34
|
+
sm: {
|
|
35
|
+
dark: {
|
|
36
|
+
strokeOpacity: 0.46,
|
|
37
|
+
innerOpacity: 0.24,
|
|
38
|
+
bloomOpacity: 0.38,
|
|
39
|
+
innerShadow: "rgba(255, 255, 255, 0.3)",
|
|
40
|
+
saturation: 1.2
|
|
41
|
+
},
|
|
42
|
+
light: {
|
|
43
|
+
strokeOpacity: 0.12,
|
|
44
|
+
innerOpacity: 0.3,
|
|
45
|
+
bloomOpacity: 0.16,
|
|
46
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
47
|
+
saturation: 1.8
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
md: {
|
|
51
|
+
dark: {
|
|
52
|
+
strokeOpacity: 0.26,
|
|
53
|
+
innerOpacity: 0.42,
|
|
54
|
+
bloomOpacity: 0.24,
|
|
55
|
+
innerShadow: "rgba(255, 255, 255, 0.27)",
|
|
56
|
+
saturation: 1.2
|
|
57
|
+
},
|
|
58
|
+
light: {
|
|
59
|
+
strokeOpacity: 0.12,
|
|
60
|
+
innerOpacity: 0.26,
|
|
61
|
+
bloomOpacity: 0.34,
|
|
62
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
63
|
+
saturation: 1.5
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
line: {
|
|
67
|
+
dark: {
|
|
68
|
+
strokeOpacity: 1.14,
|
|
69
|
+
innerOpacity: 0.7,
|
|
70
|
+
bloomOpacity: 0.8,
|
|
71
|
+
innerShadow: "rgba(255, 255, 255, 0.1)",
|
|
72
|
+
saturation: 1.2
|
|
73
|
+
},
|
|
74
|
+
light: {
|
|
75
|
+
strokeOpacity: 0.16,
|
|
76
|
+
innerOpacity: 0.32,
|
|
77
|
+
bloomOpacity: 0.3,
|
|
78
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
79
|
+
saturation: 1.95
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
// Pulse Outside — outward-blooming breathe (ported from v5 "Breathe Outside Uncropped" / c6)
|
|
83
|
+
"pulse-outside": {
|
|
84
|
+
dark: {
|
|
85
|
+
strokeOpacity: 0.94,
|
|
86
|
+
innerOpacity: 0.34,
|
|
87
|
+
bloomOpacity: 0.3,
|
|
88
|
+
innerShadow: "transparent",
|
|
89
|
+
saturation: 1.2,
|
|
90
|
+
brightness: 1.9,
|
|
91
|
+
// v5 Card 5 frames the card with a single 1px hairline (its box-shadow at
|
|
92
|
+
// 0.3). Wrapped components here already supply their own ~equivalent 1px
|
|
93
|
+
// border, so the beam must NOT add a second hairline on top or the edge
|
|
94
|
+
// reads brighter than v5. Kept at 0 to match v5's single-hairline look.
|
|
95
|
+
hairlineOpacity: 0
|
|
96
|
+
},
|
|
97
|
+
light: {
|
|
98
|
+
strokeOpacity: 1.96,
|
|
99
|
+
innerOpacity: 1.04,
|
|
100
|
+
bloomOpacity: 0.42,
|
|
101
|
+
innerShadow: "transparent",
|
|
102
|
+
saturation: 0.6,
|
|
103
|
+
brightness: 1.7,
|
|
104
|
+
hairlineOpacity: 0
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
// Pulse Inner — contained breathe (ported from v5 "Breathe" / c4)
|
|
108
|
+
"pulse-inner": {
|
|
109
|
+
dark: {
|
|
110
|
+
strokeOpacity: 1.54,
|
|
111
|
+
innerOpacity: 0.44,
|
|
112
|
+
bloomOpacity: 0.66,
|
|
113
|
+
innerShadow: "transparent",
|
|
114
|
+
saturation: 1.2,
|
|
115
|
+
brightness: 0.75
|
|
116
|
+
},
|
|
117
|
+
light: {
|
|
118
|
+
strokeOpacity: 0.32,
|
|
119
|
+
innerOpacity: 0.4,
|
|
120
|
+
bloomOpacity: 0.8,
|
|
121
|
+
innerShadow: "transparent",
|
|
122
|
+
saturation: 0.75,
|
|
123
|
+
brightness: 1.3
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var colorPalettes = {
|
|
128
|
+
colorful: {
|
|
129
|
+
border: [
|
|
130
|
+
{ color: "rgb(255, 50, 100)", pos: "33% -7.4%", size: "70px 40px" },
|
|
131
|
+
{ color: "rgb(40, 140, 255)", pos: "12% -5%", size: "60px 35px" },
|
|
132
|
+
{ color: "rgb(50, 200, 80)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
133
|
+
{ color: "rgb(30, 185, 170)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
134
|
+
{ color: "rgb(100, 70, 255)", pos: "74.4% 100%", size: "180px 32px" },
|
|
135
|
+
{ color: "rgb(40, 140, 255)", pos: "55% 100%", size: "85px 26px" },
|
|
136
|
+
{ color: "rgb(255, 120, 40)", pos: "93.9% 0%", size: "74px 32px" },
|
|
137
|
+
{ color: "rgb(240, 50, 180)", pos: "100% 27.1%", size: "26px 42px" },
|
|
138
|
+
{ color: "rgb(180, 40, 240)", pos: "100% 27.1%", size: "52px 48px" }
|
|
139
|
+
],
|
|
140
|
+
spike: { primary: "rgb(255, 60, 80)", secondary: "rgba(40, 190, 180, 0.98)" },
|
|
141
|
+
spikeLt: { primary: "rgb(200, 30, 60)", secondary: "rgb(20, 150, 140)" }
|
|
142
|
+
},
|
|
143
|
+
mono: {
|
|
144
|
+
border: [
|
|
145
|
+
{ color: "rgb(180, 180, 180)", pos: "33% -7.4%", size: "70px 40px" },
|
|
146
|
+
{ color: "rgb(140, 140, 140)", pos: "12% -5%", size: "60px 35px" },
|
|
147
|
+
{ color: "rgb(160, 160, 160)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
148
|
+
{ color: "rgb(130, 130, 130)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
149
|
+
{ color: "rgb(170, 170, 170)", pos: "74.4% 100%", size: "180px 32px" },
|
|
150
|
+
{ color: "rgb(150, 150, 150)", pos: "55% 100%", size: "85px 26px" },
|
|
151
|
+
{ color: "rgb(190, 190, 190)", pos: "93.9% 0%", size: "74px 32px" },
|
|
152
|
+
{ color: "rgb(145, 145, 145)", pos: "100% 27.1%", size: "26px 42px" },
|
|
153
|
+
{ color: "rgb(165, 165, 165)", pos: "100% 27.1%", size: "52px 48px" }
|
|
154
|
+
],
|
|
155
|
+
spike: { primary: "rgb(200, 200, 200)", secondary: "rgb(170, 170, 170)" },
|
|
156
|
+
spikeLt: { primary: "rgb(80, 80, 80)", secondary: "rgb(120, 120, 120)" }
|
|
157
|
+
},
|
|
158
|
+
ocean: {
|
|
159
|
+
border: [
|
|
160
|
+
{ color: "rgb(100, 80, 220)", pos: "33% -7.4%", size: "70px 40px" },
|
|
161
|
+
{ color: "rgb(60, 120, 255)", pos: "12% -5%", size: "60px 35px" },
|
|
162
|
+
{ color: "rgb(80, 100, 200)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
163
|
+
{ color: "rgb(50, 140, 220)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
164
|
+
{ color: "rgb(120, 80, 255)", pos: "74.4% 100%", size: "180px 32px" },
|
|
165
|
+
{ color: "rgb(70, 130, 255)", pos: "55% 100%", size: "85px 26px" },
|
|
166
|
+
{ color: "rgb(140, 100, 240)", pos: "93.9% 0%", size: "74px 32px" },
|
|
167
|
+
{ color: "rgb(90, 110, 230)", pos: "100% 27.1%", size: "26px 42px" },
|
|
168
|
+
{ color: "rgb(130, 70, 255)", pos: "100% 27.1%", size: "52px 48px" }
|
|
169
|
+
],
|
|
170
|
+
spike: { primary: "rgb(100, 120, 255)", secondary: "rgba(130, 100, 220, 0.98)" },
|
|
171
|
+
spikeLt: { primary: "rgb(60, 60, 180)", secondary: "rgb(80, 100, 200)" }
|
|
172
|
+
},
|
|
173
|
+
sunset: {
|
|
174
|
+
border: [
|
|
175
|
+
{ color: "rgb(255, 80, 50)", pos: "33% -7.4%", size: "70px 40px" },
|
|
176
|
+
{ color: "rgb(255, 160, 40)", pos: "12% -5%", size: "60px 35px" },
|
|
177
|
+
{ color: "rgb(255, 120, 60)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
178
|
+
{ color: "rgb(255, 200, 50)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
179
|
+
{ color: "rgb(255, 100, 80)", pos: "74.4% 100%", size: "180px 32px" },
|
|
180
|
+
{ color: "rgb(255, 180, 60)", pos: "55% 100%", size: "85px 26px" },
|
|
181
|
+
{ color: "rgb(255, 60, 60)", pos: "93.9% 0%", size: "74px 32px" },
|
|
182
|
+
{ color: "rgb(255, 140, 50)", pos: "100% 27.1%", size: "26px 42px" },
|
|
183
|
+
{ color: "rgb(255, 90, 70)", pos: "100% 27.1%", size: "52px 48px" }
|
|
184
|
+
],
|
|
185
|
+
spike: { primary: "rgb(255, 140, 80)", secondary: "rgba(255, 100, 60, 0.98)" },
|
|
186
|
+
spikeLt: { primary: "rgb(200, 80, 40)", secondary: "rgb(220, 120, 30)" }
|
|
187
|
+
},
|
|
188
|
+
brand: {
|
|
189
|
+
border: [
|
|
190
|
+
{ color: "rgb(217, 119, 6)", pos: "33% -7.4%", size: "70px 40px" },
|
|
191
|
+
{ color: "rgb(245, 158, 11)", pos: "12% -5%", size: "60px 35px" },
|
|
192
|
+
{ color: "rgb(234, 138, 9)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
193
|
+
{ color: "rgb(252, 211, 77)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
194
|
+
{ color: "rgb(245, 158, 11)", pos: "74.4% 100%", size: "180px 32px" },
|
|
195
|
+
{ color: "rgb(251, 191, 36)", pos: "55% 100%", size: "85px 26px" },
|
|
196
|
+
{ color: "rgb(217, 119, 6)", pos: "93.9% 0%", size: "74px 32px" },
|
|
197
|
+
{ color: "rgb(251, 191, 36)", pos: "100% 27.1%", size: "26px 42px" },
|
|
198
|
+
{ color: "rgb(245, 158, 11)", pos: "100% 27.1%", size: "52px 48px" }
|
|
199
|
+
],
|
|
200
|
+
spike: { primary: "rgb(251, 191, 36)", secondary: "rgba(245, 158, 11, 0.98)" },
|
|
201
|
+
spikeLt: { primary: "rgb(180, 83, 9)", secondary: "rgb(202, 138, 4)" }
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
var smallColorPalettes = {
|
|
205
|
+
colorful: {
|
|
206
|
+
border: [
|
|
207
|
+
{ color: "rgb(50, 200, 80)", pos: "2% 68%", size: "9px 18px" },
|
|
208
|
+
{ color: "rgb(30, 185, 170)", pos: "2% 68%", size: "4px 8px" },
|
|
209
|
+
{ color: "rgb(255, 120, 40)", pos: "72% -3%", size: "59px 9px" },
|
|
210
|
+
{ color: "rgb(100, 70, 255)", pos: "74% 100%", size: "42px 7px" },
|
|
211
|
+
{ color: "rgb(240, 50, 180)", pos: "100% 27%", size: "10px 17px" },
|
|
212
|
+
{ color: "rgb(180, 40, 240)", pos: "100% 27%", size: "10px 18px" },
|
|
213
|
+
{ color: "rgb(40, 140, 255)", pos: "100% 27%", size: "5px 10px" },
|
|
214
|
+
{ color: "rgb(255, 50, 100)", pos: "100% 27%", size: "11px 12px" }
|
|
215
|
+
],
|
|
216
|
+
inner: [
|
|
217
|
+
{ color: "rgba(50, 200, 80, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
218
|
+
{ color: "rgba(30, 185, 170, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
219
|
+
{ color: "rgba(255, 120, 40, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
220
|
+
{ color: "rgba(100, 70, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
221
|
+
{ color: "rgba(240, 50, 180, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
222
|
+
{ color: "rgba(180, 40, 240, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
223
|
+
{ color: "rgba(40, 140, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
224
|
+
{ color: "rgba(255, 50, 100, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
mono: {
|
|
228
|
+
border: [
|
|
229
|
+
{ color: "rgb(160, 160, 160)", pos: "2% 68%", size: "9px 18px" },
|
|
230
|
+
{ color: "rgb(140, 140, 140)", pos: "2% 68%", size: "4px 8px" },
|
|
231
|
+
{ color: "rgb(180, 180, 180)", pos: "72% -3%", size: "59px 9px" },
|
|
232
|
+
{ color: "rgb(150, 150, 150)", pos: "74% 100%", size: "42px 7px" },
|
|
233
|
+
{ color: "rgb(170, 170, 170)", pos: "100% 27%", size: "10px 17px" },
|
|
234
|
+
{ color: "rgb(155, 155, 155)", pos: "100% 27%", size: "10px 18px" },
|
|
235
|
+
{ color: "rgb(145, 145, 145)", pos: "100% 27%", size: "5px 10px" },
|
|
236
|
+
{ color: "rgb(165, 165, 165)", pos: "100% 27%", size: "11px 12px" }
|
|
237
|
+
],
|
|
238
|
+
inner: [
|
|
239
|
+
{ color: "rgba(160, 160, 160, 0.25)", pos: "2% 68%", size: "9px 18px" },
|
|
240
|
+
{ color: "rgba(140, 140, 140, 0.22)", pos: "2% 68%", size: "4px 8px" },
|
|
241
|
+
{ color: "rgba(180, 180, 180, 0.17)", pos: "72% -3%", size: "59px 9px" },
|
|
242
|
+
{ color: "rgba(150, 150, 150, 0.17)", pos: "74% 100%", size: "42px 7px" },
|
|
243
|
+
{ color: "rgba(170, 170, 170, 0.15)", pos: "100% 27%", size: "10px 17px" },
|
|
244
|
+
{ color: "rgba(155, 155, 155, 0.20)", pos: "100% 27%", size: "10px 18px" },
|
|
245
|
+
{ color: "rgba(145, 145, 145, 0.15)", pos: "100% 27%", size: "5px 10px" },
|
|
246
|
+
{ color: "rgba(165, 165, 165, 0.15)", pos: "100% 27%", size: "11px 12px" }
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
ocean: {
|
|
250
|
+
border: [
|
|
251
|
+
{ color: "rgb(60, 140, 200)", pos: "2% 68%", size: "9px 18px" },
|
|
252
|
+
{ color: "rgb(50, 120, 180)", pos: "2% 68%", size: "4px 8px" },
|
|
253
|
+
{ color: "rgb(100, 80, 220)", pos: "72% -3%", size: "59px 9px" },
|
|
254
|
+
{ color: "rgb(80, 100, 255)", pos: "74% 100%", size: "42px 7px" },
|
|
255
|
+
{ color: "rgb(120, 70, 240)", pos: "100% 27%", size: "10px 17px" },
|
|
256
|
+
{ color: "rgb(90, 80, 220)", pos: "100% 27%", size: "10px 18px" },
|
|
257
|
+
{ color: "rgb(70, 110, 255)", pos: "100% 27%", size: "5px 10px" },
|
|
258
|
+
{ color: "rgb(110, 90, 230)", pos: "100% 27%", size: "11px 12px" }
|
|
259
|
+
],
|
|
260
|
+
inner: [
|
|
261
|
+
{ color: "rgba(60, 140, 200, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
262
|
+
{ color: "rgba(50, 120, 180, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
263
|
+
{ color: "rgba(100, 80, 220, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
264
|
+
{ color: "rgba(80, 100, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
265
|
+
{ color: "rgba(120, 70, 240, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
266
|
+
{ color: "rgba(90, 80, 220, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
267
|
+
{ color: "rgba(70, 110, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
268
|
+
{ color: "rgba(110, 90, 230, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
sunset: {
|
|
272
|
+
border: [
|
|
273
|
+
{ color: "rgb(255, 180, 50)", pos: "2% 68%", size: "9px 18px" },
|
|
274
|
+
{ color: "rgb(255, 150, 40)", pos: "2% 68%", size: "4px 8px" },
|
|
275
|
+
{ color: "rgb(255, 80, 60)", pos: "72% -3%", size: "59px 9px" },
|
|
276
|
+
{ color: "rgb(255, 100, 80)", pos: "74% 100%", size: "42px 7px" },
|
|
277
|
+
{ color: "rgb(255, 60, 80)", pos: "100% 27%", size: "10px 17px" },
|
|
278
|
+
{ color: "rgb(255, 120, 60)", pos: "100% 27%", size: "10px 18px" },
|
|
279
|
+
{ color: "rgb(255, 200, 50)", pos: "100% 27%", size: "5px 10px" },
|
|
280
|
+
{ color: "rgb(255, 90, 70)", pos: "100% 27%", size: "11px 12px" }
|
|
281
|
+
],
|
|
282
|
+
inner: [
|
|
283
|
+
{ color: "rgba(255, 180, 50, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
284
|
+
{ color: "rgba(255, 150, 40, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
285
|
+
{ color: "rgba(255, 80, 60, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
286
|
+
{ color: "rgba(255, 100, 80, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
287
|
+
{ color: "rgba(255, 60, 80, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
288
|
+
{ color: "rgba(255, 120, 60, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
289
|
+
{ color: "rgba(255, 200, 50, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
290
|
+
{ color: "rgba(255, 90, 70, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
brand: {
|
|
294
|
+
border: [
|
|
295
|
+
{ color: "rgb(251, 191, 36)", pos: "2% 68%", size: "9px 18px" },
|
|
296
|
+
{ color: "rgb(245, 158, 11)", pos: "2% 68%", size: "4px 8px" },
|
|
297
|
+
{ color: "rgb(217, 119, 6)", pos: "72% -3%", size: "59px 9px" },
|
|
298
|
+
{ color: "rgb(245, 158, 11)", pos: "74% 100%", size: "42px 7px" },
|
|
299
|
+
{ color: "rgb(217, 119, 6)", pos: "100% 27%", size: "10px 17px" },
|
|
300
|
+
{ color: "rgb(245, 158, 11)", pos: "100% 27%", size: "10px 18px" },
|
|
301
|
+
{ color: "rgb(252, 211, 77)", pos: "100% 27%", size: "5px 10px" },
|
|
302
|
+
{ color: "rgb(251, 191, 36)", pos: "100% 27%", size: "11px 12px" }
|
|
303
|
+
],
|
|
304
|
+
inner: [
|
|
305
|
+
{ color: "rgba(251, 191, 36, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
306
|
+
{ color: "rgba(245, 158, 11, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
307
|
+
{ color: "rgba(217, 119, 6, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
308
|
+
{ color: "rgba(245, 158, 11, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
309
|
+
{ color: "rgba(217, 119, 6, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
310
|
+
{ color: "rgba(245, 158, 11, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
311
|
+
{ color: "rgba(252, 211, 77, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
312
|
+
{ color: "rgba(251, 191, 36, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
function getSmallColorGradients(colorVariant) {
|
|
317
|
+
const palette = smallColorPalettes[colorVariant];
|
|
318
|
+
return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
319
|
+
}
|
|
320
|
+
function getSmallInnerGradients(colorVariant) {
|
|
321
|
+
const palette = smallColorPalettes[colorVariant];
|
|
322
|
+
return palette.inner.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
323
|
+
}
|
|
324
|
+
function getColorGradients(colorVariant) {
|
|
325
|
+
const palette = colorPalettes[colorVariant];
|
|
326
|
+
return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
327
|
+
}
|
|
328
|
+
function getInnerGradients(colorVariant) {
|
|
329
|
+
const palette = colorPalettes[colorVariant];
|
|
330
|
+
const baseOpacity = colorVariant === "mono" ? 0.225 : 0.45;
|
|
331
|
+
return palette.border.map((c) => {
|
|
332
|
+
const rgba = c.color.replace("rgb(", "rgba(").replace(")", `, ${baseOpacity})`);
|
|
333
|
+
const smallerSize = c.size.split(" ").map((s) => {
|
|
334
|
+
const val = parseInt(s);
|
|
335
|
+
return `${Math.round(val * 0.9)}px`;
|
|
336
|
+
}).join(" ");
|
|
337
|
+
return `radial-gradient(ellipse ${smallerSize} at ${c.pos}, ${rgba}, transparent)`;
|
|
338
|
+
}).join(",\n ");
|
|
339
|
+
}
|
|
340
|
+
function getSpikeColors(colorVariant, isDark) {
|
|
341
|
+
const palette = colorPalettes[colorVariant];
|
|
342
|
+
return isDark ? palette.spike : palette.spikeLt;
|
|
343
|
+
}
|
|
344
|
+
var lineColorPalettes = {
|
|
345
|
+
colorful: {
|
|
346
|
+
dark: [
|
|
347
|
+
{ color: "rgb(255, 50, 100)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
348
|
+
{ color: "rgb(40, 180, 220)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
349
|
+
{ color: "rgb(50, 200, 80)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
350
|
+
{ color: "rgb(180, 40, 240)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
351
|
+
{ color: "rgb(255, 160, 30)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
352
|
+
{ color: "rgb(100, 70, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
353
|
+
{ color: "rgb(40, 140, 255)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
354
|
+
{ color: "rgb(240, 50, 180)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
355
|
+
{ color: "rgb(30, 185, 170)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
356
|
+
],
|
|
357
|
+
light: [
|
|
358
|
+
{ color: "rgb(255, 50, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
359
|
+
{ color: "rgb(40, 140, 255)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
360
|
+
{ color: "rgb(50, 200, 80)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
361
|
+
{ color: "rgb(180, 40, 240)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
362
|
+
{ color: "rgb(30, 185, 170)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
363
|
+
{ color: "rgb(100, 70, 255)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
364
|
+
{ color: "rgb(40, 140, 255)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
365
|
+
{ color: "rgb(255, 120, 40)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
366
|
+
{ color: "rgb(240, 50, 180)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
mono: {
|
|
370
|
+
dark: [
|
|
371
|
+
{ color: "rgb(200, 200, 200)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
372
|
+
{ color: "rgb(170, 170, 170)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
373
|
+
{ color: "rgb(155, 155, 155)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
374
|
+
{ color: "rgb(185, 185, 185)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
375
|
+
{ color: "rgb(165, 165, 165)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
376
|
+
{ color: "rgb(180, 180, 180)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
377
|
+
{ color: "rgb(160, 160, 160)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
378
|
+
{ color: "rgb(175, 175, 175)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
379
|
+
{ color: "rgb(190, 190, 190)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
380
|
+
],
|
|
381
|
+
light: [
|
|
382
|
+
{ color: "rgb(100, 100, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
383
|
+
{ color: "rgb(80, 80, 80)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
384
|
+
{ color: "rgb(90, 90, 90)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
385
|
+
{ color: "rgb(70, 70, 70)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
386
|
+
{ color: "rgb(85, 85, 85)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
387
|
+
{ color: "rgb(95, 95, 95)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
388
|
+
{ color: "rgb(75, 75, 75)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
389
|
+
{ color: "rgb(105, 105, 105)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
390
|
+
{ color: "rgb(65, 65, 65)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
ocean: {
|
|
394
|
+
dark: [
|
|
395
|
+
{ color: "rgb(100, 80, 220)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
396
|
+
{ color: "rgb(60, 120, 255)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
397
|
+
{ color: "rgb(80, 100, 200)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
398
|
+
{ color: "rgb(130, 70, 255)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
399
|
+
{ color: "rgb(70, 130, 255)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
400
|
+
{ color: "rgb(120, 80, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
401
|
+
{ color: "rgb(90, 110, 230)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
402
|
+
{ color: "rgb(110, 90, 240)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
403
|
+
{ color: "rgb(140, 100, 255)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
404
|
+
],
|
|
405
|
+
light: [
|
|
406
|
+
{ color: "rgb(80, 60, 200)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
407
|
+
{ color: "rgb(50, 100, 220)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
408
|
+
{ color: "rgb(70, 90, 190)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
409
|
+
{ color: "rgb(110, 60, 220)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
410
|
+
{ color: "rgb(60, 110, 230)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
411
|
+
{ color: "rgb(100, 70, 240)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
412
|
+
{ color: "rgb(80, 100, 210)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
413
|
+
{ color: "rgb(90, 80, 225)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
414
|
+
{ color: "rgb(120, 90, 245)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
sunset: {
|
|
418
|
+
dark: [
|
|
419
|
+
{ color: "rgb(255, 100, 60)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
420
|
+
{ color: "rgb(255, 180, 50)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
421
|
+
{ color: "rgb(255, 140, 70)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
422
|
+
{ color: "rgb(255, 80, 80)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
423
|
+
{ color: "rgb(255, 200, 60)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
424
|
+
{ color: "rgb(255, 120, 50)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
425
|
+
{ color: "rgb(255, 160, 80)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
426
|
+
{ color: "rgb(255, 90, 60)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
427
|
+
{ color: "rgb(255, 70, 70)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
428
|
+
],
|
|
429
|
+
light: [
|
|
430
|
+
{ color: "rgb(220, 80, 40)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
431
|
+
{ color: "rgb(230, 150, 30)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
432
|
+
{ color: "rgb(210, 110, 50)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
433
|
+
{ color: "rgb(200, 60, 60)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
434
|
+
{ color: "rgb(220, 170, 40)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
435
|
+
{ color: "rgb(210, 100, 30)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
436
|
+
{ color: "rgb(230, 130, 60)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
437
|
+
{ color: "rgb(190, 70, 50)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
438
|
+
{ color: "rgb(180, 50, 50)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
brand: {
|
|
442
|
+
dark: [
|
|
443
|
+
{ color: "rgb(245, 158, 11)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
444
|
+
{ color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
445
|
+
{ color: "rgb(245, 158, 11)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
446
|
+
{ color: "rgb(217, 119, 6)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
447
|
+
{ color: "rgb(252, 211, 77)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
448
|
+
{ color: "rgb(234, 138, 9)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
449
|
+
{ color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
450
|
+
{ color: "rgb(217, 119, 6)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
451
|
+
{ color: "rgb(245, 158, 11)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
452
|
+
],
|
|
453
|
+
light: [
|
|
454
|
+
{ color: "rgb(180, 83, 9)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
455
|
+
{ color: "rgb(202, 138, 4)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
456
|
+
{ color: "rgb(180, 83, 9)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
457
|
+
{ color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
458
|
+
{ color: "rgb(202, 138, 4)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
459
|
+
{ color: "rgb(161, 98, 7)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
460
|
+
{ color: "rgb(202, 138, 4)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
461
|
+
{ color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
462
|
+
{ color: "rgb(180, 83, 9)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
function getLineColorGradients(colorVariant, isDark, id) {
|
|
467
|
+
const palette = lineColorPalettes[colorVariant][isDark ? "dark" : "light"];
|
|
468
|
+
return palette.map((c) => {
|
|
469
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
470
|
+
const offsetYStr = c.offsetY === 0 ? "" : c.offsetY > 0 ? ` + ${c.offsetY}px` : ` - ${Math.abs(c.offsetY)}px`;
|
|
471
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
472
|
+
}).join(",\n ");
|
|
473
|
+
}
|
|
474
|
+
var lineInnerGradientData = {
|
|
475
|
+
colorful: [
|
|
476
|
+
{ color: "rgba(255, 50, 100, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
477
|
+
{ color: "rgba(40, 180, 220, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
478
|
+
{ color: "rgba(50, 200, 80, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
479
|
+
{ color: "rgba(180, 40, 240, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
480
|
+
{ color: "rgba(255, 160, 30, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
481
|
+
{ color: "rgba(100, 70, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
482
|
+
{ color: "rgba(40, 140, 255, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
483
|
+
{ color: "rgba(240, 50, 180, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
484
|
+
{ color: "rgba(30, 185, 170, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
485
|
+
],
|
|
486
|
+
mono: [
|
|
487
|
+
{ color: "rgba(200, 200, 200, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
488
|
+
{ color: "rgba(170, 170, 170, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
489
|
+
{ color: "rgba(155, 155, 155, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
490
|
+
{ color: "rgba(185, 185, 185, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
491
|
+
{ color: "rgba(165, 165, 165, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
492
|
+
{ color: "rgba(180, 180, 180, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
493
|
+
{ color: "rgba(160, 160, 160, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
494
|
+
{ color: "rgba(175, 175, 175, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
495
|
+
{ color: "rgba(190, 190, 190, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
496
|
+
],
|
|
497
|
+
ocean: [
|
|
498
|
+
{ color: "rgba(100, 80, 220, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
499
|
+
{ color: "rgba(60, 120, 255, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
500
|
+
{ color: "rgba(80, 100, 200, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
501
|
+
{ color: "rgba(130, 70, 255, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
502
|
+
{ color: "rgba(70, 130, 255, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
503
|
+
{ color: "rgba(120, 80, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
504
|
+
{ color: "rgba(90, 110, 230, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
505
|
+
{ color: "rgba(110, 90, 240, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
506
|
+
{ color: "rgba(140, 100, 255, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
507
|
+
],
|
|
508
|
+
sunset: [
|
|
509
|
+
{ color: "rgba(255, 100, 60, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
510
|
+
{ color: "rgba(255, 180, 50, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
511
|
+
{ color: "rgba(255, 140, 70, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
512
|
+
{ color: "rgba(255, 80, 80, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
513
|
+
{ color: "rgba(255, 200, 60, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
514
|
+
{ color: "rgba(255, 120, 50, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
515
|
+
{ color: "rgba(255, 160, 80, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
516
|
+
{ color: "rgba(255, 90, 60, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
517
|
+
{ color: "rgba(255, 70, 70, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
518
|
+
],
|
|
519
|
+
brand: [
|
|
520
|
+
{ color: "rgba(245, 158, 11, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
521
|
+
{ color: "rgba(251, 191, 36, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
522
|
+
{ color: "rgba(245, 158, 11, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
523
|
+
{ color: "rgba(217, 119, 6, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
524
|
+
{ color: "rgba(252, 211, 77, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
525
|
+
{ color: "rgba(234, 138, 9, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
526
|
+
{ color: "rgba(251, 191, 36, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
527
|
+
{ color: "rgba(217, 119, 6, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
528
|
+
{ color: "rgba(245, 158, 11, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
529
|
+
]
|
|
530
|
+
};
|
|
531
|
+
function getLineInnerGradients(colorVariant, id) {
|
|
532
|
+
const data = lineInnerGradientData[colorVariant];
|
|
533
|
+
return data.map((c) => {
|
|
534
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
535
|
+
const offsetYStr = c.offsetY === 0 ? "" : ` - ${Math.abs(c.offsetY)}px`;
|
|
536
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
537
|
+
}).join(",\n ");
|
|
538
|
+
}
|
|
539
|
+
var lineBloomColors = {
|
|
540
|
+
colorful: {
|
|
541
|
+
dark: {
|
|
542
|
+
spikes: [
|
|
543
|
+
{ color1: "rgb(100, 70, 255)", color2: "rgba(100, 70, 255, 1)" },
|
|
544
|
+
// 36%
|
|
545
|
+
{ color1: "rgba(255, 170, 40, 0.59)", color2: "rgba(255, 170, 40, 0.29)" },
|
|
546
|
+
// 50%
|
|
547
|
+
{ color1: "rgb(50, 200, 100)", color2: "rgba(50, 200, 100, 1)" },
|
|
548
|
+
// 64%
|
|
549
|
+
{ color1: "rgba(200, 50, 240, 0.91)", color2: "rgba(200, 50, 240, 0.45)" },
|
|
550
|
+
// 78%
|
|
551
|
+
{ color1: "rgb(40, 140, 255)", color2: "rgba(40, 140, 255, 1)" }
|
|
552
|
+
// 92%
|
|
553
|
+
]
|
|
554
|
+
},
|
|
555
|
+
light: {
|
|
556
|
+
spikes: [
|
|
557
|
+
{ color1: "rgb(80, 50, 200)", color2: "rgba(80, 50, 200, 0.8)" },
|
|
558
|
+
// 36%
|
|
559
|
+
{ color1: "rgba(210, 130, 0, 0.7)", color2: "rgba(210, 130, 0, 0.46)" },
|
|
560
|
+
// 50%
|
|
561
|
+
{ color1: "rgb(30, 160, 70)", color2: "rgba(30, 160, 70, 0.82)" },
|
|
562
|
+
// 64%
|
|
563
|
+
{ color1: "rgb(160, 30, 190)", color2: "rgba(160, 30, 190, 0.7)" },
|
|
564
|
+
// 78%
|
|
565
|
+
{ color1: "rgb(30, 100, 200)", color2: "rgba(30, 100, 200, 0.78)" }
|
|
566
|
+
// 92%
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
mono: {
|
|
571
|
+
dark: {
|
|
572
|
+
spikes: [
|
|
573
|
+
{ color1: "rgb(200, 200, 200)", color2: "rgba(200, 200, 200, 1)" },
|
|
574
|
+
{ color1: "rgba(180, 180, 180, 0.59)", color2: "rgba(180, 180, 180, 0.29)" },
|
|
575
|
+
{ color1: "rgb(190, 190, 190)", color2: "rgba(190, 190, 190, 1)" },
|
|
576
|
+
{ color1: "rgba(170, 170, 170, 0.91)", color2: "rgba(170, 170, 170, 0.45)" },
|
|
577
|
+
{ color1: "rgb(185, 185, 185)", color2: "rgba(185, 185, 185, 1)" }
|
|
578
|
+
]
|
|
579
|
+
},
|
|
580
|
+
light: {
|
|
581
|
+
spikes: [
|
|
582
|
+
{ color1: "rgb(80, 80, 80)", color2: "rgba(80, 80, 80, 0.8)" },
|
|
583
|
+
{ color1: "rgba(100, 100, 100, 0.7)", color2: "rgba(100, 100, 100, 0.46)" },
|
|
584
|
+
{ color1: "rgb(70, 70, 70)", color2: "rgba(70, 70, 70, 0.82)" },
|
|
585
|
+
{ color1: "rgb(90, 90, 90)", color2: "rgba(90, 90, 90, 0.7)" },
|
|
586
|
+
{ color1: "rgb(85, 85, 85)", color2: "rgba(85, 85, 85, 0.78)" }
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
ocean: {
|
|
591
|
+
dark: {
|
|
592
|
+
spikes: [
|
|
593
|
+
{ color1: "rgb(100, 80, 255)", color2: "rgb(100, 80, 255)" },
|
|
594
|
+
{ color1: "rgba(80, 130, 220, 0.59)", color2: "rgba(80, 130, 220, 0.29)" },
|
|
595
|
+
{ color1: "rgb(60, 100, 255)", color2: "rgb(60, 100, 255)" },
|
|
596
|
+
{ color1: "rgba(90, 120, 200, 0.91)", color2: "rgba(90, 120, 200, 0.45)" },
|
|
597
|
+
{ color1: "rgb(120, 90, 255)", color2: "rgb(120, 90, 255)" }
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
light: {
|
|
601
|
+
spikes: [
|
|
602
|
+
{ color1: "rgb(50, 40, 180)", color2: "rgba(50, 40, 180, 0.8)" },
|
|
603
|
+
{ color1: "rgba(40, 80, 200, 0.7)", color2: "rgba(40, 80, 200, 0.46)" },
|
|
604
|
+
{ color1: "rgb(30, 50, 190)", color2: "rgba(30, 50, 190, 0.82)" },
|
|
605
|
+
{ color1: "rgb(60, 90, 180)", color2: "rgba(60, 90, 180, 0.7)" },
|
|
606
|
+
{ color1: "rgb(70, 60, 200)", color2: "rgba(70, 60, 200, 0.78)" }
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
sunset: {
|
|
611
|
+
dark: {
|
|
612
|
+
spikes: [
|
|
613
|
+
{ color1: "rgb(255, 100, 80)", color2: "rgb(255, 100, 80)" },
|
|
614
|
+
{ color1: "rgba(255, 150, 80, 0.59)", color2: "rgba(255, 150, 80, 0.29)" },
|
|
615
|
+
{ color1: "rgb(255, 80, 60)", color2: "rgb(255, 80, 60)" },
|
|
616
|
+
{ color1: "rgba(255, 120, 50, 0.91)", color2: "rgba(255, 120, 50, 0.45)" },
|
|
617
|
+
{ color1: "rgb(255, 140, 70)", color2: "rgb(255, 140, 70)" }
|
|
618
|
+
]
|
|
619
|
+
},
|
|
620
|
+
light: {
|
|
621
|
+
spikes: [
|
|
622
|
+
{ color1: "rgb(200, 60, 30)", color2: "rgba(200, 60, 30, 0.8)" },
|
|
623
|
+
{ color1: "rgba(220, 100, 20, 0.7)", color2: "rgba(220, 100, 20, 0.46)" },
|
|
624
|
+
{ color1: "rgb(180, 40, 20)", color2: "rgba(180, 40, 20, 0.82)" },
|
|
625
|
+
{ color1: "rgb(210, 80, 10)", color2: "rgba(210, 80, 10, 0.7)" },
|
|
626
|
+
{ color1: "rgb(190, 70, 30)", color2: "rgba(190, 70, 30, 0.78)" }
|
|
627
|
+
]
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
brand: {
|
|
631
|
+
dark: {
|
|
632
|
+
spikes: [
|
|
633
|
+
{ color1: "rgb(251, 191, 36)", color2: "rgb(251, 191, 36)" },
|
|
634
|
+
{ color1: "rgba(245, 158, 11, 0.59)", color2: "rgba(245, 158, 11, 0.29)" },
|
|
635
|
+
{ color1: "rgb(217, 119, 6)", color2: "rgb(217, 119, 6)" },
|
|
636
|
+
{ color1: "rgba(252, 211, 77, 0.91)", color2: "rgba(252, 211, 77, 0.45)" },
|
|
637
|
+
{ color1: "rgb(245, 158, 11)", color2: "rgb(245, 158, 11)" }
|
|
638
|
+
]
|
|
639
|
+
},
|
|
640
|
+
light: {
|
|
641
|
+
spikes: [
|
|
642
|
+
{ color1: "rgb(180, 83, 9)", color2: "rgba(180, 83, 9, 0.8)" },
|
|
643
|
+
{ color1: "rgba(202, 138, 4, 0.7)", color2: "rgba(202, 138, 4, 0.46)" },
|
|
644
|
+
{ color1: "rgb(146, 64, 14)", color2: "rgba(146, 64, 14, 0.82)" },
|
|
645
|
+
{ color1: "rgb(202, 138, 4)", color2: "rgba(202, 138, 4, 0.7)" },
|
|
646
|
+
{ color1: "rgb(161, 98, 7)", color2: "rgba(161, 98, 7, 0.78)" }
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
function withAlpha(color, alpha) {
|
|
652
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*[\d.]+\s*\)$/);
|
|
653
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${alpha})`;
|
|
654
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
655
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${alpha})`;
|
|
656
|
+
return color;
|
|
657
|
+
}
|
|
658
|
+
function attenuateSpike(color, factor) {
|
|
659
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
660
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${(parseFloat(rgbaMatch[4]) * factor).toFixed(2)})`;
|
|
661
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
662
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${factor.toFixed(2)})`;
|
|
663
|
+
return color;
|
|
664
|
+
}
|
|
665
|
+
function getLineBloomGradients(colorVariant, isDark, id) {
|
|
666
|
+
const spikeColors = getSpikeColors(colorVariant, isDark);
|
|
667
|
+
const bloomData = lineBloomColors[colorVariant][isDark ? "dark" : "light"];
|
|
668
|
+
const isMono = colorVariant === "mono";
|
|
669
|
+
const att = isMono ? 0.14 : 1;
|
|
670
|
+
const sc1 = isMono ? attenuateSpike(spikeColors.primary, 0.14) : spikeColors.primary;
|
|
671
|
+
const sc1_mid = isMono ? attenuateSpike(spikeColors.primary, 0.09) : spikeColors.primary;
|
|
672
|
+
const sc2 = isMono ? attenuateSpike(spikeColors.secondary, 0.12) : spikeColors.secondary;
|
|
673
|
+
const sc2_mid = isMono ? withAlpha(spikeColors.secondary, 0.06) : withAlpha(spikeColors.secondary, 0.49);
|
|
674
|
+
const spikes = bloomData.spikes.map(
|
|
675
|
+
(s) => isMono ? { color1: attenuateSpike(s.color1, att), color2: attenuateSpike(s.color2, att * 0.7) } : s
|
|
676
|
+
);
|
|
677
|
+
const thinW1 = isMono ? "12px" : "0.8px";
|
|
678
|
+
const thinW2 = isMono ? "14px" : "2px";
|
|
679
|
+
const thinW3 = isMono ? "12px" : "1.2px";
|
|
680
|
+
const thinW4 = isMono ? "10px" : "0.6px";
|
|
681
|
+
const thinH1 = isMono ? "42px" : "92px";
|
|
682
|
+
const thinH2 = isMono ? "38px" : "72px";
|
|
683
|
+
const thinH3 = isMono ? "40px" : "85px";
|
|
684
|
+
const thinH4 = isMono ? "32px" : "60px";
|
|
685
|
+
const thinLW = isMono ? "12px" : "1px";
|
|
686
|
+
const glowDotC = isMono ? "rgba(255, 255, 255, 0.5)" : "rgba(255, 255, 255, 1)";
|
|
687
|
+
const glowDot20 = isMono ? "rgba(255, 255, 255, 0.45)" : "rgba(255, 255, 255, 0.9)";
|
|
688
|
+
const glowDot50 = isMono ? "rgba(255, 255, 255, 0.25)" : "rgba(255, 255, 255, 0.5)";
|
|
689
|
+
const glowAmbC = isMono ? "rgba(255, 255, 255, 0.15)" : "rgba(255, 255, 255, 0.3)";
|
|
690
|
+
const glowAmb25 = isMono ? "rgba(255, 255, 255, 0.06)" : "rgba(255, 255, 255, 0.12)";
|
|
691
|
+
const glowAmb55 = isMono ? "rgba(255, 255, 255, 0.015)" : "rgba(255, 255, 255, 0.03)";
|
|
692
|
+
if (isDark) {
|
|
693
|
+
return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_mid} 30%, transparent 88%),
|
|
694
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_mid} 50%, transparent 95%),
|
|
695
|
+
radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
696
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
697
|
+
radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
698
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
699
|
+
radial-gradient(ellipse calc(${thinW4} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
700
|
+
radial-gradient(ellipse calc(21px * var(--beam-spike-${id})) calc(15px * var(--beam-spike2-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 1px), ${glowDotC} 0%, ${glowDot20} 20%, ${glowDot50} 50%, transparent 100%),
|
|
701
|
+
radial-gradient(ellipse calc(42px * var(--beam-w-${id})) calc(40px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%, ${glowAmbC} 0%, ${glowAmb25} 25%, ${glowAmb55} 55%, transparent 80%)`;
|
|
702
|
+
} else {
|
|
703
|
+
const sc1_lt = isMono ? attenuateSpike(spikeColors.primary, 0.11) : withAlpha(spikeColors.primary, 0.85);
|
|
704
|
+
const sc2_lt = isMono ? attenuateSpike(spikeColors.secondary, 0.09) : withAlpha(spikeColors.secondary, 0.7);
|
|
705
|
+
return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_lt} 30%, transparent 88%),
|
|
706
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_lt} 50%, transparent 95%),
|
|
707
|
+
radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
708
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
709
|
+
radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
710
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
711
|
+
radial-gradient(ellipse calc(${thinLW} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
712
|
+
radial-gradient(ellipse calc(50px * var(--beam-w-${id})) calc(32px * 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%)`;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
var PULSE_RING_MAP = [
|
|
716
|
+
{ region: 1, quad: "tl" },
|
|
717
|
+
{ region: 2, quad: "tl" },
|
|
718
|
+
{ region: 3, quad: "bl" },
|
|
719
|
+
{ region: 1, quad: "bl" },
|
|
720
|
+
{ region: 2, quad: "br" },
|
|
721
|
+
{ region: 3, quad: "br" },
|
|
722
|
+
{ region: 1, quad: "tr" },
|
|
723
|
+
{ region: 2, quad: "tr" },
|
|
724
|
+
{ region: 3, quad: "tr" }
|
|
725
|
+
];
|
|
726
|
+
var PULSE_INNER_SIZES = [
|
|
727
|
+
[65, 35],
|
|
728
|
+
[55, 30],
|
|
729
|
+
[35, 65],
|
|
730
|
+
[15, 30],
|
|
731
|
+
[173, 28],
|
|
732
|
+
[80, 22],
|
|
733
|
+
[69, 28],
|
|
734
|
+
[22, 38],
|
|
735
|
+
[47, 44]
|
|
736
|
+
];
|
|
737
|
+
var PULSE_INNER_BLOOM = [
|
|
738
|
+
{ ci: 0, region: 1, quad: "tl", w: 84, h: 48 },
|
|
739
|
+
{ ci: 1, region: 2, quad: "tl", w: 72, h: 42 },
|
|
740
|
+
{ ci: 2, region: 3, quad: "bl", w: 48, h: 84 },
|
|
741
|
+
{ ci: 4, region: 2, quad: "br", w: 216, h: 38 },
|
|
742
|
+
{ ci: 5, region: 3, quad: "br", w: 102, h: 31 },
|
|
743
|
+
{ ci: 6, region: 1, quad: "tr", w: 89, h: 38 },
|
|
744
|
+
{ ci: 8, region: 3, quad: "tr", w: 62, h: 58 }
|
|
745
|
+
];
|
|
746
|
+
var PULSE_OUTER_CORE = [
|
|
747
|
+
{ ci: 0, region: 1, quad: "tl", w: 80, h: 19, x: "27%", y: "0%" },
|
|
748
|
+
{ ci: 6, region: 2, quad: "tr", w: 74, h: 11, x: "73%", y: "-1%" },
|
|
749
|
+
{ ci: 7, region: 3, quad: "tr", w: 15, h: 44, x: "100%", y: "33%" },
|
|
750
|
+
{ ci: 8, region: 1, quad: "br", w: 19, h: 38, x: "101%", y: "72%" },
|
|
751
|
+
{ ci: 4, region: 2, quad: "br", w: 84, h: 13, x: "67%", y: "100%" },
|
|
752
|
+
{ ci: 1, region: 3, quad: "bl", w: 60, h: 21, x: "24%", y: "101%" },
|
|
753
|
+
{ ci: 2, region: 1, quad: "bl", w: 17, h: 40, x: "0%", y: "60%" },
|
|
754
|
+
{ ci: 3, region: 2, quad: "tl", w: 13, h: 32, x: "-1%", y: "28%" }
|
|
755
|
+
];
|
|
756
|
+
var PULSE_OUTER_BLOOM = [
|
|
757
|
+
{ ci: 0, region: 1, quad: "tl", w: 110, h: 30, x: "27%", y: "3%" },
|
|
758
|
+
{ ci: 6, region: 2, quad: "tr", w: 100, h: 20, x: "73%", y: "1%" },
|
|
759
|
+
{ ci: 7, region: 3, quad: "tr", w: 26, h: 62, x: "100%", y: "33%" },
|
|
760
|
+
{ ci: 8, region: 1, quad: "br", w: 30, h: 56, x: "101%", y: "72%" },
|
|
761
|
+
{ ci: 4, region: 2, quad: "br", w: 120, h: 22, x: "67%", y: "99%" },
|
|
762
|
+
{ ci: 1, region: 3, quad: "bl", w: 88, h: 32, x: "24%", y: "99%" },
|
|
763
|
+
{ ci: 2, region: 1, quad: "bl", w: 28, h: 58, x: "0%", y: "60%" }
|
|
764
|
+
];
|
|
765
|
+
function withAlphaVar(color, quad, id) {
|
|
766
|
+
const m = color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
767
|
+
const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
|
|
768
|
+
return `rgba(${rgb}, var(--bop-${quad}-${id}))`;
|
|
769
|
+
}
|
|
770
|
+
function pulseGrad(color, w, h, region, quad, x, y, id) {
|
|
771
|
+
return `radial-gradient(ellipse calc(${w}px * var(--bw${region}-${id}) * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${h}px * var(--bh${region}-${id}) * var(--bgh-${id}) * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at calc(${x} + var(--bx${region}-${id})) calc(${y} + var(--by${region}-${id})), ${withAlphaVar(color, quad, id)}, transparent)`;
|
|
772
|
+
}
|
|
773
|
+
function pulseRingGradients(variant, id) {
|
|
774
|
+
return colorPalettes[variant].border.map((c, i) => {
|
|
775
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
776
|
+
const [x, y] = c.pos.split(" ");
|
|
777
|
+
const [w, h] = c.size.split(" ").map(parseFloat);
|
|
778
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
779
|
+
}).join(",\n ");
|
|
780
|
+
}
|
|
781
|
+
function pulseInnerGradients(variant, id, isDark) {
|
|
782
|
+
const palette = colorPalettes[variant].border;
|
|
783
|
+
const grads = palette.map((c, i) => {
|
|
784
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
785
|
+
const [x, y] = c.pos.split(" ");
|
|
786
|
+
const [w, h] = PULSE_INNER_SIZES[i];
|
|
787
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
788
|
+
});
|
|
789
|
+
const cornerRGB = isDark ? "255, 255, 255" : "0, 0, 0";
|
|
790
|
+
const cornerAlpha = isDark ? 0.18 : 0.08;
|
|
791
|
+
const corners = [
|
|
792
|
+
["0%", "0%", "tl"],
|
|
793
|
+
["100%", "0%", "tr"],
|
|
794
|
+
["0%", "100%", "bl"],
|
|
795
|
+
["100%", "100%", "br"]
|
|
796
|
+
];
|
|
797
|
+
const cornerGrads = corners.map(
|
|
798
|
+
([x, y, q]) => `radial-gradient(ellipse 60px 60px at ${x} ${y}, rgba(${cornerRGB}, calc(${cornerAlpha} * var(--bop-${q}-${id}))), transparent 70%)`
|
|
799
|
+
);
|
|
800
|
+
return [...grads, ...cornerGrads].join(",\n ");
|
|
801
|
+
}
|
|
802
|
+
function pulseTableGradients(table, variant, id) {
|
|
803
|
+
const palette = colorPalettes[variant].border;
|
|
804
|
+
return table.map((e) => {
|
|
805
|
+
const c = palette[e.ci];
|
|
806
|
+
const [px, py] = c.pos.split(" ");
|
|
807
|
+
return pulseGrad(c.color, e.w, e.h, e.region, e.quad, e.x ?? px, e.y ?? py, id);
|
|
808
|
+
}).join(",\n ");
|
|
809
|
+
}
|
|
810
|
+
function pulseTableGradientsStatic(table, variant, frozenAlpha) {
|
|
811
|
+
const palette = colorPalettes[variant].border;
|
|
812
|
+
const a = +frozenAlpha.toFixed(3);
|
|
813
|
+
return table.map((e) => {
|
|
814
|
+
const c = palette[e.ci];
|
|
815
|
+
const [px, py] = c.pos.split(" ");
|
|
816
|
+
const x = e.x ?? px;
|
|
817
|
+
const y = e.y ?? py;
|
|
818
|
+
const m = c.color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
819
|
+
const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
|
|
820
|
+
return `radial-gradient(ellipse calc(${e.w}px * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${e.h}px * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at ${x} ${y}, rgba(${rgb}, ${a}), transparent)`;
|
|
821
|
+
}).join(",\n ");
|
|
822
|
+
}
|
|
823
|
+
function pausedAnimationsRule(id) {
|
|
824
|
+
return `
|
|
825
|
+
[data-beam="${id}"][data-paused],
|
|
826
|
+
[data-beam="${id}"][data-paused]::after,
|
|
827
|
+
[data-beam="${id}"][data-paused]::before,
|
|
828
|
+
[data-beam="${id}"][data-paused] [data-beam-bloom] {
|
|
829
|
+
animation-play-state: paused !important;
|
|
830
|
+
}`;
|
|
831
|
+
}
|
|
832
|
+
function pulsePropertyRegs(id) {
|
|
833
|
+
const numbers = ["bw1", "bh1", "bw2", "bh2", "bw3", "bh3", "bgh", "bop-tl", "bop-tr", "bop-bl", "bop-br"];
|
|
834
|
+
const lengths = ["bx1", "by1", "bx2", "by2", "bx3", "by3"];
|
|
835
|
+
const numReg = numbers.map(
|
|
836
|
+
(n) => `@property --${n}-${id} {
|
|
837
|
+
syntax: "<number>";
|
|
838
|
+
initial-value: 1;
|
|
839
|
+
inherits: true;
|
|
840
|
+
}`
|
|
841
|
+
).join("\n\n");
|
|
842
|
+
const lenReg = lengths.map(
|
|
843
|
+
(n) => `@property --${n}-${id} {
|
|
844
|
+
syntax: "<length>";
|
|
845
|
+
initial-value: 0px;
|
|
846
|
+
inherits: true;
|
|
847
|
+
}`
|
|
848
|
+
).join("\n\n");
|
|
849
|
+
return `${numReg}
|
|
850
|
+
|
|
851
|
+
${lenReg}
|
|
852
|
+
|
|
853
|
+
@property --beam-opacity-${id} {
|
|
854
|
+
syntax: "<number>";
|
|
855
|
+
initial-value: 0;
|
|
856
|
+
inherits: true;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
@property --beam-hue-${id} {
|
|
860
|
+
syntax: "<angle>";
|
|
861
|
+
initial-value: 0deg;
|
|
862
|
+
inherits: true;
|
|
863
|
+
}`;
|
|
864
|
+
}
|
|
865
|
+
function pulseParams(size, theme, duration) {
|
|
866
|
+
const isDark = theme === "dark";
|
|
867
|
+
const durScale = duration / 2.3;
|
|
868
|
+
if (size === "pulse-inner") {
|
|
869
|
+
return {
|
|
870
|
+
sp: 0.28,
|
|
871
|
+
dr: isDark ? 33 : 40,
|
|
872
|
+
op: isDark ? 0.48 : 0.45,
|
|
873
|
+
gh: isDark ? 0.34 : 0.22,
|
|
874
|
+
bs: (isDark ? 1.9 : 2.6) * durScale,
|
|
875
|
+
ss: (isDark ? 2.6 : 4.6) * durScale,
|
|
876
|
+
ghs: (isDark ? 2.4 : 5.5) * durScale,
|
|
877
|
+
// Full hue revolution period (seconds) — colors continuously cycle.
|
|
878
|
+
huePeriod: 16
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
return {
|
|
882
|
+
sp: isDark ? 0.28 : 0.36,
|
|
883
|
+
dr: isDark ? 14 : 19,
|
|
884
|
+
op: isDark ? 0.46 : 0,
|
|
885
|
+
gh: isDark ? 0.16 : 0.58,
|
|
886
|
+
bs: (isDark ? 2.3 : 3.7) * durScale,
|
|
887
|
+
ss: (isDark ? 6.4 : 4.6) * durScale,
|
|
888
|
+
ghs: (isDark ? 2.4 : 3.8) * durScale,
|
|
889
|
+
// Full hue revolution period (seconds) — colors continuously cycle.
|
|
890
|
+
huePeriod: 14
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
function pulseOscillatorDefs(id, p) {
|
|
894
|
+
const { sp, dr, op, gh, bs, ss, ghs } = p;
|
|
895
|
+
return [
|
|
896
|
+
{ prop: `--bw1-${id}`, a: 1 - sp, b: 1 + sp * 1.1, period: ss * 0.9, delay: 0, unit: "" },
|
|
897
|
+
{ prop: `--bh1-${id}`, a: 1 + sp * 0.9, b: 1 - sp * 0.85, period: ss * 1.26, delay: 0, unit: "" },
|
|
898
|
+
{ prop: `--bx1-${id}`, a: -dr, b: dr * 0.9, period: bs * 1.6, delay: 0, unit: "px" },
|
|
899
|
+
{ prop: `--by1-${id}`, a: dr * 0.55, b: -dr * 0.7, period: bs * 1.6, delay: 0, unit: "px" },
|
|
900
|
+
{ prop: `--bw2-${id}`, a: 1 + sp, b: 1 - sp * 0.85, period: ss * 1.1, delay: 0, unit: "" },
|
|
901
|
+
{ prop: `--bh2-${id}`, a: 1 - sp * 0.8, b: 1 + sp * 1.05, period: ss * 0.81, delay: 0, unit: "" },
|
|
902
|
+
{ prop: `--bx2-${id}`, a: dr * 0.8, b: -dr * 0.9, period: bs * 1.88, delay: 0, unit: "px" },
|
|
903
|
+
{ prop: `--by2-${id}`, a: -dr, b: dr * 0.65, period: bs * 1.88, delay: 0, unit: "px" },
|
|
904
|
+
{ prop: `--bw3-${id}`, a: 1 - sp * 0.6, b: 1 + sp * 1.15, period: ss * 0.98, delay: 0, unit: "" },
|
|
905
|
+
{ prop: `--bh3-${id}`, a: 1 + sp * 0.75, b: 1 - sp, period: ss * 1.4, delay: 0, unit: "" },
|
|
906
|
+
{ prop: `--bx3-${id}`, a: -dr * 0.6, b: dr, period: bs * 1.45, delay: 0, unit: "px" },
|
|
907
|
+
{ prop: `--by3-${id}`, a: -dr * 0.85, b: dr * 0.45, period: bs * 1.45, delay: 0, unit: "px" },
|
|
908
|
+
{ prop: `--bgh-${id}`, a: 1 - gh, b: 1 + gh, period: ghs, delay: 0, unit: "" },
|
|
909
|
+
{ prop: `--bop-tl-${id}`, a: 1 - op, b: 1, period: bs, delay: 0, unit: "" },
|
|
910
|
+
{ prop: `--bop-tr-${id}`, a: 1 - op, b: 1, period: bs * 1.32, delay: bs * 0.28, unit: "" },
|
|
911
|
+
{ prop: `--bop-bl-${id}`, a: 1 - op, b: 1, period: bs * 0.84, delay: bs * 0.55, unit: "" },
|
|
912
|
+
{ prop: `--bop-br-${id}`, a: 1 - op, b: 1, period: bs * 1.58, delay: bs * 0.83, unit: "" }
|
|
913
|
+
];
|
|
914
|
+
}
|
|
915
|
+
function getPulseDriverConfig(size, theme, duration, _hueRange, staticColors, id) {
|
|
916
|
+
if (size !== "pulse-inner" && size !== "pulse-outside") return null;
|
|
917
|
+
const p = pulseParams(size, theme, duration);
|
|
918
|
+
return {
|
|
919
|
+
oscillators: pulseOscillatorDefs(id, p),
|
|
920
|
+
// Pulse colors continuously rotate a full hue circle so the palette is never
|
|
921
|
+
// pinned to fixed edges (no more "always red top-right / green left").
|
|
922
|
+
hue: staticColors ? null : { prop: `--beam-hue-${id}`, range: 360, period: p.huePeriod, continuous: true }
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function pulseWrapperAnimation(id, fadeName, fadeDur) {
|
|
926
|
+
return ` animation: ${fadeName}-${id} ${fadeDur}s ease forwards;`;
|
|
927
|
+
}
|
|
928
|
+
function generateBeamCSS(options) {
|
|
929
|
+
const { size } = options;
|
|
930
|
+
if (size === "line") {
|
|
931
|
+
return generateLineVariantCSS(options);
|
|
932
|
+
}
|
|
933
|
+
if (size === "sm") {
|
|
934
|
+
return generateSmallVariantCSS(options);
|
|
935
|
+
}
|
|
936
|
+
if (size === "pulse-inner") {
|
|
937
|
+
return generatePulseInnerVariantCSS(options);
|
|
938
|
+
}
|
|
939
|
+
if (size === "pulse-outside") {
|
|
940
|
+
return generatePulseOuterVariantCSS(options);
|
|
941
|
+
}
|
|
942
|
+
return generateBorderVariantCSS(options);
|
|
943
|
+
}
|
|
944
|
+
function generateSmallVariantCSS(options) {
|
|
945
|
+
const {
|
|
946
|
+
id,
|
|
947
|
+
borderRadius,
|
|
948
|
+
borderWidth,
|
|
949
|
+
duration,
|
|
950
|
+
strokeOpacity,
|
|
951
|
+
innerOpacity,
|
|
952
|
+
bloomOpacity,
|
|
953
|
+
innerShadow,
|
|
954
|
+
colorVariant,
|
|
955
|
+
staticColors,
|
|
956
|
+
brightness,
|
|
957
|
+
saturation,
|
|
958
|
+
hueRange,
|
|
959
|
+
theme
|
|
960
|
+
} = options;
|
|
961
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
962
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
|
|
963
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
964
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
965
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
966
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
967
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
968
|
+
@keyframes beam-hue-shift-${id} {
|
|
969
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
970
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
971
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
972
|
+
}`;
|
|
973
|
+
const isDark = theme === "dark";
|
|
974
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
975
|
+
from var(--beam-angle-${id}),
|
|
976
|
+
transparent 0%, transparent 54%,
|
|
977
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
978
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
979
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
980
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
981
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
982
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
983
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
984
|
+
transparent 78%, transparent 100%
|
|
985
|
+
)` : `conic-gradient(
|
|
986
|
+
from var(--beam-angle-${id}),
|
|
987
|
+
transparent 0%, transparent 54%,
|
|
988
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
989
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
990
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
991
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
992
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
993
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
994
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
995
|
+
transparent 78%, transparent 100%
|
|
996
|
+
)`;
|
|
997
|
+
const colorGradients = getSmallColorGradients(colorVariant);
|
|
998
|
+
const innerGradients = getSmallInnerGradients(colorVariant);
|
|
999
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
1000
|
+
from var(--beam-angle-${id}),
|
|
1001
|
+
transparent 0%, transparent 58%,
|
|
1002
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
1003
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
1004
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
1005
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
1006
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
1007
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
1008
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
1009
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
1010
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
1011
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
1012
|
+
transparent 82%
|
|
1013
|
+
)` : `conic-gradient(
|
|
1014
|
+
from var(--beam-angle-${id}),
|
|
1015
|
+
transparent 0%, transparent 58%,
|
|
1016
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
1017
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
1018
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
1019
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
1020
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
1021
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
1022
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
1023
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
1024
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
1025
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
1026
|
+
transparent 82%
|
|
1027
|
+
)`;
|
|
1028
|
+
const smallMask = `conic-gradient(
|
|
1029
|
+
from var(--beam-angle-${id}),
|
|
1030
|
+
transparent 0%, transparent 22%,
|
|
1031
|
+
rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0.4) 36%,
|
|
1032
|
+
white 46%, white 82%,
|
|
1033
|
+
rgba(255, 255, 255, 0.4) 88%, rgba(255, 255, 255, 0.12) 94%,
|
|
1034
|
+
transparent 97%, transparent 100%
|
|
1035
|
+
)`;
|
|
1036
|
+
return `
|
|
1037
|
+
@property --beam-angle-${id} {
|
|
1038
|
+
syntax: "<angle>";
|
|
1039
|
+
initial-value: 0deg;
|
|
1040
|
+
inherits: true;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
@property --beam-opacity-${id} {
|
|
1044
|
+
syntax: "<number>";
|
|
1045
|
+
initial-value: 0;
|
|
1046
|
+
inherits: true;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
[data-beam="${id}"] {
|
|
1050
|
+
position: relative;
|
|
1051
|
+
border-radius: ${borderRadius}px;
|
|
1052
|
+
overflow: hidden;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
[data-beam="${id}"][data-active] {
|
|
1056
|
+
animation:
|
|
1057
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
1058
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
[data-beam="${id}"][data-fading] {
|
|
1062
|
+
animation:
|
|
1063
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
1064
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
[data-beam="${id}"][data-active]::after,
|
|
1068
|
+
[data-beam="${id}"][data-fading]::after {
|
|
1069
|
+
content: "";
|
|
1070
|
+
position: absolute;
|
|
1071
|
+
inset: 0;
|
|
1072
|
+
border-radius: ${innerRadius}px;
|
|
1073
|
+
padding: ${borderWidth}px;
|
|
1074
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1075
|
+
background: ${whiteGradient},${colorGradients};
|
|
1076
|
+
-webkit-mask:
|
|
1077
|
+
conic-gradient(
|
|
1078
|
+
from var(--beam-angle-${id}),
|
|
1079
|
+
transparent 0%, transparent 30%,
|
|
1080
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1081
|
+
white 52%, white 80%,
|
|
1082
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1083
|
+
transparent 95%, transparent 100%
|
|
1084
|
+
),
|
|
1085
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1086
|
+
linear-gradient(#fff 0 0);
|
|
1087
|
+
-webkit-mask-composite: source-in, xor;
|
|
1088
|
+
mask:
|
|
1089
|
+
conic-gradient(
|
|
1090
|
+
from var(--beam-angle-${id}),
|
|
1091
|
+
transparent 0%, transparent 30%,
|
|
1092
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1093
|
+
white 52%, white 80%,
|
|
1094
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1095
|
+
transparent 95%, transparent 100%
|
|
1096
|
+
),
|
|
1097
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1098
|
+
linear-gradient(#fff 0 0);
|
|
1099
|
+
mask-composite: intersect, exclude;
|
|
1100
|
+
pointer-events: none;
|
|
1101
|
+
z-index: 2;
|
|
1102
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
1103
|
+
${hueShiftAnimation}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
[data-beam="${id}"][data-active]::before,
|
|
1107
|
+
[data-beam="${id}"][data-fading]::before {
|
|
1108
|
+
content: "";
|
|
1109
|
+
position: absolute;
|
|
1110
|
+
inset: 0;
|
|
1111
|
+
border-radius: ${borderRadius}px;
|
|
1112
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1113
|
+
background: ${innerGradients};
|
|
1114
|
+
box-shadow: inset 0 0 5px 1px ${innerShadow};
|
|
1115
|
+
-webkit-mask-image: ${smallMask};
|
|
1116
|
+
-webkit-mask-composite: source-over;
|
|
1117
|
+
mask-image: ${smallMask};
|
|
1118
|
+
mask-composite: add;
|
|
1119
|
+
pointer-events: none;
|
|
1120
|
+
z-index: 1;
|
|
1121
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
1122
|
+
${hueShiftAnimation}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
1126
|
+
display: none;
|
|
1127
|
+
position: absolute;
|
|
1128
|
+
inset: 0;
|
|
1129
|
+
border-radius: ${innerRadius}px;
|
|
1130
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1131
|
+
background: ${bloomGradient};
|
|
1132
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1133
|
+
-webkit-mask-composite: xor;
|
|
1134
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1135
|
+
mask-composite: exclude;
|
|
1136
|
+
padding: ${borderWidth}px;
|
|
1137
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
1138
|
+
pointer-events: none;
|
|
1139
|
+
z-index: 3;
|
|
1140
|
+
opacity: 0;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1144
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1145
|
+
display: block;
|
|
1146
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
@keyframes beam-spin-${id} {
|
|
1150
|
+
to { --beam-angle-${id}: 360deg; }
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
@keyframes beam-fade-in-${id} {
|
|
1154
|
+
to { --beam-opacity-${id}: 1; }
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
@keyframes beam-fade-out-${id} {
|
|
1158
|
+
from { --beam-opacity-${id}: 1; }
|
|
1159
|
+
to { --beam-opacity-${id}: 0; }
|
|
1160
|
+
}
|
|
1161
|
+
${hueShiftKeyframes}
|
|
1162
|
+
${pausedAnimationsRule(id)}
|
|
1163
|
+
`;
|
|
1164
|
+
}
|
|
1165
|
+
function generateBorderVariantCSS(options) {
|
|
1166
|
+
const {
|
|
1167
|
+
id,
|
|
1168
|
+
borderRadius,
|
|
1169
|
+
borderWidth,
|
|
1170
|
+
duration,
|
|
1171
|
+
strokeOpacity,
|
|
1172
|
+
innerOpacity,
|
|
1173
|
+
bloomOpacity,
|
|
1174
|
+
innerShadow,
|
|
1175
|
+
colorVariant,
|
|
1176
|
+
staticColors,
|
|
1177
|
+
brightness,
|
|
1178
|
+
saturation,
|
|
1179
|
+
hueRange,
|
|
1180
|
+
theme
|
|
1181
|
+
} = options;
|
|
1182
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
1183
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
|
|
1184
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
1185
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
1186
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
1187
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
1188
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
1189
|
+
@keyframes beam-hue-shift-${id} {
|
|
1190
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1191
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1192
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1193
|
+
}`;
|
|
1194
|
+
const isDark = theme === "dark";
|
|
1195
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
1196
|
+
from var(--beam-angle-${id}),
|
|
1197
|
+
transparent 0%, transparent 54%,
|
|
1198
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
1199
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
1200
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
1201
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
1202
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
1203
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
1204
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
1205
|
+
transparent 78%, transparent 100%
|
|
1206
|
+
)` : `conic-gradient(
|
|
1207
|
+
from var(--beam-angle-${id}),
|
|
1208
|
+
transparent 0%, transparent 54%,
|
|
1209
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
1210
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
1211
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
1212
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
1213
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
1214
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
1215
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
1216
|
+
transparent 78%, transparent 100%
|
|
1217
|
+
)`;
|
|
1218
|
+
const colorGradients = getColorGradients(colorVariant);
|
|
1219
|
+
const innerGradients = getInnerGradients(colorVariant);
|
|
1220
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
1221
|
+
from var(--beam-angle-${id}),
|
|
1222
|
+
transparent 0%, transparent 58%,
|
|
1223
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
1224
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
1225
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
1226
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
1227
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
1228
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
1229
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
1230
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
1231
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
1232
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
1233
|
+
transparent 82%
|
|
1234
|
+
)` : `conic-gradient(
|
|
1235
|
+
from var(--beam-angle-${id}),
|
|
1236
|
+
transparent 0%, transparent 58%,
|
|
1237
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
1238
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
1239
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
1240
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
1241
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
1242
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
1243
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
1244
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
1245
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
1246
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
1247
|
+
transparent 82%
|
|
1248
|
+
)`;
|
|
1249
|
+
return `
|
|
1250
|
+
@property --beam-angle-${id} {
|
|
1251
|
+
syntax: "<angle>";
|
|
1252
|
+
initial-value: 0deg;
|
|
1253
|
+
inherits: true;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
@property --beam-opacity-${id} {
|
|
1257
|
+
syntax: "<number>";
|
|
1258
|
+
initial-value: 0;
|
|
1259
|
+
inherits: true;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
[data-beam="${id}"] {
|
|
1263
|
+
position: relative;
|
|
1264
|
+
border-radius: ${borderRadius}px;
|
|
1265
|
+
overflow: hidden;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
[data-beam="${id}"][data-active] {
|
|
1269
|
+
animation:
|
|
1270
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
1271
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
[data-beam="${id}"][data-fading] {
|
|
1275
|
+
animation:
|
|
1276
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
1277
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
[data-beam="${id}"][data-active]::after,
|
|
1281
|
+
[data-beam="${id}"][data-fading]::after {
|
|
1282
|
+
content: "";
|
|
1283
|
+
position: absolute;
|
|
1284
|
+
inset: 0;
|
|
1285
|
+
border-radius: ${innerRadius}px;
|
|
1286
|
+
padding: ${borderWidth}px;
|
|
1287
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1288
|
+
background: ${whiteGradient},${colorGradients};
|
|
1289
|
+
-webkit-mask:
|
|
1290
|
+
conic-gradient(
|
|
1291
|
+
from var(--beam-angle-${id}),
|
|
1292
|
+
transparent 0%, transparent 30%,
|
|
1293
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1294
|
+
white 52%, white 80%,
|
|
1295
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1296
|
+
transparent 95%, transparent 100%
|
|
1297
|
+
),
|
|
1298
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1299
|
+
linear-gradient(#fff 0 0);
|
|
1300
|
+
-webkit-mask-composite: source-in, xor;
|
|
1301
|
+
mask:
|
|
1302
|
+
conic-gradient(
|
|
1303
|
+
from var(--beam-angle-${id}),
|
|
1304
|
+
transparent 0%, transparent 30%,
|
|
1305
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1306
|
+
white 52%, white 80%,
|
|
1307
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1308
|
+
transparent 95%, transparent 100%
|
|
1309
|
+
),
|
|
1310
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1311
|
+
linear-gradient(#fff 0 0);
|
|
1312
|
+
mask-composite: intersect, exclude;
|
|
1313
|
+
pointer-events: none;
|
|
1314
|
+
z-index: 2;
|
|
1315
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
1316
|
+
${hueShiftAnimation}
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
[data-beam="${id}"][data-active]::before,
|
|
1320
|
+
[data-beam="${id}"][data-fading]::before {
|
|
1321
|
+
content: "";
|
|
1322
|
+
position: absolute;
|
|
1323
|
+
inset: 0;
|
|
1324
|
+
border-radius: ${borderRadius}px;
|
|
1325
|
+
background: ${innerGradients};
|
|
1326
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
1327
|
+
-webkit-mask-image:
|
|
1328
|
+
conic-gradient(
|
|
1329
|
+
from var(--beam-angle-${id}),
|
|
1330
|
+
transparent 0%, transparent 30%,
|
|
1331
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1332
|
+
white 52%, white 80%,
|
|
1333
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1334
|
+
transparent 95%, transparent 100%
|
|
1335
|
+
),
|
|
1336
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1337
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1338
|
+
-webkit-mask-composite: source-in, source-over;
|
|
1339
|
+
mask-image:
|
|
1340
|
+
conic-gradient(
|
|
1341
|
+
from var(--beam-angle-${id}),
|
|
1342
|
+
transparent 0%, transparent 30%,
|
|
1343
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
1344
|
+
white 52%, white 80%,
|
|
1345
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
1346
|
+
transparent 95%, transparent 100%
|
|
1347
|
+
),
|
|
1348
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1349
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1350
|
+
mask-composite: intersect, add;
|
|
1351
|
+
pointer-events: none;
|
|
1352
|
+
z-index: 1;
|
|
1353
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
1354
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1355
|
+
${hueShiftAnimation}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
1359
|
+
display: none;
|
|
1360
|
+
position: absolute;
|
|
1361
|
+
inset: 0;
|
|
1362
|
+
border-radius: ${innerRadius}px;
|
|
1363
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1364
|
+
background: ${bloomGradient};
|
|
1365
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1366
|
+
-webkit-mask-composite: xor;
|
|
1367
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1368
|
+
mask-composite: exclude;
|
|
1369
|
+
padding: ${borderWidth}px;
|
|
1370
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
1371
|
+
pointer-events: none;
|
|
1372
|
+
z-index: 3;
|
|
1373
|
+
opacity: 0;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1377
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1378
|
+
display: block;
|
|
1379
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
@keyframes beam-spin-${id} {
|
|
1383
|
+
to { --beam-angle-${id}: 360deg; }
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
@keyframes beam-fade-in-${id} {
|
|
1387
|
+
to { --beam-opacity-${id}: 1; }
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
@keyframes beam-fade-out-${id} {
|
|
1391
|
+
from { --beam-opacity-${id}: 1; }
|
|
1392
|
+
to { --beam-opacity-${id}: 0; }
|
|
1393
|
+
}
|
|
1394
|
+
${hueShiftKeyframes}
|
|
1395
|
+
${pausedAnimationsRule(id)}
|
|
1396
|
+
`;
|
|
1397
|
+
}
|
|
1398
|
+
function generatePulseInnerVariantCSS(options) {
|
|
1399
|
+
const {
|
|
1400
|
+
id,
|
|
1401
|
+
borderRadius,
|
|
1402
|
+
borderWidth,
|
|
1403
|
+
duration,
|
|
1404
|
+
strokeOpacity,
|
|
1405
|
+
innerOpacity,
|
|
1406
|
+
bloomOpacity,
|
|
1407
|
+
colorVariant,
|
|
1408
|
+
staticColors,
|
|
1409
|
+
brightness,
|
|
1410
|
+
saturation,
|
|
1411
|
+
theme
|
|
1412
|
+
} = options;
|
|
1413
|
+
const isDark = theme === "dark";
|
|
1414
|
+
const monoMul = colorVariant === "mono" ? 0.5 : 1;
|
|
1415
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
1416
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
1417
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
1418
|
+
const { op } = pulseParams("pulse-inner", theme, duration);
|
|
1419
|
+
const bloomBlur = 8;
|
|
1420
|
+
const b = brightness.toFixed(2);
|
|
1421
|
+
const s = saturation.toFixed(2);
|
|
1422
|
+
const ringAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
1423
|
+
const bloomAnim = staticColors ? `filter: blur(${bloomBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${bloomBlur}px) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
1424
|
+
const ringGradients = pulseRingGradients(colorVariant, id);
|
|
1425
|
+
const innerGradients = pulseInnerGradients(colorVariant, id, isDark);
|
|
1426
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_INNER_BLOOM, colorVariant, 1 - op * 0.5);
|
|
1427
|
+
return `
|
|
1428
|
+
${pulsePropertyRegs(id)}
|
|
1429
|
+
|
|
1430
|
+
[data-beam="${id}"] {
|
|
1431
|
+
position: relative;
|
|
1432
|
+
border-radius: ${borderRadius}px;
|
|
1433
|
+
overflow: hidden;
|
|
1434
|
+
isolation: isolate;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
[data-beam="${id}"][data-active] {
|
|
1438
|
+
${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
[data-beam="${id}"][data-fading] {
|
|
1442
|
+
${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
[data-beam="${id}"][data-active]::after,
|
|
1446
|
+
[data-beam="${id}"][data-fading]::after {
|
|
1447
|
+
content: "";
|
|
1448
|
+
position: absolute;
|
|
1449
|
+
inset: 0;
|
|
1450
|
+
border-radius: ${borderRadius}px;
|
|
1451
|
+
padding: ${borderWidth}px;
|
|
1452
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1453
|
+
background: ${ringGradients};
|
|
1454
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1455
|
+
-webkit-mask-composite: xor;
|
|
1456
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1457
|
+
mask-composite: exclude;
|
|
1458
|
+
pointer-events: none;
|
|
1459
|
+
z-index: 2;
|
|
1460
|
+
will-change: opacity, filter;
|
|
1461
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
1462
|
+
${ringAnim}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
[data-beam="${id}"][data-active]::before,
|
|
1466
|
+
[data-beam="${id}"][data-fading]::before {
|
|
1467
|
+
content: "";
|
|
1468
|
+
position: absolute;
|
|
1469
|
+
inset: 0;
|
|
1470
|
+
border-radius: ${borderRadius}px;
|
|
1471
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1472
|
+
background: ${innerGradients};
|
|
1473
|
+
-webkit-mask-image:
|
|
1474
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1475
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1476
|
+
-webkit-mask-composite: source-over;
|
|
1477
|
+
mask-image:
|
|
1478
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1479
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1480
|
+
mask-composite: add;
|
|
1481
|
+
pointer-events: none;
|
|
1482
|
+
z-index: 1;
|
|
1483
|
+
will-change: opacity, filter;
|
|
1484
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
1485
|
+
${ringAnim}
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
1489
|
+
display: none;
|
|
1490
|
+
position: absolute;
|
|
1491
|
+
inset: 0;
|
|
1492
|
+
border-radius: ${borderRadius}px;
|
|
1493
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1494
|
+
background: ${bloomGradients};
|
|
1495
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1496
|
+
-webkit-mask-composite: xor;
|
|
1497
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1498
|
+
mask-composite: exclude;
|
|
1499
|
+
padding: ${borderWidth}px;
|
|
1500
|
+
pointer-events: none;
|
|
1501
|
+
z-index: 3;
|
|
1502
|
+
will-change: opacity;
|
|
1503
|
+
opacity: 0;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1507
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1508
|
+
display: block;
|
|
1509
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
1510
|
+
${bloomAnim}
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
1514
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
1515
|
+
${pausedAnimationsRule(id)}
|
|
1516
|
+
|
|
1517
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1518
|
+
[data-beam="${id}"][data-active],
|
|
1519
|
+
[data-beam="${id}"][data-fading],
|
|
1520
|
+
[data-beam="${id}"][data-active]::after,
|
|
1521
|
+
[data-beam="${id}"][data-fading]::after,
|
|
1522
|
+
[data-beam="${id}"][data-active]::before,
|
|
1523
|
+
[data-beam="${id}"][data-fading]::before,
|
|
1524
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1525
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1526
|
+
animation: none !important;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
`;
|
|
1530
|
+
}
|
|
1531
|
+
function generatePulseOuterVariantCSS(options) {
|
|
1532
|
+
const {
|
|
1533
|
+
id,
|
|
1534
|
+
borderRadius,
|
|
1535
|
+
duration,
|
|
1536
|
+
strokeOpacity,
|
|
1537
|
+
innerOpacity,
|
|
1538
|
+
bloomOpacity,
|
|
1539
|
+
colorVariant,
|
|
1540
|
+
staticColors,
|
|
1541
|
+
brightness,
|
|
1542
|
+
saturation,
|
|
1543
|
+
theme,
|
|
1544
|
+
hairlineOpacity = 0
|
|
1545
|
+
} = options;
|
|
1546
|
+
const isDark = theme === "dark";
|
|
1547
|
+
const monoMul = colorVariant === "mono" ? 0.5 : 1;
|
|
1548
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
1549
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
1550
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
1551
|
+
const hairRGB = isDark ? "70, 70, 70" : "0, 0, 0";
|
|
1552
|
+
const hairOp = hairlineOpacity.toFixed(2);
|
|
1553
|
+
const hairlineLine = `linear-gradient(rgba(${hairRGB}, ${hairOp}), rgba(${hairRGB}, ${hairOp}))`;
|
|
1554
|
+
const { op } = pulseParams("pulse-outside", theme, duration);
|
|
1555
|
+
const sw = 0.95;
|
|
1556
|
+
const sh = 0.9;
|
|
1557
|
+
const glowBlur = isDark ? 3 : 6;
|
|
1558
|
+
const bloomBlur = isDark ? 22.5 : 15;
|
|
1559
|
+
const b = brightness.toFixed(2);
|
|
1560
|
+
const s = saturation.toFixed(2);
|
|
1561
|
+
const strokeAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
1562
|
+
const glowBright = `brightness(var(--beam-glow-brightness, ${b})) saturate(var(--beam-glow-saturate, ${s}))`;
|
|
1563
|
+
const coreAnim = staticColors ? `filter: blur(var(--beam-core-blur, ${glowBlur}px)) ${glowBright};` : `filter: blur(var(--beam-core-blur, ${glowBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
|
|
1564
|
+
const bloomAnim = staticColors ? `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) ${glowBright};` : `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
|
|
1565
|
+
const strokeGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
1566
|
+
const coreGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
1567
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_OUTER_BLOOM, colorVariant, 1 - op * 0.5);
|
|
1568
|
+
const strokeBackground = hairlineOpacity > 0 ? `${strokeGradients},
|
|
1569
|
+
${hairlineLine}` : strokeGradients;
|
|
1570
|
+
return `
|
|
1571
|
+
${pulsePropertyRegs(id)}
|
|
1572
|
+
|
|
1573
|
+
[data-beam="${id}"] {
|
|
1574
|
+
position: relative;
|
|
1575
|
+
border-radius: ${borderRadius}px;
|
|
1576
|
+
overflow: visible;
|
|
1577
|
+
isolation: isolate;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
[data-beam="${id}"][data-active] {
|
|
1581
|
+
${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
[data-beam="${id}"][data-fading] {
|
|
1585
|
+
${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
|
|
1586
|
+
}
|
|
1587
|
+
${hairlineOpacity > 0 ? `
|
|
1588
|
+
/* Idle hairline \u2014 painted above the (opaque) child in the inner 1px edge ring so
|
|
1589
|
+
it overlaps a standard inset component border exactly. */
|
|
1590
|
+
[data-beam="${id}"]::after {
|
|
1591
|
+
content: "";
|
|
1592
|
+
position: absolute;
|
|
1593
|
+
inset: 0;
|
|
1594
|
+
border-radius: ${borderRadius}px;
|
|
1595
|
+
padding: 1px;
|
|
1596
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1597
|
+
background: ${hairlineLine};
|
|
1598
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1599
|
+
-webkit-mask-composite: xor;
|
|
1600
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1601
|
+
mask-composite: exclude;
|
|
1602
|
+
pointer-events: none;
|
|
1603
|
+
z-index: 2;
|
|
1604
|
+
}
|
|
1605
|
+
` : ""}
|
|
1606
|
+
[data-beam="${id}"][data-active]::after,
|
|
1607
|
+
[data-beam="${id}"][data-fading]::after {
|
|
1608
|
+
content: "";
|
|
1609
|
+
position: absolute;
|
|
1610
|
+
inset: 0;
|
|
1611
|
+
border-radius: ${borderRadius}px;
|
|
1612
|
+
padding: 1px;
|
|
1613
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1614
|
+
background: ${strokeBackground};
|
|
1615
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1616
|
+
-webkit-mask-composite: xor;
|
|
1617
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1618
|
+
mask-composite: exclude;
|
|
1619
|
+
pointer-events: none;
|
|
1620
|
+
z-index: 2;
|
|
1621
|
+
will-change: opacity, filter;
|
|
1622
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
1623
|
+
${strokeAnim}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
[data-beam="${id}"][data-active]::before,
|
|
1627
|
+
[data-beam="${id}"][data-fading]::before {
|
|
1628
|
+
content: "";
|
|
1629
|
+
position: absolute;
|
|
1630
|
+
inset: -10px;
|
|
1631
|
+
z-index: -1;
|
|
1632
|
+
border-radius: ${borderRadius + 10}px;
|
|
1633
|
+
background: ${coreGradients};
|
|
1634
|
+
transform: scale(${sw}, ${sh});
|
|
1635
|
+
pointer-events: none;
|
|
1636
|
+
will-change: opacity, filter;
|
|
1637
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
1638
|
+
${coreAnim}
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
1642
|
+
display: none;
|
|
1643
|
+
position: absolute;
|
|
1644
|
+
inset: -30px;
|
|
1645
|
+
z-index: -1;
|
|
1646
|
+
border-radius: ${borderRadius + 30}px;
|
|
1647
|
+
background: ${bloomGradients};
|
|
1648
|
+
transform: scale(${sw}, ${sh});
|
|
1649
|
+
pointer-events: none;
|
|
1650
|
+
will-change: transform;
|
|
1651
|
+
opacity: 0;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1655
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1656
|
+
display: block;
|
|
1657
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
1658
|
+
${bloomAnim}
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
1662
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
1663
|
+
${pausedAnimationsRule(id)}
|
|
1664
|
+
|
|
1665
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1666
|
+
[data-beam="${id}"][data-active],
|
|
1667
|
+
[data-beam="${id}"][data-fading],
|
|
1668
|
+
[data-beam="${id}"][data-active]::after,
|
|
1669
|
+
[data-beam="${id}"][data-fading]::after,
|
|
1670
|
+
[data-beam="${id}"][data-active]::before,
|
|
1671
|
+
[data-beam="${id}"][data-fading]::before,
|
|
1672
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1673
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1674
|
+
animation: none !important;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
`;
|
|
1678
|
+
}
|
|
1679
|
+
function generateLineVariantCSS(options) {
|
|
1680
|
+
const {
|
|
1681
|
+
id,
|
|
1682
|
+
borderRadius,
|
|
1683
|
+
borderWidth,
|
|
1684
|
+
duration,
|
|
1685
|
+
strokeOpacity,
|
|
1686
|
+
innerOpacity,
|
|
1687
|
+
bloomOpacity,
|
|
1688
|
+
innerShadow,
|
|
1689
|
+
colorVariant,
|
|
1690
|
+
staticColors,
|
|
1691
|
+
brightness,
|
|
1692
|
+
saturation,
|
|
1693
|
+
hueRange,
|
|
1694
|
+
theme
|
|
1695
|
+
} = options;
|
|
1696
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
1697
|
+
const isDark = theme === "dark";
|
|
1698
|
+
const finalStrokeOpacity = strokeOpacity;
|
|
1699
|
+
const finalInnerOpacity = innerOpacity;
|
|
1700
|
+
const finalBloomOpacity = bloomOpacity;
|
|
1701
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
1702
|
+
const hueShiftBloomAnimation = staticColors ? "" : `animation: beam-hue-shift-bloom-${id} 8s ease-in-out infinite;`;
|
|
1703
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
1704
|
+
@keyframes beam-hue-shift-${id} {
|
|
1705
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1706
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1707
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
@keyframes beam-hue-shift-bloom-${id} {
|
|
1711
|
+
0% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1712
|
+
50% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1713
|
+
100% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
1714
|
+
}`;
|
|
1715
|
+
const whiteHighlight = isDark ? `radial-gradient(
|
|
1716
|
+
ellipse calc(24px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
1717
|
+
rgba(255, 255, 255, 0.38) 0%,
|
|
1718
|
+
rgba(255, 255, 255, 0.12) 30%,
|
|
1719
|
+
transparent 65%
|
|
1720
|
+
)` : `radial-gradient(
|
|
1721
|
+
ellipse calc(35px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
1722
|
+
rgba(0, 0, 0, 0.6) 0%,
|
|
1723
|
+
rgba(0, 0, 0, 0.25) 35%,
|
|
1724
|
+
transparent 70%
|
|
1725
|
+
)`;
|
|
1726
|
+
const colorGradients = getLineColorGradients(colorVariant, isDark, id);
|
|
1727
|
+
const innerGradients = getLineInnerGradients(colorVariant, id);
|
|
1728
|
+
const bloomGradients = getLineBloomGradients(colorVariant, isDark, id);
|
|
1729
|
+
const monoBloomBlur = colorVariant === "mono" ? "filter: blur(6px);" : "";
|
|
1730
|
+
return `
|
|
1731
|
+
@property --beam-x-${id} {
|
|
1732
|
+
syntax: "<number>";
|
|
1733
|
+
initial-value: 0;
|
|
1734
|
+
inherits: true;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
@property --beam-w-${id} {
|
|
1738
|
+
syntax: "<number>";
|
|
1739
|
+
initial-value: 1;
|
|
1740
|
+
inherits: true;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
@property --beam-h-${id} {
|
|
1744
|
+
syntax: "<number>";
|
|
1745
|
+
initial-value: 1;
|
|
1746
|
+
inherits: true;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
@property --beam-spike-${id} {
|
|
1750
|
+
syntax: "<number>";
|
|
1751
|
+
initial-value: 1;
|
|
1752
|
+
inherits: true;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
@property --beam-spike2-${id} {
|
|
1756
|
+
syntax: "<number>";
|
|
1757
|
+
initial-value: 1;
|
|
1758
|
+
inherits: true;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
@property --beam-edge-${id} {
|
|
1762
|
+
syntax: "<number>";
|
|
1763
|
+
initial-value: 1;
|
|
1764
|
+
inherits: true;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
@property --beam-opacity-${id} {
|
|
1768
|
+
syntax: "<number>";
|
|
1769
|
+
initial-value: 0;
|
|
1770
|
+
inherits: true;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
[data-beam="${id}"] {
|
|
1774
|
+
position: relative;
|
|
1775
|
+
border-radius: ${borderRadius}px;
|
|
1776
|
+
overflow: hidden;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
[data-beam="${id}"][data-active] {
|
|
1780
|
+
animation:
|
|
1781
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
1782
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
1783
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
1784
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
1785
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
1786
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
[data-beam="${id}"][data-fading] {
|
|
1790
|
+
animation:
|
|
1791
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
1792
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
1793
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
1794
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
1795
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
1796
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
[data-beam="${id}"][data-active]::after,
|
|
1800
|
+
[data-beam="${id}"][data-fading]::after {
|
|
1801
|
+
content: "";
|
|
1802
|
+
position: absolute;
|
|
1803
|
+
inset: 0;
|
|
1804
|
+
border-radius: ${innerRadius}px;
|
|
1805
|
+
padding: ${borderWidth}px;
|
|
1806
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1807
|
+
background: ${whiteHighlight}, ${colorGradients};
|
|
1808
|
+
-webkit-mask:
|
|
1809
|
+
radial-gradient(
|
|
1810
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1811
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
1812
|
+
),
|
|
1813
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1814
|
+
linear-gradient(#fff 0 0);
|
|
1815
|
+
-webkit-mask-composite: source-in, xor;
|
|
1816
|
+
mask:
|
|
1817
|
+
radial-gradient(
|
|
1818
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1819
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
1820
|
+
),
|
|
1821
|
+
linear-gradient(#fff 0 0) content-box,
|
|
1822
|
+
linear-gradient(#fff 0 0);
|
|
1823
|
+
mask-composite: intersect, exclude;
|
|
1824
|
+
pointer-events: none;
|
|
1825
|
+
z-index: 2;
|
|
1826
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
1827
|
+
${hueShiftAnimation}
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
[data-beam="${id}"][data-active]::before,
|
|
1831
|
+
[data-beam="${id}"][data-fading]::before {
|
|
1832
|
+
content: "";
|
|
1833
|
+
position: absolute;
|
|
1834
|
+
inset: 0;
|
|
1835
|
+
border-radius: ${borderRadius}px;
|
|
1836
|
+
background: ${innerGradients};
|
|
1837
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
1838
|
+
-webkit-mask-image:
|
|
1839
|
+
radial-gradient(
|
|
1840
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1841
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
1842
|
+
),
|
|
1843
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1844
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1845
|
+
-webkit-mask-composite: source-in, source-over;
|
|
1846
|
+
mask-image:
|
|
1847
|
+
radial-gradient(
|
|
1848
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1849
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
1850
|
+
),
|
|
1851
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1852
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1853
|
+
mask-composite: intersect, add;
|
|
1854
|
+
pointer-events: none;
|
|
1855
|
+
z-index: 1;
|
|
1856
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
1857
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1858
|
+
${hueShiftAnimation}
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
1862
|
+
display: none;
|
|
1863
|
+
position: absolute;
|
|
1864
|
+
inset: 0;
|
|
1865
|
+
border-radius: ${innerRadius}px;
|
|
1866
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
1867
|
+
padding: 0;
|
|
1868
|
+
-webkit-mask: radial-gradient(
|
|
1869
|
+
ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1870
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
1871
|
+
);
|
|
1872
|
+
-webkit-mask-composite: source-over;
|
|
1873
|
+
mask: radial-gradient(
|
|
1874
|
+
ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
1875
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
1876
|
+
);
|
|
1877
|
+
mask-composite: add;
|
|
1878
|
+
background: ${bloomGradients};
|
|
1879
|
+
${monoBloomBlur}
|
|
1880
|
+
pointer-events: none;
|
|
1881
|
+
z-index: 3;
|
|
1882
|
+
opacity: 0;
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
1886
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
1887
|
+
display: block;
|
|
1888
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
1889
|
+
${hueShiftBloomAnimation}
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
@keyframes beam-travel-${id} {
|
|
1893
|
+
0% { --beam-x-${id}: 0.06; --beam-w-${id}: 0.5; }
|
|
1894
|
+
10% { --beam-x-${id}: 0.15; --beam-w-${id}: 0.8; }
|
|
1895
|
+
20% { --beam-x-${id}: 0.25; --beam-w-${id}: 1.1; }
|
|
1896
|
+
30% { --beam-x-${id}: 0.35; --beam-w-${id}: 1.3; }
|
|
1897
|
+
40% { --beam-x-${id}: 0.44; --beam-w-${id}: 1.45; }
|
|
1898
|
+
50% { --beam-x-${id}: 0.5; --beam-w-${id}: 1.5; }
|
|
1899
|
+
60% { --beam-x-${id}: 0.56; --beam-w-${id}: 1.45; }
|
|
1900
|
+
70% { --beam-x-${id}: 0.65; --beam-w-${id}: 1.3; }
|
|
1901
|
+
80% { --beam-x-${id}: 0.75; --beam-w-${id}: 1.1; }
|
|
1902
|
+
90% { --beam-x-${id}: 0.85; --beam-w-${id}: 0.8; }
|
|
1903
|
+
100% { --beam-x-${id}: 0.94; --beam-w-${id}: 0.5; }
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
@keyframes beam-edge-fade-${id} {
|
|
1907
|
+
0% { --beam-edge-${id}: 0; }
|
|
1908
|
+
12.5% { --beam-edge-${id}: 0; }
|
|
1909
|
+
32.5% { --beam-edge-${id}: 1; }
|
|
1910
|
+
67.5% { --beam-edge-${id}: 1; }
|
|
1911
|
+
87.5% { --beam-edge-${id}: 0; }
|
|
1912
|
+
100% { --beam-edge-${id}: 0; }
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
@keyframes beam-breathe-${id} {
|
|
1916
|
+
0%, 100% { --beam-h-${id}: 0.8; }
|
|
1917
|
+
25% { --beam-h-${id}: 1.25; }
|
|
1918
|
+
55% { --beam-h-${id}: 0.85; }
|
|
1919
|
+
80% { --beam-h-${id}: 1.3; }
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
@keyframes beam-spike-${id} {
|
|
1923
|
+
0% { --beam-spike-${id}: 0.8; }
|
|
1924
|
+
25% { --beam-spike-${id}: 1.3; }
|
|
1925
|
+
50% { --beam-spike-${id}: 0.9; }
|
|
1926
|
+
75% { --beam-spike-${id}: 1.4; }
|
|
1927
|
+
100% { --beam-spike-${id}: 0.8; }
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
@keyframes beam-spike2-${id} {
|
|
1931
|
+
0% { --beam-spike2-${id}: 1.2; }
|
|
1932
|
+
25% { --beam-spike2-${id}: 0.7; }
|
|
1933
|
+
50% { --beam-spike2-${id}: 1.4; }
|
|
1934
|
+
75% { --beam-spike2-${id}: 0.8; }
|
|
1935
|
+
100% { --beam-spike2-${id}: 1.2; }
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
@keyframes beam-fade-in-${id} {
|
|
1939
|
+
to { --beam-opacity-${id}: 1; }
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
@keyframes beam-fade-out-${id} {
|
|
1943
|
+
from { --beam-opacity-${id}: 1; }
|
|
1944
|
+
to { --beam-opacity-${id}: 0; }
|
|
1945
|
+
}
|
|
1946
|
+
${hueShiftKeyframes}
|
|
1947
|
+
${pausedAnimationsRule(id)}
|
|
1948
|
+
`;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
// src/border-beam/pulseDriver.ts
|
|
1952
|
+
var instances = /* @__PURE__ */ new Set();
|
|
1953
|
+
var rafId = null;
|
|
1954
|
+
var lastFrame = 0;
|
|
1955
|
+
var FRAME_INTERVAL = 1e3 / 30 - 2;
|
|
1956
|
+
var TWO_PI = Math.PI * 2;
|
|
1957
|
+
function pingPong(phase) {
|
|
1958
|
+
return (1 - Math.cos(TWO_PI * phase)) / 2;
|
|
1959
|
+
}
|
|
1960
|
+
function frame(ts) {
|
|
1961
|
+
rafId = requestAnimationFrame(frame);
|
|
1962
|
+
if (ts - lastFrame < FRAME_INTERVAL) return;
|
|
1963
|
+
lastFrame = ts;
|
|
1964
|
+
const tSec = ts / 1e3;
|
|
1965
|
+
instances.forEach(({ el, config }) => {
|
|
1966
|
+
for (const osc of config.oscillators) {
|
|
1967
|
+
const phase = (tSec - osc.delay) / osc.period;
|
|
1968
|
+
const value = osc.a + (osc.b - osc.a) * pingPong(phase);
|
|
1969
|
+
el.style.setProperty(
|
|
1970
|
+
osc.prop,
|
|
1971
|
+
osc.unit === "px" ? `${value.toFixed(2)}px` : value.toFixed(4)
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1974
|
+
if (config.hue) {
|
|
1975
|
+
const { prop, range, period, continuous } = config.hue;
|
|
1976
|
+
const value = continuous ? tSec / period % 1 * range : -range + 2 * range * pingPong(tSec / period);
|
|
1977
|
+
el.style.setProperty(prop, `${value.toFixed(2)}deg`);
|
|
1978
|
+
}
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1981
|
+
function startLoop() {
|
|
1982
|
+
if (rafId == null) {
|
|
1983
|
+
lastFrame = 0;
|
|
1984
|
+
rafId = requestAnimationFrame(frame);
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
function stopLoopIfIdle() {
|
|
1988
|
+
if (instances.size === 0 && rafId != null) {
|
|
1989
|
+
cancelAnimationFrame(rafId);
|
|
1990
|
+
rafId = null;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
function registerPulseInstance(el, config) {
|
|
1994
|
+
const instance = { el, config };
|
|
1995
|
+
instances.add(instance);
|
|
1996
|
+
startLoop();
|
|
1997
|
+
return () => {
|
|
1998
|
+
instances.delete(instance);
|
|
1999
|
+
stopLoopIfIdle();
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
function documentTheme() {
|
|
2003
|
+
if (typeof document === "undefined") return null;
|
|
2004
|
+
const root = document.documentElement;
|
|
2005
|
+
const attr = root.getAttribute("data-theme");
|
|
2006
|
+
if (attr === "dark" || attr === "light") return attr;
|
|
2007
|
+
if (root.classList.contains("dark")) return "dark";
|
|
2008
|
+
if (root.classList.contains("light")) return "light";
|
|
2009
|
+
return null;
|
|
2010
|
+
}
|
|
2011
|
+
function useSystemTheme(enabled) {
|
|
2012
|
+
const [theme, setTheme] = react.useState(() => {
|
|
2013
|
+
const fromDocument = documentTheme();
|
|
2014
|
+
if (fromDocument) return fromDocument;
|
|
2015
|
+
if (typeof window === "undefined") return "dark";
|
|
2016
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
2017
|
+
});
|
|
2018
|
+
react.useEffect(() => {
|
|
2019
|
+
if (!enabled || typeof window === "undefined") return;
|
|
2020
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2021
|
+
const resolve = () => {
|
|
2022
|
+
setTheme(documentTheme() ?? (mediaQuery.matches ? "dark" : "light"));
|
|
2023
|
+
};
|
|
2024
|
+
resolve();
|
|
2025
|
+
mediaQuery.addEventListener("change", resolve);
|
|
2026
|
+
const observer = typeof MutationObserver !== "undefined" ? new MutationObserver(resolve) : null;
|
|
2027
|
+
observer?.observe(document.documentElement, {
|
|
2028
|
+
attributes: true,
|
|
2029
|
+
attributeFilter: ["class", "data-theme"]
|
|
2030
|
+
});
|
|
2031
|
+
return () => {
|
|
2032
|
+
mediaQuery.removeEventListener("change", resolve);
|
|
2033
|
+
observer?.disconnect();
|
|
2034
|
+
};
|
|
2035
|
+
}, [enabled]);
|
|
2036
|
+
return theme;
|
|
2037
|
+
}
|
|
2038
|
+
function resolveTheme(theme, systemTheme) {
|
|
2039
|
+
return theme === "auto" ? systemTheme : theme;
|
|
2040
|
+
}
|
|
2041
|
+
var BorderBeam = react.forwardRef(
|
|
2042
|
+
function BorderBeam2({
|
|
2043
|
+
children,
|
|
2044
|
+
size = "md",
|
|
2045
|
+
colorVariant = "colorful",
|
|
2046
|
+
theme = "dark",
|
|
2047
|
+
staticColors = false,
|
|
2048
|
+
duration,
|
|
2049
|
+
active = true,
|
|
2050
|
+
borderRadius: customBorderRadius,
|
|
2051
|
+
brightness: brightnessProp,
|
|
2052
|
+
saturation,
|
|
2053
|
+
hueRange = 30,
|
|
2054
|
+
strength = 1,
|
|
2055
|
+
className,
|
|
2056
|
+
style,
|
|
2057
|
+
onActivate,
|
|
2058
|
+
onDeactivate,
|
|
2059
|
+
onAnimationEnd: consumerOnAnimationEnd,
|
|
2060
|
+
...props
|
|
2061
|
+
}, ref) {
|
|
2062
|
+
const baseId = react.useId();
|
|
2063
|
+
const id = baseId.replace(/:/g, "-");
|
|
2064
|
+
const internalRef = react.useRef(null);
|
|
2065
|
+
const [isActive, setIsActive] = react.useState(active);
|
|
2066
|
+
const [isFading, setIsFading] = react.useState(false);
|
|
2067
|
+
const [isVisible, setIsVisible] = react.useState(true);
|
|
2068
|
+
const [detectedRadius, setDetectedRadius] = react.useState(null);
|
|
2069
|
+
const [pulseGlowScale, setPulseGlowScale] = react.useState({ x: 1, y: 1 });
|
|
2070
|
+
const effectsOn = isActive || isFading;
|
|
2071
|
+
const systemTheme = useSystemTheme(effectsOn);
|
|
2072
|
+
react.useEffect(() => {
|
|
2073
|
+
if (!effectsOn || customBorderRadius != null) return;
|
|
2074
|
+
const el = internalRef.current;
|
|
2075
|
+
if (!el) return;
|
|
2076
|
+
const detect = () => {
|
|
2077
|
+
const child = el.firstElementChild;
|
|
2078
|
+
if (!child) return;
|
|
2079
|
+
const computed = getComputedStyle(child);
|
|
2080
|
+
const raw = parseFloat(computed.borderTopLeftRadius);
|
|
2081
|
+
if (!isNaN(raw) && raw > 0) {
|
|
2082
|
+
setDetectedRadius(raw);
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
detect();
|
|
2086
|
+
const observer = new MutationObserver(detect);
|
|
2087
|
+
observer.observe(el, { childList: true, subtree: false });
|
|
2088
|
+
return () => observer.disconnect();
|
|
2089
|
+
}, [effectsOn, customBorderRadius, children]);
|
|
2090
|
+
react.useEffect(() => {
|
|
2091
|
+
if (active && !isActive && !isFading) {
|
|
2092
|
+
setIsActive(true);
|
|
2093
|
+
} else if (!active && isActive && !isFading) {
|
|
2094
|
+
setIsFading(true);
|
|
2095
|
+
}
|
|
2096
|
+
}, [active, isActive, isFading]);
|
|
2097
|
+
react.useEffect(() => {
|
|
2098
|
+
if (!effectsOn) return;
|
|
2099
|
+
const el = internalRef.current;
|
|
2100
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
2101
|
+
const observer = new IntersectionObserver(
|
|
2102
|
+
(entries) => {
|
|
2103
|
+
for (const entry of entries) setIsVisible(entry.isIntersecting);
|
|
2104
|
+
},
|
|
2105
|
+
// Start animating slightly before the element scrolls into view.
|
|
2106
|
+
{ rootMargin: "256px" }
|
|
2107
|
+
);
|
|
2108
|
+
observer.observe(el);
|
|
2109
|
+
return () => observer.disconnect();
|
|
2110
|
+
}, [effectsOn]);
|
|
2111
|
+
react.useEffect(() => {
|
|
2112
|
+
if (!effectsOn || size !== "pulse-outside") {
|
|
2113
|
+
setPulseGlowScale({ x: 1, y: 1 });
|
|
2114
|
+
return;
|
|
2115
|
+
}
|
|
2116
|
+
const el = internalRef.current;
|
|
2117
|
+
if (!el) return;
|
|
2118
|
+
const REF_WIDTH = 350;
|
|
2119
|
+
const REF_HEIGHT = 140;
|
|
2120
|
+
const MIN_SCALE = 0.35;
|
|
2121
|
+
const MAX_SCALE = 4;
|
|
2122
|
+
const clamp = (value) => Math.max(MIN_SCALE, Math.min(MAX_SCALE, value));
|
|
2123
|
+
const measure = () => {
|
|
2124
|
+
const child2 = el.firstElementChild;
|
|
2125
|
+
if (!child2) return;
|
|
2126
|
+
const rect = child2.getBoundingClientRect();
|
|
2127
|
+
if (!rect.width || !rect.height) return;
|
|
2128
|
+
const x = +clamp(rect.width / REF_WIDTH).toFixed(3);
|
|
2129
|
+
const y = +clamp(rect.height / REF_HEIGHT).toFixed(3);
|
|
2130
|
+
setPulseGlowScale((prev) => prev.x === x && prev.y === y ? prev : { x, y });
|
|
2131
|
+
};
|
|
2132
|
+
measure();
|
|
2133
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
2134
|
+
const child = el.firstElementChild;
|
|
2135
|
+
if (!child) return;
|
|
2136
|
+
const resizeObserver = new ResizeObserver(measure);
|
|
2137
|
+
resizeObserver.observe(child);
|
|
2138
|
+
return () => resizeObserver.disconnect();
|
|
2139
|
+
}, [effectsOn, size, children]);
|
|
2140
|
+
const handleAnimationEnd = react.useCallback(
|
|
2141
|
+
(e) => {
|
|
2142
|
+
const animationName = e.animationName;
|
|
2143
|
+
if (animationName.includes("fade-out")) {
|
|
2144
|
+
setIsActive(false);
|
|
2145
|
+
setIsFading(false);
|
|
2146
|
+
onDeactivate?.();
|
|
2147
|
+
} else if (animationName.includes("fade-in")) {
|
|
2148
|
+
onActivate?.();
|
|
2149
|
+
}
|
|
2150
|
+
consumerOnAnimationEnd?.(e);
|
|
2151
|
+
},
|
|
2152
|
+
[onActivate, onDeactivate, consumerOnAnimationEnd]
|
|
2153
|
+
);
|
|
2154
|
+
const resolvedTheme = resolveTheme(theme, systemTheme);
|
|
2155
|
+
const themeConfig = sizeThemePresets[size][resolvedTheme];
|
|
2156
|
+
const sizeConfig = sizePresets[size];
|
|
2157
|
+
const isPulse = size === "pulse-inner" || size === "pulse-outside";
|
|
2158
|
+
const finalBorderRadius = customBorderRadius ?? detectedRadius ?? sizeConfig.borderRadius;
|
|
2159
|
+
const finalDuration = duration ?? (size === "line" ? 3.1 : isPulse ? 2.3 : 1.96);
|
|
2160
|
+
const finalSaturation = saturation ?? themeConfig.saturation;
|
|
2161
|
+
const finalBrightness = brightnessProp ?? themeConfig.brightness ?? 1.3;
|
|
2162
|
+
const finalHueRange = size === "line" ? Math.min(hueRange, 13) : hueRange;
|
|
2163
|
+
const finalStaticColors = colorVariant === "mono" ? true : staticColors;
|
|
2164
|
+
const cssStyles = react.useMemo(
|
|
2165
|
+
() => !effectsOn ? "" : generateBeamCSS({
|
|
2166
|
+
id,
|
|
2167
|
+
borderRadius: finalBorderRadius,
|
|
2168
|
+
borderWidth: sizeConfig.borderWidth,
|
|
2169
|
+
duration: finalDuration,
|
|
2170
|
+
strokeOpacity: themeConfig.strokeOpacity,
|
|
2171
|
+
innerOpacity: themeConfig.innerOpacity,
|
|
2172
|
+
bloomOpacity: themeConfig.bloomOpacity,
|
|
2173
|
+
innerShadow: themeConfig.innerShadow,
|
|
2174
|
+
size,
|
|
2175
|
+
colorVariant,
|
|
2176
|
+
staticColors: finalStaticColors,
|
|
2177
|
+
brightness: finalBrightness,
|
|
2178
|
+
saturation: finalSaturation,
|
|
2179
|
+
hueRange: finalHueRange,
|
|
2180
|
+
theme: resolvedTheme,
|
|
2181
|
+
hairlineOpacity: themeConfig.hairlineOpacity
|
|
2182
|
+
}),
|
|
2183
|
+
[
|
|
2184
|
+
effectsOn,
|
|
2185
|
+
id,
|
|
2186
|
+
finalBorderRadius,
|
|
2187
|
+
sizeConfig.borderWidth,
|
|
2188
|
+
finalDuration,
|
|
2189
|
+
themeConfig.strokeOpacity,
|
|
2190
|
+
themeConfig.innerOpacity,
|
|
2191
|
+
themeConfig.bloomOpacity,
|
|
2192
|
+
themeConfig.innerShadow,
|
|
2193
|
+
themeConfig.hairlineOpacity,
|
|
2194
|
+
size,
|
|
2195
|
+
colorVariant,
|
|
2196
|
+
finalStaticColors,
|
|
2197
|
+
finalBrightness,
|
|
2198
|
+
finalSaturation,
|
|
2199
|
+
finalHueRange,
|
|
2200
|
+
resolvedTheme
|
|
2201
|
+
]
|
|
2202
|
+
);
|
|
2203
|
+
const driverConfig = react.useMemo(
|
|
2204
|
+
() => isPulse ? getPulseDriverConfig(size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id) : null,
|
|
2205
|
+
[isPulse, size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id]
|
|
2206
|
+
);
|
|
2207
|
+
react.useEffect(() => {
|
|
2208
|
+
if (!driverConfig) return;
|
|
2209
|
+
if (!(isActive || isFading) || !isVisible) return;
|
|
2210
|
+
const el = internalRef.current;
|
|
2211
|
+
if (!el) return;
|
|
2212
|
+
if (typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
return registerPulseInstance(el, driverConfig);
|
|
2216
|
+
}, [driverConfig, isActive, isFading, isVisible]);
|
|
2217
|
+
const setRefs = react.useCallback(
|
|
2218
|
+
(node) => {
|
|
2219
|
+
internalRef.current = node;
|
|
2220
|
+
if (typeof ref === "function") {
|
|
2221
|
+
ref(node);
|
|
2222
|
+
} else if (ref) {
|
|
2223
|
+
ref.current = node;
|
|
2224
|
+
}
|
|
2225
|
+
},
|
|
2226
|
+
[ref]
|
|
2227
|
+
);
|
|
2228
|
+
const mergedStyle = {
|
|
2229
|
+
...style ?? {},
|
|
2230
|
+
"--beam-strength": Math.max(0, Math.min(1, strength)),
|
|
2231
|
+
...size === "pulse-outside" ? { "--pulse-glow-sx": pulseGlowScale.x, "--pulse-glow-sy": pulseGlowScale.y } : {}
|
|
2232
|
+
};
|
|
2233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2234
|
+
effectsOn && /* @__PURE__ */ jsxRuntime.jsx("style", { children: cssStyles }),
|
|
2235
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2236
|
+
"div",
|
|
2237
|
+
{
|
|
2238
|
+
...props,
|
|
2239
|
+
ref: setRefs,
|
|
2240
|
+
"data-beam": id,
|
|
2241
|
+
"data-active": isActive && !isFading ? "" : void 0,
|
|
2242
|
+
"data-fading": isFading ? "" : void 0,
|
|
2243
|
+
"data-paused": isActive && !isFading && !isVisible ? "" : void 0,
|
|
2244
|
+
className,
|
|
2245
|
+
style: mergedStyle,
|
|
2246
|
+
onAnimationEnd: handleAnimationEnd,
|
|
2247
|
+
children: [
|
|
2248
|
+
children,
|
|
2249
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-beam-bloom": true })
|
|
2250
|
+
]
|
|
2251
|
+
}
|
|
2252
|
+
)
|
|
2253
|
+
] });
|
|
2254
|
+
}
|
|
2255
|
+
);
|
|
2256
|
+
var ROTATE_SIZES = /* @__PURE__ */ new Set(["sm", "md", "line"]);
|
|
2257
|
+
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
2258
|
+
function subscribeReducedMotion(onChange) {
|
|
2259
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
2260
|
+
};
|
|
2261
|
+
const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
2262
|
+
mediaQuery.addEventListener("change", onChange);
|
|
2263
|
+
return () => mediaQuery.removeEventListener("change", onChange);
|
|
2264
|
+
}
|
|
2265
|
+
function readReducedMotion() {
|
|
2266
|
+
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
2267
|
+
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
2268
|
+
}
|
|
2269
|
+
function readReducedMotionServer() {
|
|
2270
|
+
return false;
|
|
2271
|
+
}
|
|
2272
|
+
function BrandBeam({
|
|
2273
|
+
children,
|
|
2274
|
+
size = "md",
|
|
2275
|
+
active = true,
|
|
2276
|
+
strength,
|
|
2277
|
+
borderRadius,
|
|
2278
|
+
className
|
|
2279
|
+
}) {
|
|
2280
|
+
const reducedMotion = react.useSyncExternalStore(
|
|
2281
|
+
subscribeReducedMotion,
|
|
2282
|
+
readReducedMotion,
|
|
2283
|
+
readReducedMotionServer
|
|
2284
|
+
);
|
|
2285
|
+
const effectiveActive = active && !(reducedMotion && ROTATE_SIZES.has(size));
|
|
2286
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2287
|
+
BorderBeam,
|
|
2288
|
+
{
|
|
2289
|
+
size,
|
|
2290
|
+
colorVariant: "brand",
|
|
2291
|
+
theme: "auto",
|
|
2292
|
+
active: effectiveActive,
|
|
2293
|
+
strength,
|
|
2294
|
+
borderRadius,
|
|
2295
|
+
className,
|
|
2296
|
+
children
|
|
2297
|
+
}
|
|
2298
|
+
);
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
exports.BrandBeam = BrandBeam;
|
|
2302
|
+
//# sourceMappingURL=brand-beam.cjs.map
|
|
2303
|
+
//# sourceMappingURL=brand-beam.cjs.map
|