glass-pulse-fx 0.1.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/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/chunk-GF5DSI6Z.js +1360 -0
- package/dist/chunk-GF5DSI6Z.js.map +1 -0
- package/dist/core.cjs +1371 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +49 -0
- package/dist/core.d.ts +49 -0
- package/dist/core.js +3 -0
- package/dist/core.js.map +1 -0
- package/dist/index.cjs +1492 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/presets.cjs +326 -0
- package/dist/presets.cjs.map +1 -0
- package/dist/presets.d.cts +28 -0
- package/dist/presets.d.ts +28 -0
- package/dist/presets.js +313 -0
- package/dist/presets.js.map +1 -0
- package/dist/types-qQT95c-N.d.cts +157 -0
- package/dist/types-qQT95c-N.d.ts +157 -0
- package/package.json +86 -0
package/dist/presets.js
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// src/presets/bloom.ts
|
|
2
|
+
var bloom = {
|
|
3
|
+
name: "Bloom",
|
|
4
|
+
version: 1,
|
|
5
|
+
effectParams: {
|
|
6
|
+
colors: ["#00e1ff", "#47ff6c", "#ff7161", "#dc83e2"],
|
|
7
|
+
speed: 0.85,
|
|
8
|
+
scale: 1.5,
|
|
9
|
+
bright: 0.75,
|
|
10
|
+
colorSpread: 0.4,
|
|
11
|
+
colorSkew: 0.3,
|
|
12
|
+
colorDrift: -0.34,
|
|
13
|
+
velocity: 2,
|
|
14
|
+
rampIn: 0.49,
|
|
15
|
+
rampOut: 0.49,
|
|
16
|
+
motion: 1
|
|
17
|
+
},
|
|
18
|
+
settings: {
|
|
19
|
+
frost: 0.78,
|
|
20
|
+
frostInset: 1,
|
|
21
|
+
coreBlur: 23,
|
|
22
|
+
saturate: 1.45,
|
|
23
|
+
innerBloom: { size: 3, level: 0.75 },
|
|
24
|
+
outerBloom: { level: 0.4 }
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/presets/halo.ts
|
|
29
|
+
var halo = {
|
|
30
|
+
name: "Halo",
|
|
31
|
+
version: 1,
|
|
32
|
+
effectParams: {
|
|
33
|
+
speed: -0.84,
|
|
34
|
+
scale: 1.55,
|
|
35
|
+
velocity: 0,
|
|
36
|
+
rampIn: 0.51,
|
|
37
|
+
rampOut: 0.51,
|
|
38
|
+
motion: 3
|
|
39
|
+
},
|
|
40
|
+
settings: {
|
|
41
|
+
frostInset: 2
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/presets/rush.ts
|
|
46
|
+
var rush = {
|
|
47
|
+
name: "Rush",
|
|
48
|
+
version: 1,
|
|
49
|
+
effectParams: {
|
|
50
|
+
colors: ["#ff7ad9", "#7afcff", "#c9a7ff", "#aaffa3"],
|
|
51
|
+
speed: 0.95,
|
|
52
|
+
scale: 1.2,
|
|
53
|
+
bright: 1.1,
|
|
54
|
+
colorSpread: 0.3,
|
|
55
|
+
velocity: 2,
|
|
56
|
+
rampIn: 0.63,
|
|
57
|
+
rampOut: 0.61,
|
|
58
|
+
interval: 0.54
|
|
59
|
+
},
|
|
60
|
+
settings: {
|
|
61
|
+
bgBlur: 0,
|
|
62
|
+
frost: 0.84,
|
|
63
|
+
frostInset: 1.5,
|
|
64
|
+
coreBlur: 16,
|
|
65
|
+
innerBloom: { level: 0.55 },
|
|
66
|
+
outerBloom: { size: 24, level: 0.2 }
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/presets/comet.ts
|
|
71
|
+
var comet = {
|
|
72
|
+
name: "Comet",
|
|
73
|
+
version: 1,
|
|
74
|
+
effectParams: {
|
|
75
|
+
speed: 1.67,
|
|
76
|
+
scale: 1.4,
|
|
77
|
+
bright: 2,
|
|
78
|
+
colorSpread: 1.7,
|
|
79
|
+
colorSkew: 0.8,
|
|
80
|
+
colorDrift: 0.28,
|
|
81
|
+
velocity: 0,
|
|
82
|
+
rampIn: 0.99,
|
|
83
|
+
rampOut: 0.5,
|
|
84
|
+
interval: 0.86,
|
|
85
|
+
motion: 3
|
|
86
|
+
},
|
|
87
|
+
settings: {
|
|
88
|
+
bgBlur: 20,
|
|
89
|
+
frostInset: 2,
|
|
90
|
+
coreOpacity: 0.92,
|
|
91
|
+
saturate: 2,
|
|
92
|
+
innerBloom: { size: 4 },
|
|
93
|
+
outerBloom: { size: 24 }
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/presets/cinder.ts
|
|
98
|
+
var cinder = {
|
|
99
|
+
name: "Cinder",
|
|
100
|
+
version: 1,
|
|
101
|
+
effectParams: {
|
|
102
|
+
colors: ["#ff3d00", "#ff8a00", "#ffc400"],
|
|
103
|
+
speed: 1.19,
|
|
104
|
+
scale: 1.4,
|
|
105
|
+
bright: 0.95,
|
|
106
|
+
colorSpread: 1,
|
|
107
|
+
colorSkew: 0.1,
|
|
108
|
+
rampIn: 0.5,
|
|
109
|
+
rampOut: 0.85,
|
|
110
|
+
interval: 0.64,
|
|
111
|
+
angle: 90
|
|
112
|
+
},
|
|
113
|
+
settings: {
|
|
114
|
+
frostInset: 2,
|
|
115
|
+
saturate: 1.4,
|
|
116
|
+
innerBloom: { size: 4 },
|
|
117
|
+
outerBloom: { size: 24, level: 0.4 }
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// src/presets/plasma.ts
|
|
122
|
+
var plasma = {
|
|
123
|
+
name: "Plasma",
|
|
124
|
+
version: 1,
|
|
125
|
+
effectParams: {
|
|
126
|
+
colors: ["#808eff", "#ff3d3d"],
|
|
127
|
+
speed: 0.41,
|
|
128
|
+
scale: 1.85,
|
|
129
|
+
bright: 1.1,
|
|
130
|
+
colorSpread: 1.1,
|
|
131
|
+
colorDrift: -0.36,
|
|
132
|
+
velocity: 2,
|
|
133
|
+
rampIn: 0.5,
|
|
134
|
+
rampOut: 0.85,
|
|
135
|
+
interval: 0,
|
|
136
|
+
angle: 79,
|
|
137
|
+
motion: 1
|
|
138
|
+
},
|
|
139
|
+
settings: {
|
|
140
|
+
bgBlur: 20,
|
|
141
|
+
frost: 0.3,
|
|
142
|
+
frostInset: 1.5,
|
|
143
|
+
coreInset: 0,
|
|
144
|
+
coreBlur: 12,
|
|
145
|
+
saturate: 1.4,
|
|
146
|
+
innerBloom: { size: 4, level: 0.75 },
|
|
147
|
+
outerBloom: { size: 22, level: 0.4 }
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// src/presets/kaleido.ts
|
|
152
|
+
var kaleido = {
|
|
153
|
+
name: "Kaleido",
|
|
154
|
+
version: 1,
|
|
155
|
+
effectParams: {
|
|
156
|
+
colors: ["#70ff94", "#8044ca", "#57aeff", "#ff6666", "#aeaf55"],
|
|
157
|
+
speed: -0.42,
|
|
158
|
+
scale: 2.1,
|
|
159
|
+
bright: 1.1,
|
|
160
|
+
colorSpread: 0.7,
|
|
161
|
+
colorSkew: 0.4,
|
|
162
|
+
colorDrift: 0.22,
|
|
163
|
+
velocity: 0,
|
|
164
|
+
rampIn: 0.59,
|
|
165
|
+
rampOut: 0.55,
|
|
166
|
+
interval: 0,
|
|
167
|
+
motion: 3
|
|
168
|
+
},
|
|
169
|
+
settings: {
|
|
170
|
+
bgBlur: 16,
|
|
171
|
+
frost: 0.6,
|
|
172
|
+
frostInset: 1,
|
|
173
|
+
coreInset: 4,
|
|
174
|
+
saturate: 1.4,
|
|
175
|
+
innerBloom: { level: 0.7 },
|
|
176
|
+
outerBloom: { size: 24, level: 0.3 }
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// src/presets/nimbus.ts
|
|
181
|
+
var nimbus = {
|
|
182
|
+
name: "Nimbus",
|
|
183
|
+
version: 1,
|
|
184
|
+
effectParams: {
|
|
185
|
+
colors: ["#000000", "#ffffff"],
|
|
186
|
+
speed: 0.1,
|
|
187
|
+
scale: 4,
|
|
188
|
+
colorSpread: 3.7,
|
|
189
|
+
colorSkew: 2.4,
|
|
190
|
+
colorDrift: 0.57,
|
|
191
|
+
velocity: 0,
|
|
192
|
+
rampIn: 0.9,
|
|
193
|
+
rampOut: 0.9,
|
|
194
|
+
interval: 0,
|
|
195
|
+
motion: 3
|
|
196
|
+
},
|
|
197
|
+
settings: {
|
|
198
|
+
bgBlur: 12,
|
|
199
|
+
frost: 0.5,
|
|
200
|
+
frostInset: 2,
|
|
201
|
+
coreBlur: 16,
|
|
202
|
+
innerBloom: { size: 4 },
|
|
203
|
+
outerBloom: { size: 8, level: 0.5 }
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/presets/emerald.ts
|
|
208
|
+
var emerald = {
|
|
209
|
+
name: "Emerald",
|
|
210
|
+
version: 1,
|
|
211
|
+
effectParams: {
|
|
212
|
+
colors: ["#1f7a2e", "#36ce4f", "#85ff99"],
|
|
213
|
+
speed: 0.5,
|
|
214
|
+
scale: 0.75,
|
|
215
|
+
colorSpread: 3.5,
|
|
216
|
+
colorSkew: 3,
|
|
217
|
+
colorDrift: -0.23,
|
|
218
|
+
velocity: 0,
|
|
219
|
+
rampIn: 0.47,
|
|
220
|
+
rampOut: 0.47,
|
|
221
|
+
interval: 0,
|
|
222
|
+
motion: 1
|
|
223
|
+
},
|
|
224
|
+
settings: {
|
|
225
|
+
bgBlur: 12,
|
|
226
|
+
frost: 0.84,
|
|
227
|
+
frostInset: 2.5,
|
|
228
|
+
shaderInset: 1,
|
|
229
|
+
coreInset: 24,
|
|
230
|
+
coreBlur: 16,
|
|
231
|
+
innerBloom: { size: 4, level: 0 },
|
|
232
|
+
outerBloom: { level: 0.5 }
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/presets/glow.ts
|
|
237
|
+
var glow = {
|
|
238
|
+
name: "Glow",
|
|
239
|
+
version: 1,
|
|
240
|
+
effectParams: {
|
|
241
|
+
colors: ["#ff2d9b", "#e1ff00", "#00bbff"],
|
|
242
|
+
speed: 0.16,
|
|
243
|
+
scale: 0.1,
|
|
244
|
+
colorSpread: 1.2,
|
|
245
|
+
colorSkew: 0.3,
|
|
246
|
+
colorDrift: 0.47,
|
|
247
|
+
rampIn: 0.77,
|
|
248
|
+
rampOut: 0.39,
|
|
249
|
+
interval: 0,
|
|
250
|
+
motion: 3
|
|
251
|
+
},
|
|
252
|
+
settings: {
|
|
253
|
+
bgBlur: 12,
|
|
254
|
+
frost: 0.56,
|
|
255
|
+
frostInset: 1,
|
|
256
|
+
coreInset: 0,
|
|
257
|
+
coreBlur: 16,
|
|
258
|
+
coreOpacity: 0.8,
|
|
259
|
+
saturate: 1,
|
|
260
|
+
innerBloom: { size: 3, level: 0.85 },
|
|
261
|
+
outerBloom: { size: 24, level: 0.3 }
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// src/presets/tide.ts
|
|
266
|
+
var tide = {
|
|
267
|
+
name: "Tide",
|
|
268
|
+
version: 1,
|
|
269
|
+
effectParams: {
|
|
270
|
+
colors: ["#fda163", "#7eddd2", "#dbfd5d"],
|
|
271
|
+
speed: -0.84,
|
|
272
|
+
scale: 1.7,
|
|
273
|
+
bright: 0.85,
|
|
274
|
+
colorSpread: 0.5,
|
|
275
|
+
colorSkew: 0.2,
|
|
276
|
+
colorDrift: -0.13,
|
|
277
|
+
velocity: 3,
|
|
278
|
+
rampIn: 0.21,
|
|
279
|
+
rampOut: 0.45,
|
|
280
|
+
motion: 1
|
|
281
|
+
},
|
|
282
|
+
settings: {
|
|
283
|
+
bgBlur: 20,
|
|
284
|
+
frost: 0.9,
|
|
285
|
+
frostInset: 3,
|
|
286
|
+
shaderInset: 2,
|
|
287
|
+
coreInset: 0,
|
|
288
|
+
coreBlur: 0,
|
|
289
|
+
coreOpacity: 0.5,
|
|
290
|
+
saturate: 2,
|
|
291
|
+
innerBloom: { level: 0.8 },
|
|
292
|
+
outerBloom: { size: 12, level: 0.3 }
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// src/presets/index.ts
|
|
297
|
+
var LIBRARY_PRESETS = [
|
|
298
|
+
bloom,
|
|
299
|
+
halo,
|
|
300
|
+
rush,
|
|
301
|
+
comet,
|
|
302
|
+
cinder,
|
|
303
|
+
plasma,
|
|
304
|
+
kaleido,
|
|
305
|
+
nimbus,
|
|
306
|
+
emerald,
|
|
307
|
+
glow,
|
|
308
|
+
tide
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
export { LIBRARY_PRESETS, bloom, cinder, comet, emerald, glow, halo, kaleido, nimbus, plasma, rush, tide };
|
|
312
|
+
//# sourceMappingURL=presets.js.map
|
|
313
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/presets/bloom.ts","../src/presets/halo.ts","../src/presets/rush.ts","../src/presets/comet.ts","../src/presets/cinder.ts","../src/presets/plasma.ts","../src/presets/kaleido.ts","../src/presets/nimbus.ts","../src/presets/emerald.ts","../src/presets/glow.ts","../src/presets/tide.ts","../src/presets/index.ts"],"names":[],"mappings":";AAGO,IAAM,KAAA,GAAqB;AAAA,EAChC,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,CAAC,SAAA,EAAW,SAAA,EAAW,WAAW,SAAS,CAAA;AAAA,IACnD,KAAA,EAAO,IAAA;AAAA,IACP,KAAA,EAAO,GAAA;AAAA,IACP,MAAA,EAAQ,IAAA;AAAA,IACR,WAAA,EAAa,GAAA;AAAA,IACb,SAAA,EAAW,GAAA;AAAA,IACX,UAAA,EAAY,KAAA;AAAA,IACZ,QAAA,EAAU,CAAA;AAAA,IACV,MAAA,EAAQ,IAAA;AAAA,IACR,OAAA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ACb,SAAA,EAAW,CAAA;AAAA,IACX,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,GAAA;AAAA,IACb,QAAA,EAAU,CAAA;AAAA,IACV,UAAA,EAAY,EAAE,KAAA,EAAO,GAAA,EAAI;AAAA,IACzB,UAAA,EAAY,EAAE,IAAA,EAAM,EAAA,EAAI,OAAO,GAAA;AAAI;AAEvC;;;ACQO,IAAM,eAAA,GAAiC;AAAA,EAC5C,KAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF","file":"presets.js","sourcesContent":["import type { GlassPreset } from '../types';\n\n// Cyan, acid green, and coral light blooming outward from the center.\nexport const bloom: GlassPreset = {\n name: 'Bloom',\n version: 1,\n effectParams: {\n colors: ['#00e1ff', '#47ff6c', '#ff7161', '#dc83e2'],\n speed: 0.85,\n scale: 1.5,\n bright: 0.75,\n colorSpread: 0.4,\n colorSkew: 0.3,\n colorDrift: -0.34,\n velocity: 2,\n rampIn: 0.49,\n rampOut: 0.49,\n motion: 1,\n },\n settings: {\n frost: 0.78,\n frostInset: 1,\n coreBlur: 23,\n saturate: 1.45,\n innerBloom: { size: 3, level: 0.75 },\n outerBloom: { level: 0.4 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// A broad halo rotating in reverse around a crisp exposed rim.\nexport const halo: GlassPreset = {\n name: 'Halo',\n version: 1,\n effectParams: {\n speed: -0.84,\n scale: 1.55,\n velocity: 0,\n rampIn: 0.51,\n rampOut: 0.51,\n motion: 3,\n },\n settings: {\n frostInset: 2,\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Fast pastel ribbons in pink, cyan, lavender, and mint.\nexport const rush: GlassPreset = {\n name: 'Rush',\n version: 1,\n effectParams: {\n colors: ['#ff7ad9', '#7afcff', '#c9a7ff', '#aaffa3'],\n speed: 0.95,\n scale: 1.2,\n bright: 1.1,\n colorSpread: 0.3,\n velocity: 2,\n rampIn: 0.63,\n rampOut: 0.61,\n interval: 0.54,\n },\n settings: {\n bgBlur: 0,\n frost: 0.84,\n frostInset: 1.5,\n coreBlur: 16,\n innerBloom: { level: 0.55 },\n outerBloom: { size: 24, level: 0.2 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// A fast, narrow orbiting glint softened by a deep background blur.\nexport const comet: GlassPreset = {\n name: 'Comet',\n version: 1,\n effectParams: {\n speed: 1.67,\n scale: 1.4,\n bright: 2,\n colorSpread: 1.7,\n colorSkew: 0.8,\n colorDrift: 0.28,\n velocity: 0,\n rampIn: 0.99,\n rampOut: 0.5,\n interval: 0.86,\n motion: 3,\n },\n settings: {\n bgBlur: 20,\n frostInset: 2,\n coreOpacity: 0.92,\n saturate: 2,\n innerBloom: { size: 4 },\n outerBloom: { size: 24 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Vertical orange and gold flames with a long, hot trailing glow.\nexport const cinder: GlassPreset = {\n name: 'Cinder',\n version: 1,\n effectParams: {\n colors: ['#ff3d00', '#ff8a00', '#ffc400'],\n speed: 1.19,\n scale: 1.4,\n bright: 0.95,\n colorSpread: 1,\n colorSkew: 0.1,\n rampIn: 0.5,\n rampOut: 0.85,\n interval: 0.64,\n angle: 90,\n },\n settings: {\n frostInset: 2,\n saturate: 1.4,\n innerBloom: { size: 4 },\n outerBloom: { size: 24, level: 0.4 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Periwinkle and red waves splitting outward through translucent glass.\nexport const plasma: GlassPreset = {\n name: 'Plasma',\n version: 1,\n effectParams: {\n colors: ['#808eff', '#ff3d3d'],\n speed: 0.41,\n scale: 1.85,\n bright: 1.1,\n colorSpread: 1.1,\n colorDrift: -0.36,\n velocity: 2,\n rampIn: 0.5,\n rampOut: 0.85,\n interval: 0,\n angle: 79,\n motion: 1,\n },\n settings: {\n bgBlur: 20,\n frost: 0.3,\n frostInset: 1.5,\n coreInset: 0,\n coreBlur: 12,\n saturate: 1.4,\n innerBloom: { size: 4, level: 0.75 },\n outerBloom: { size: 22, level: 0.4 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// A rotating five-color field with continuously shifting spokes.\nexport const kaleido: GlassPreset = {\n name: 'Kaleido',\n version: 1,\n effectParams: {\n colors: ['#70ff94', '#8044ca', '#57aeff', '#ff6666', '#aeaf55'],\n speed: -0.42,\n scale: 2.1,\n bright: 1.1,\n colorSpread: 0.7,\n colorSkew: 0.4,\n colorDrift: 0.22,\n velocity: 0,\n rampIn: 0.59,\n rampOut: 0.55,\n interval: 0,\n motion: 3,\n },\n settings: {\n bgBlur: 16,\n frost: 0.6,\n frostInset: 1,\n coreInset: 4,\n saturate: 1.4,\n innerBloom: { level: 0.7 },\n outerBloom: { size: 24, level: 0.3 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// High-contrast black and white spokes folding into a liquid moire.\nexport const nimbus: GlassPreset = {\n name: 'Nimbus',\n version: 1,\n effectParams: {\n colors: ['#000000', '#ffffff'],\n speed: 0.1,\n scale: 4,\n colorSpread: 3.7,\n colorSkew: 2.4,\n colorDrift: 0.57,\n velocity: 0,\n rampIn: 0.9,\n rampOut: 0.9,\n interval: 0,\n motion: 3,\n },\n settings: {\n bgBlur: 12,\n frost: 0.5,\n frostInset: 2,\n coreBlur: 16,\n innerBloom: { size: 4 },\n outerBloom: { size: 8, level: 0.5 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Layered emerald light breathing from the center beneath a deep frosted core.\nexport const emerald: GlassPreset = {\n name: 'Emerald',\n version: 1,\n effectParams: {\n colors: ['#1f7a2e', '#36ce4f', '#85ff99'],\n speed: 0.5,\n scale: 0.75,\n colorSpread: 3.5,\n colorSkew: 3,\n colorDrift: -0.23,\n velocity: 0,\n rampIn: 0.47,\n rampOut: 0.47,\n interval: 0,\n motion: 1,\n },\n settings: {\n bgBlur: 12,\n frost: 0.84,\n frostInset: 2.5,\n shaderInset: 1,\n coreInset: 24,\n coreBlur: 16,\n innerBloom: { size: 4, level: 0 },\n outerBloom: { level: 0.5 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Slow neon spokes drifting beneath a dark, translucent glass surface.\nexport const glow: GlassPreset = {\n name: 'Glow',\n version: 1,\n effectParams: {\n colors: ['#ff2d9b', '#e1ff00', '#00bbff'],\n speed: 0.16,\n scale: 0.1,\n colorSpread: 1.2,\n colorSkew: 0.3,\n colorDrift: 0.47,\n rampIn: 0.77,\n rampOut: 0.39,\n interval: 0,\n motion: 3,\n },\n settings: {\n bgBlur: 12,\n frost: 0.56,\n frostInset: 1,\n coreInset: 0,\n coreBlur: 16,\n coreOpacity: 0.8,\n saturate: 1,\n innerBloom: { size: 3, level: 0.85 },\n outerBloom: { size: 24, level: 0.3 },\n },\n};\n","import type { GlassPreset } from '../types';\n\n// Peach, aqua, and acid-lime light flowing inward beneath a saturated veil.\nexport const tide: GlassPreset = {\n name: 'Tide',\n version: 1,\n effectParams: {\n colors: ['#fda163', '#7eddd2', '#dbfd5d'],\n speed: -0.84,\n scale: 1.7,\n bright: 0.85,\n colorSpread: 0.5,\n colorSkew: 0.2,\n colorDrift: -0.13,\n velocity: 3,\n rampIn: 0.21,\n rampOut: 0.45,\n motion: 1,\n },\n settings: {\n bgBlur: 20,\n frost: 0.9,\n frostInset: 3,\n shaderInset: 2,\n coreInset: 0,\n coreBlur: 0,\n coreOpacity: 0.5,\n saturate: 2,\n innerBloom: { level: 0.8 },\n outerBloom: { size: 12, level: 0.3 },\n },\n};\n","// Library presets: shareable looks (shader + params + glass material). One preset = one\n// look — it applies identically in dark and light mode; anything it doesn't pin adapts\n// to the theme defaults. A preset never carries component styling (fill / border).\n//\n// import { GlassFx } from 'glass-pulse-fx';\n// import { bloom } from 'glass-pulse-fx/presets';\n// <GlassFx preset={bloom}>…</GlassFx>\n//\n// Vanilla: createGlass(el, { preset: bloom })\n\nimport type { GlassPreset } from '../types';\nimport { bloom } from './bloom';\nimport { halo } from './halo';\nimport { rush } from './rush';\nimport { comet } from './comet';\nimport { cinder } from './cinder';\nimport { plasma } from './plasma';\nimport { kaleido } from './kaleido';\nimport { nimbus } from './nimbus';\nimport { emerald } from './emerald';\nimport { glow } from './glow';\nimport { tide } from './tide';\n\nexport {\n bloom,\n halo,\n rush,\n comet,\n cinder,\n plasma,\n kaleido,\n nimbus,\n emerald,\n glow,\n tide,\n};\nexport type { GlassPreset };\n\n/** Every library preset, in display order — for galleries and the preset lab. */\nexport const LIBRARY_PRESETS: GlassPreset[] = [\n bloom,\n halo,\n rush,\n comet,\n cinder,\n plasma,\n kaleido,\n nimbus,\n emerald,\n glow,\n tide,\n];\n"]}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
type Theme = 'dark' | 'light';
|
|
2
|
+
type FpsMode = 15 | 30 | 60;
|
|
3
|
+
/** Which base shader drives the lit material. Original shaders — no attribution needed. */
|
|
4
|
+
type EffectId = 'panes';
|
|
5
|
+
/** Shape presets — drive the crop scale and default corner radius. */
|
|
6
|
+
type Kind = 'pill' | 'circle' | 'rect' | 'tag' | 'card' | 'icon';
|
|
7
|
+
interface BloomConfig {
|
|
8
|
+
/** blur radius in px */
|
|
9
|
+
size: number;
|
|
10
|
+
/** opacity 0..1 */
|
|
11
|
+
level: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The glass material configuration — the preset-able "look of the light".
|
|
15
|
+
* Component styling (`fill`, `border`, `radius`) is intentionally NOT here: those belong
|
|
16
|
+
* to the component you wrap, not to a shareable preset.
|
|
17
|
+
*/
|
|
18
|
+
interface GlassSettings {
|
|
19
|
+
bgBlur: number;
|
|
20
|
+
frost: number;
|
|
21
|
+
/** frost veil inset from the edge in px — exposes a raw, un-veiled shader rim inside the silhouette */
|
|
22
|
+
frostInset: number;
|
|
23
|
+
/** shader source inset from the edge in px — pulls the animated light inward */
|
|
24
|
+
shaderInset: number;
|
|
25
|
+
coreInset: number;
|
|
26
|
+
coreBlur: number;
|
|
27
|
+
/** opaque-core opacity, 0..1 (1 = fully hides the shader in the center) */
|
|
28
|
+
coreOpacity: number;
|
|
29
|
+
/** scale coreInset + coreBlur with the element size instead of using fixed px */
|
|
30
|
+
coreProportional: boolean;
|
|
31
|
+
saturate: number;
|
|
32
|
+
innerBloom: BloomConfig;
|
|
33
|
+
outerBloom: BloomConfig;
|
|
34
|
+
}
|
|
35
|
+
/** Theme-adaptive settings override; nested bloom values may be patched independently. */
|
|
36
|
+
type GlassSettingsPatch = Omit<Partial<GlassSettings>, 'innerBloom' | 'outerBloom'> & {
|
|
37
|
+
innerBloom?: Partial<BloomConfig>;
|
|
38
|
+
outerBloom?: Partial<BloomConfig>;
|
|
39
|
+
};
|
|
40
|
+
/** The lit rim border — component styling, like `fill`; not part of GlassSettings/presets. */
|
|
41
|
+
interface BorderConfig {
|
|
42
|
+
width: number;
|
|
43
|
+
/** 0..1 */
|
|
44
|
+
opacity: number;
|
|
45
|
+
color: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parameters for the base shaders. Adding a shader = adding any new fields here + an
|
|
49
|
+
* EffectDef in src/engine/effects/.
|
|
50
|
+
*/
|
|
51
|
+
interface EffectParams {
|
|
52
|
+
/** 1–5 palette stops (hex) — the colour gradient cycles through all of them */
|
|
53
|
+
colors: string[];
|
|
54
|
+
/** colour gradient cycles along the motion axis (within/across a band) */
|
|
55
|
+
colorSpread: number;
|
|
56
|
+
/** colour gradient cycles across the perpendicular axis (the mesh dimension) */
|
|
57
|
+
colorSkew: number;
|
|
58
|
+
/** colour field drift over time */
|
|
59
|
+
colorDrift: number;
|
|
60
|
+
/** scroll speed; sign sets direction (left↔right linear, or out↔in for center motion) */
|
|
61
|
+
speed: number;
|
|
62
|
+
/** band density — how many bands span the element */
|
|
63
|
+
scale: number;
|
|
64
|
+
/** leading fade of each band, fraction of the band width */
|
|
65
|
+
rampIn: number;
|
|
66
|
+
/** trailing fade of each band, fraction of the band width */
|
|
67
|
+
rampOut: number;
|
|
68
|
+
/** transparent interval between bands (glass shows through), fraction of each pane+gap cycle */
|
|
69
|
+
interval: number;
|
|
70
|
+
/** overall brightness multiplier */
|
|
71
|
+
bright: number;
|
|
72
|
+
/** velocity preset index — how band speed varies across the axis (see VELOCITY_PRESETS) */
|
|
73
|
+
velocity: number;
|
|
74
|
+
/** band direction in degrees */
|
|
75
|
+
angle: number;
|
|
76
|
+
/** motion mode: 0 = linear sweep, 1 = center (mirrored), 2 = radial (rings), 3 = orbit (spokes) */
|
|
77
|
+
motion: number;
|
|
78
|
+
}
|
|
79
|
+
/** A single tunable in the demo's effect panel. */
|
|
80
|
+
interface SliderControl {
|
|
81
|
+
kind: 'slider';
|
|
82
|
+
key: keyof EffectParams;
|
|
83
|
+
label: string;
|
|
84
|
+
min: number;
|
|
85
|
+
max: number;
|
|
86
|
+
step: number;
|
|
87
|
+
unit?: string;
|
|
88
|
+
}
|
|
89
|
+
interface ColorsControl {
|
|
90
|
+
kind: 'colors';
|
|
91
|
+
label: string;
|
|
92
|
+
}
|
|
93
|
+
interface SelectControl {
|
|
94
|
+
kind: 'select';
|
|
95
|
+
key: keyof EffectParams;
|
|
96
|
+
label: string;
|
|
97
|
+
options: {
|
|
98
|
+
label: string;
|
|
99
|
+
value: number;
|
|
100
|
+
}[];
|
|
101
|
+
}
|
|
102
|
+
type ControlSpec = SliderControl | ColorsControl | SelectControl;
|
|
103
|
+
interface CreateGlassOptions {
|
|
104
|
+
/** a shareable look, applied beneath the explicit options below (they win on conflict) */
|
|
105
|
+
preset?: GlassPreset;
|
|
106
|
+
effect?: EffectId;
|
|
107
|
+
effectParams?: Partial<EffectParams>;
|
|
108
|
+
theme?: Theme;
|
|
109
|
+
/** surface color; defaults per theme. Hex recommended. */
|
|
110
|
+
fill?: string;
|
|
111
|
+
/** lit rim border overrides; defaults per theme */
|
|
112
|
+
border?: Partial<BorderConfig>;
|
|
113
|
+
/** border-radius override; number = px, '50%', '16px', etc. */
|
|
114
|
+
radius?: number | string;
|
|
115
|
+
kind?: Kind;
|
|
116
|
+
/** animation paint rate. default 30. */
|
|
117
|
+
fps?: FpsMode;
|
|
118
|
+
paused?: boolean;
|
|
119
|
+
/** merged onto the active theme's defaults */
|
|
120
|
+
settings?: GlassSettingsPatch;
|
|
121
|
+
/** clip the inner/outer bloom to the component's rounded box (no outward spill).
|
|
122
|
+
* default false — blooms overflow the element. */
|
|
123
|
+
bloomClip?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A shareable look: shader + params + glass material. One preset = one look — it applies
|
|
127
|
+
* identically in dark and light mode, while anything it does NOT pin still adapts to the
|
|
128
|
+
* theme defaults. Sites with a theme switch that want different looks per mode simply
|
|
129
|
+
* pass a different preset per mode.
|
|
130
|
+
* Deliberately excludes component styling (fill / border / radius / kind).
|
|
131
|
+
* Usage (vanilla): `createGlass(el, { preset })`
|
|
132
|
+
* Usage (React): `<GlassFx preset={preset} />`
|
|
133
|
+
*/
|
|
134
|
+
interface GlassPreset {
|
|
135
|
+
name: string;
|
|
136
|
+
/** preset schema version */
|
|
137
|
+
version: 1;
|
|
138
|
+
effect?: EffectId;
|
|
139
|
+
effectParams?: Partial<EffectParams>;
|
|
140
|
+
settings?: GlassSettingsPatch;
|
|
141
|
+
}
|
|
142
|
+
interface GlassInstance {
|
|
143
|
+
update(patch: GlassSettingsPatch): void;
|
|
144
|
+
setEffect(id: EffectId): void;
|
|
145
|
+
setEffectParams(patch: Partial<EffectParams>): void;
|
|
146
|
+
/** loads this theme's glass-settings, border, and effect-param defaults (your explicit overrides are re-applied on top) */
|
|
147
|
+
setTheme(t: Theme): void;
|
|
148
|
+
setFill(color: string): void;
|
|
149
|
+
setBorder(patch: Partial<BorderConfig>): void;
|
|
150
|
+
setFps(fps: FpsMode): void;
|
|
151
|
+
setPaused(paused: boolean): void;
|
|
152
|
+
/** toggle clipping the bloom to the component's rounded box */
|
|
153
|
+
setBloomClip(clip: boolean): void;
|
|
154
|
+
destroy(): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type { BorderConfig as B, ColorsControl as C, EffectId as E, FpsMode as F, GlassPreset as G, Kind as K, SelectControl as S, Theme as T, EffectParams as a, GlassSettingsPatch as b, BloomConfig as c, ControlSpec as d, CreateGlassOptions as e, GlassInstance as f, GlassSettings as g, SliderControl as h };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
type Theme = 'dark' | 'light';
|
|
2
|
+
type FpsMode = 15 | 30 | 60;
|
|
3
|
+
/** Which base shader drives the lit material. Original shaders — no attribution needed. */
|
|
4
|
+
type EffectId = 'panes';
|
|
5
|
+
/** Shape presets — drive the crop scale and default corner radius. */
|
|
6
|
+
type Kind = 'pill' | 'circle' | 'rect' | 'tag' | 'card' | 'icon';
|
|
7
|
+
interface BloomConfig {
|
|
8
|
+
/** blur radius in px */
|
|
9
|
+
size: number;
|
|
10
|
+
/** opacity 0..1 */
|
|
11
|
+
level: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The glass material configuration — the preset-able "look of the light".
|
|
15
|
+
* Component styling (`fill`, `border`, `radius`) is intentionally NOT here: those belong
|
|
16
|
+
* to the component you wrap, not to a shareable preset.
|
|
17
|
+
*/
|
|
18
|
+
interface GlassSettings {
|
|
19
|
+
bgBlur: number;
|
|
20
|
+
frost: number;
|
|
21
|
+
/** frost veil inset from the edge in px — exposes a raw, un-veiled shader rim inside the silhouette */
|
|
22
|
+
frostInset: number;
|
|
23
|
+
/** shader source inset from the edge in px — pulls the animated light inward */
|
|
24
|
+
shaderInset: number;
|
|
25
|
+
coreInset: number;
|
|
26
|
+
coreBlur: number;
|
|
27
|
+
/** opaque-core opacity, 0..1 (1 = fully hides the shader in the center) */
|
|
28
|
+
coreOpacity: number;
|
|
29
|
+
/** scale coreInset + coreBlur with the element size instead of using fixed px */
|
|
30
|
+
coreProportional: boolean;
|
|
31
|
+
saturate: number;
|
|
32
|
+
innerBloom: BloomConfig;
|
|
33
|
+
outerBloom: BloomConfig;
|
|
34
|
+
}
|
|
35
|
+
/** Theme-adaptive settings override; nested bloom values may be patched independently. */
|
|
36
|
+
type GlassSettingsPatch = Omit<Partial<GlassSettings>, 'innerBloom' | 'outerBloom'> & {
|
|
37
|
+
innerBloom?: Partial<BloomConfig>;
|
|
38
|
+
outerBloom?: Partial<BloomConfig>;
|
|
39
|
+
};
|
|
40
|
+
/** The lit rim border — component styling, like `fill`; not part of GlassSettings/presets. */
|
|
41
|
+
interface BorderConfig {
|
|
42
|
+
width: number;
|
|
43
|
+
/** 0..1 */
|
|
44
|
+
opacity: number;
|
|
45
|
+
color: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parameters for the base shaders. Adding a shader = adding any new fields here + an
|
|
49
|
+
* EffectDef in src/engine/effects/.
|
|
50
|
+
*/
|
|
51
|
+
interface EffectParams {
|
|
52
|
+
/** 1–5 palette stops (hex) — the colour gradient cycles through all of them */
|
|
53
|
+
colors: string[];
|
|
54
|
+
/** colour gradient cycles along the motion axis (within/across a band) */
|
|
55
|
+
colorSpread: number;
|
|
56
|
+
/** colour gradient cycles across the perpendicular axis (the mesh dimension) */
|
|
57
|
+
colorSkew: number;
|
|
58
|
+
/** colour field drift over time */
|
|
59
|
+
colorDrift: number;
|
|
60
|
+
/** scroll speed; sign sets direction (left↔right linear, or out↔in for center motion) */
|
|
61
|
+
speed: number;
|
|
62
|
+
/** band density — how many bands span the element */
|
|
63
|
+
scale: number;
|
|
64
|
+
/** leading fade of each band, fraction of the band width */
|
|
65
|
+
rampIn: number;
|
|
66
|
+
/** trailing fade of each band, fraction of the band width */
|
|
67
|
+
rampOut: number;
|
|
68
|
+
/** transparent interval between bands (glass shows through), fraction of each pane+gap cycle */
|
|
69
|
+
interval: number;
|
|
70
|
+
/** overall brightness multiplier */
|
|
71
|
+
bright: number;
|
|
72
|
+
/** velocity preset index — how band speed varies across the axis (see VELOCITY_PRESETS) */
|
|
73
|
+
velocity: number;
|
|
74
|
+
/** band direction in degrees */
|
|
75
|
+
angle: number;
|
|
76
|
+
/** motion mode: 0 = linear sweep, 1 = center (mirrored), 2 = radial (rings), 3 = orbit (spokes) */
|
|
77
|
+
motion: number;
|
|
78
|
+
}
|
|
79
|
+
/** A single tunable in the demo's effect panel. */
|
|
80
|
+
interface SliderControl {
|
|
81
|
+
kind: 'slider';
|
|
82
|
+
key: keyof EffectParams;
|
|
83
|
+
label: string;
|
|
84
|
+
min: number;
|
|
85
|
+
max: number;
|
|
86
|
+
step: number;
|
|
87
|
+
unit?: string;
|
|
88
|
+
}
|
|
89
|
+
interface ColorsControl {
|
|
90
|
+
kind: 'colors';
|
|
91
|
+
label: string;
|
|
92
|
+
}
|
|
93
|
+
interface SelectControl {
|
|
94
|
+
kind: 'select';
|
|
95
|
+
key: keyof EffectParams;
|
|
96
|
+
label: string;
|
|
97
|
+
options: {
|
|
98
|
+
label: string;
|
|
99
|
+
value: number;
|
|
100
|
+
}[];
|
|
101
|
+
}
|
|
102
|
+
type ControlSpec = SliderControl | ColorsControl | SelectControl;
|
|
103
|
+
interface CreateGlassOptions {
|
|
104
|
+
/** a shareable look, applied beneath the explicit options below (they win on conflict) */
|
|
105
|
+
preset?: GlassPreset;
|
|
106
|
+
effect?: EffectId;
|
|
107
|
+
effectParams?: Partial<EffectParams>;
|
|
108
|
+
theme?: Theme;
|
|
109
|
+
/** surface color; defaults per theme. Hex recommended. */
|
|
110
|
+
fill?: string;
|
|
111
|
+
/** lit rim border overrides; defaults per theme */
|
|
112
|
+
border?: Partial<BorderConfig>;
|
|
113
|
+
/** border-radius override; number = px, '50%', '16px', etc. */
|
|
114
|
+
radius?: number | string;
|
|
115
|
+
kind?: Kind;
|
|
116
|
+
/** animation paint rate. default 30. */
|
|
117
|
+
fps?: FpsMode;
|
|
118
|
+
paused?: boolean;
|
|
119
|
+
/** merged onto the active theme's defaults */
|
|
120
|
+
settings?: GlassSettingsPatch;
|
|
121
|
+
/** clip the inner/outer bloom to the component's rounded box (no outward spill).
|
|
122
|
+
* default false — blooms overflow the element. */
|
|
123
|
+
bloomClip?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A shareable look: shader + params + glass material. One preset = one look — it applies
|
|
127
|
+
* identically in dark and light mode, while anything it does NOT pin still adapts to the
|
|
128
|
+
* theme defaults. Sites with a theme switch that want different looks per mode simply
|
|
129
|
+
* pass a different preset per mode.
|
|
130
|
+
* Deliberately excludes component styling (fill / border / radius / kind).
|
|
131
|
+
* Usage (vanilla): `createGlass(el, { preset })`
|
|
132
|
+
* Usage (React): `<GlassFx preset={preset} />`
|
|
133
|
+
*/
|
|
134
|
+
interface GlassPreset {
|
|
135
|
+
name: string;
|
|
136
|
+
/** preset schema version */
|
|
137
|
+
version: 1;
|
|
138
|
+
effect?: EffectId;
|
|
139
|
+
effectParams?: Partial<EffectParams>;
|
|
140
|
+
settings?: GlassSettingsPatch;
|
|
141
|
+
}
|
|
142
|
+
interface GlassInstance {
|
|
143
|
+
update(patch: GlassSettingsPatch): void;
|
|
144
|
+
setEffect(id: EffectId): void;
|
|
145
|
+
setEffectParams(patch: Partial<EffectParams>): void;
|
|
146
|
+
/** loads this theme's glass-settings, border, and effect-param defaults (your explicit overrides are re-applied on top) */
|
|
147
|
+
setTheme(t: Theme): void;
|
|
148
|
+
setFill(color: string): void;
|
|
149
|
+
setBorder(patch: Partial<BorderConfig>): void;
|
|
150
|
+
setFps(fps: FpsMode): void;
|
|
151
|
+
setPaused(paused: boolean): void;
|
|
152
|
+
/** toggle clipping the bloom to the component's rounded box */
|
|
153
|
+
setBloomClip(clip: boolean): void;
|
|
154
|
+
destroy(): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type { BorderConfig as B, ColorsControl as C, EffectId as E, FpsMode as F, GlassPreset as G, Kind as K, SelectControl as S, Theme as T, EffectParams as a, GlassSettingsPatch as b, BloomConfig as c, ControlSpec as d, CreateGlassOptions as e, GlassInstance as f, GlassSettings as g, SliderControl as h };
|