shaders 2.2.23 → 2.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/AngularBlur-Dl2gwk68.js +64 -0
- package/dist/core/Ascii-Dha_QpT3.js +286 -0
- package/dist/core/Beam-CTN9Ni43.js +139 -0
- package/dist/core/Blob-CxFDZovO.js +218 -0
- package/dist/core/Blur-Y2FsmFk_.js +77 -0
- package/dist/core/Bulge-Cb-t0xqI.js +132 -0
- package/dist/core/CRTScreen-CtERsenz.js +112 -0
- package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
- package/dist/core/Checkerboard-CgB-egNY.js +83 -0
- package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
- package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
- package/dist/core/Circle-Daziv5d7.js +67 -0
- package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
- package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
- package/dist/core/Dither-D2Nf4p3w.js +66 -0
- package/dist/core/DotGrid-CzOwquo4.js +75 -0
- package/dist/core/Duotone-XuTN9tI7.js +65 -0
- package/dist/core/FilmGrain-D3-nbi12.js +28 -0
- package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
- package/dist/core/GlassTiles-CnjCvajI.js +69 -0
- package/dist/core/Glow-BluFc9be.js +75 -0
- package/dist/core/Godrays-ChLh_vGl.js +144 -0
- package/dist/core/Grayscale-DRny75A9.js +20 -0
- package/dist/core/Grid-DgyDa4H1.js +58 -0
- package/dist/core/GridDistortion-BAspCYvp.js +188 -0
- package/dist/core/Group-Dul7PUBl.js +14 -0
- package/dist/core/Halftone-Ifv5F_FT.js +65 -0
- package/dist/core/HueShift-De8ukMWs.js +31 -0
- package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
- package/dist/core/Invert-Fz0NtIJc.js +21 -0
- package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
- package/dist/core/LinearGradient-xbloQjzt.js +133 -0
- package/dist/core/Liquify-DMe1V5-O.js +175 -0
- package/dist/core/Pixelate-Cv8537Pj.js +37 -0
- package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
- package/dist/core/Posterize-3m3xkWOz.js +29 -0
- package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
- package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
- package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
- package/dist/core/Ripples-8XaZaXQF.js +117 -0
- package/dist/core/Saturation-CYFI1jzN.js +30 -0
- package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
- package/dist/core/SineWave-Dl3nFO1W.js +120 -0
- package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
- package/dist/core/Spherize-C-jZEUsN.js +128 -0
- package/dist/core/Spiral-BSB_R39p.js +132 -0
- package/dist/core/Strands-0stO5BMy.js +161 -0
- package/dist/core/Stretch-B645paha.js +133 -0
- package/dist/core/Swirl-CVnbawit.js +173 -0
- package/dist/core/TiltShift-0CxNRI6L.js +134 -0
- package/dist/core/Tritone-Daa-I5UD.js +76 -0
- package/dist/core/Twirl-2CJVZEtk.js +96 -0
- package/dist/core/Vibrance-DRtecEvb.js +30 -0
- package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
- package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
- package/dist/core/colorMixing-BXiTAqJU.js +69 -0
- package/dist/core/edges-Bn_OIa_h.js +26 -0
- package/dist/core/index.js +2257 -1604
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -7
- package/dist/core/shaders/Ascii/index.js +2 -6
- package/dist/core/shaders/Beam/index.d.ts +71 -0
- package/dist/core/shaders/Beam/index.d.ts.map +1 -0
- package/dist/core/shaders/Beam/index.js +4 -0
- package/dist/core/shaders/Blob/index.js +5 -9
- package/dist/core/shaders/Blur/index.js +2 -6
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.js +2 -6
- package/dist/core/shaders/ChannelBlur/index.js +2 -6
- package/dist/core/shaders/Checkerboard/index.js +4 -8
- package/dist/core/shaders/ChromaFlow/index.js +3 -7
- package/dist/core/shaders/ChromaticAberration/index.js +3 -7
- package/dist/core/shaders/Circle/index.js +3 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -8
- package/dist/core/shaders/DiffuseBlur/index.js +4 -8
- package/dist/core/shaders/Dither/index.js +3 -7
- package/dist/core/shaders/DotGrid/index.js +3 -7
- package/dist/core/shaders/Duotone/index.js +4 -8
- package/dist/core/shaders/FilmGrain/index.js +2 -6
- package/dist/core/shaders/FloatingParticles/index.js +3 -7
- package/dist/core/shaders/GlassTiles/index.js +2 -6
- package/dist/core/shaders/Glow/index.js +2 -6
- package/dist/core/shaders/Godrays/index.js +3 -7
- package/dist/core/shaders/Grayscale/index.js +2 -8
- package/dist/core/shaders/Grid/index.js +3 -7
- package/dist/core/shaders/GridDistortion/index.js +4 -8
- package/dist/core/shaders/Group/index.js +2 -6
- package/dist/core/shaders/Halftone/index.js +3 -7
- package/dist/core/shaders/HueShift/index.js +2 -8
- package/dist/core/shaders/ImageTexture/index.js +2 -6
- package/dist/core/shaders/Invert/index.js +2 -6
- package/dist/core/shaders/LinearBlur/index.js +3 -7
- package/dist/core/shaders/LinearGradient/index.js +4 -8
- package/dist/core/shaders/Liquify/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.js +2 -6
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Posterize/index.js +2 -7
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
- package/dist/core/shaders/RadialGradient/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/Ripples/index.js +5 -9
- package/dist/core/shaders/Saturation/index.js +2 -8
- package/dist/core/shaders/SimplexNoise/index.js +5 -9
- package/dist/core/shaders/SineWave/index.js +3 -7
- package/dist/core/shaders/SolidColor/index.js +3 -7
- package/dist/core/shaders/Spherize/index.js +3 -7
- package/dist/core/shaders/Spiral/index.js +4 -8
- package/dist/core/shaders/Strands/index.js +4 -8
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +5 -9
- package/dist/core/shaders/TiltShift/index.js +3 -7
- package/dist/core/shaders/Tritone/index.js +4 -8
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/Vibrance/index.js +2 -8
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/ZoomBlur/index.js +3 -7
- package/dist/core/telemetry/index.js +189 -157
- package/dist/core/time-CTJvRUZ4.js +10 -0
- package/dist/core/transformations-DxfQXZWi.js +4715 -0
- package/dist/react/components/Beam.d.ts +31 -0
- package/dist/react/components/Beam.d.ts.map +1 -0
- package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +7649 -104600
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +2 -5
- package/dist/registry.js +224 -0
- package/dist/solid/components/Beam.d.ts +28 -0
- package/dist/solid/components/Beam.d.ts.map +1 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +6691 -102524
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +586 -537
- package/dist/svelte/components/Beam.svelte.d.ts +19 -0
- package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +6175 -102455
- package/dist/svelte/utils/generatePresetCode.js +2 -5
- package/dist/vue/components/Beam.vue.d.ts +57 -0
- package/dist/vue/components/Beam.vue.d.ts.map +1 -0
- package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +6929 -103492
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +2 -5
- package/package.json +12 -1
- package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
- package/dist/core/Ascii-BT0-K_vw.js +0 -196
- package/dist/core/Blob-BlQ_1T_8.js +0 -169
- package/dist/core/Blur-421AjWLH.js +0 -64
- package/dist/core/Bulge-CZRVoR6C.js +0 -103
- package/dist/core/CRTScreen-C_U9g_IR.js +0 -91
- package/dist/core/ChannelBlur-5pzcB6Zv.js +0 -89
- package/dist/core/Checkerboard-CrQkqXhD.js +0 -75
- package/dist/core/ChromaFlow-CNrQdL8f.js +0 -134
- package/dist/core/ChromaticAberration-D9H7O17Y.js +0 -82
- package/dist/core/Circle-DnLaDn8V.js +0 -62
- package/dist/core/ColorAdjustment-CKwpE_4M.js +0 -14
- package/dist/core/CursorTrail-NY6n97VG.js +0 -105
- package/dist/core/DiffuseBlur-C_n01ABk.js +0 -69
- package/dist/core/Dither-4s-c4zh4.js +0 -61
- package/dist/core/DotGrid-BYl8XdMi.js +0 -61
- package/dist/core/Duotone-DbewOoB4.js +0 -66
- package/dist/core/FilmGrain-zA_-knOw.js +0 -28
- package/dist/core/FloatingParticles-BhVnqMsE.js +0 -160
- package/dist/core/GlassTiles-CFI57glh.js +0 -52
- package/dist/core/Glow-CQgl3IoS.js +0 -66
- package/dist/core/Godrays-BHMix_Bh.js +0 -105
- package/dist/core/Grayscale-CAEFLteL.js +0 -21
- package/dist/core/Grid-DlM-rVbZ.js +0 -50
- package/dist/core/GridDistortion-ZOZphSAT.js +0 -147
- package/dist/core/Group-BQAs3RiH.js +0 -17
- package/dist/core/Halftone-ci4ga-_J.js +0 -55
- package/dist/core/HueShift-CyxzPcJV.js +0 -32
- package/dist/core/ImageTexture-CdAGsPuH.js +0 -105
- package/dist/core/Invert-iPsiIqNZ.js +0 -20
- package/dist/core/LinearBlur-BEaaoIk-.js +0 -56
- package/dist/core/LinearGradient-DR_7RxLX.js +0 -111
- package/dist/core/Liquify-Bi02_ugh.js +0 -139
- package/dist/core/Pixelate-CSsdT1rr.js +0 -38
- package/dist/core/PolarCoordinates-D626ml58.js +0 -103
- package/dist/core/Posterize-DhZkMaC7.js +0 -46
- package/dist/core/ProgressiveBlur-CGtCfLF8.js +0 -102
- package/dist/core/RadialGradient-C0_WzmbH.js +0 -71
- package/dist/core/RectangularCoordinates-DfXw7fhI.js +0 -92
- package/dist/core/Ripples-DkemN3eh.js +0 -106
- package/dist/core/Saturation-Dup81Pnq.js +0 -31
- package/dist/core/SimplexNoise-BYEiCjDj.js +0 -94
- package/dist/core/SineWave-C6MRPtsy.js +0 -107
- package/dist/core/SolidColor-BZHRczgb.js +0 -22
- package/dist/core/Spherize-DOAnDx2l.js +0 -103
- package/dist/core/Spiral-BMjnWXh1.js +0 -115
- package/dist/core/Strands-BOVsuJLe.js +0 -125
- package/dist/core/Stretch-D6bHc6yp.js +0 -103
- package/dist/core/Swirl-BFoc0ImG.js +0 -148
- package/dist/core/TSLBase-BFMvTOak.js +0 -8053
- package/dist/core/TiltShift-BiNvvhzj.js +0 -114
- package/dist/core/Tritone-gdx2AA0m.js +0 -75
- package/dist/core/Twirl-BsV8YbqC.js +0 -82
- package/dist/core/Vibrance-C182fbSw.js +0 -31
- package/dist/core/WaveDistortion-CmaS2zDB.js +0 -132
- package/dist/core/ZoomBlur-DLf5xQ16.js +0 -56
- package/dist/core/colorMixing--dhzx0ch.js +0 -21
- package/dist/core/edges-CDzKsauJ.js +0 -15
- package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
- package/dist/core/time-DbRMw6Jm.js +0 -10
- package/dist/core/transformations-CsrIJXh-.js +0 -3992
- package/dist/react/generatePresetCode-DaS7jkcT.js +0 -626
- package/dist/svelte/generatePresetCode-DaS7jkcT.js +0 -626
- package/dist/vue/generatePresetCode-Cd1B-Y9j.js +0 -632
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type BlendMode, type TransformConfig } from '../../core';
|
|
2
|
+
import { type ComponentProps } from '../../core/shaders/Beam';
|
|
3
|
+
/**
|
|
4
|
+
* Define component props including blend mode, opacity, visibility, masking, and transformation
|
|
5
|
+
*/
|
|
6
|
+
interface ExtendedComponentProps extends Partial<ComponentProps> {
|
|
7
|
+
blendMode?: BlendMode;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
maskSource?: string;
|
|
12
|
+
maskType?: string;
|
|
13
|
+
renderOrder?: number;
|
|
14
|
+
transform?: Partial<TransformConfig>;
|
|
15
|
+
children?: import('svelte').Snippet;
|
|
16
|
+
}
|
|
17
|
+
declare const Beam: import("svelte").Component<ExtendedComponentProps, {}, "">;
|
|
18
|
+
type Beam = ReturnType<typeof Beam>;
|
|
19
|
+
export default Beam;
|
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
var shaderMetadata = {
|
|
2
|
+
"AngularBlur": {
|
|
3
|
+
"opacity": 1,
|
|
4
|
+
"blendMode": "normal",
|
|
5
|
+
"intensity": 20,
|
|
6
|
+
"center": {
|
|
7
|
+
"x": .5,
|
|
8
|
+
"y": .5
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"Ascii": {
|
|
12
|
+
"opacity": 1,
|
|
13
|
+
"blendMode": "normal",
|
|
14
|
+
"characters": "@%#*+=-:.",
|
|
15
|
+
"cellSize": 30,
|
|
16
|
+
"fontFamily": "JetBrains Mono",
|
|
17
|
+
"spacing": 1
|
|
18
|
+
},
|
|
19
|
+
"Beam": {
|
|
20
|
+
"opacity": 1,
|
|
21
|
+
"blendMode": "normal",
|
|
22
|
+
"startPosition": {
|
|
23
|
+
"x": .2,
|
|
24
|
+
"y": .5
|
|
25
|
+
},
|
|
26
|
+
"endPosition": {
|
|
27
|
+
"x": .8,
|
|
28
|
+
"y": .5
|
|
29
|
+
},
|
|
30
|
+
"startThickness": .2,
|
|
31
|
+
"endThickness": .2,
|
|
32
|
+
"startSoftness": .5,
|
|
33
|
+
"endSoftness": .5,
|
|
34
|
+
"insideColor": "#FF0000",
|
|
35
|
+
"outsideColor": "#0000FF",
|
|
36
|
+
"colorSpace": "linear"
|
|
37
|
+
},
|
|
38
|
+
"Blob": {
|
|
39
|
+
"opacity": 1,
|
|
40
|
+
"blendMode": "normal",
|
|
41
|
+
"colorA": "#ff6b35",
|
|
42
|
+
"colorB": "#e91e63",
|
|
43
|
+
"size": .5,
|
|
44
|
+
"deformation": .5,
|
|
45
|
+
"softness": .5,
|
|
46
|
+
"highlightIntensity": .5,
|
|
47
|
+
"highlightX": .3,
|
|
48
|
+
"highlightY": -.3,
|
|
49
|
+
"highlightZ": .4,
|
|
50
|
+
"highlightColor": "#ffe11a",
|
|
51
|
+
"speed": .5,
|
|
52
|
+
"seed": 1,
|
|
53
|
+
"center": {
|
|
54
|
+
"x": .5,
|
|
55
|
+
"y": .5
|
|
56
|
+
},
|
|
57
|
+
"colorSpace": "linear"
|
|
58
|
+
},
|
|
59
|
+
"Blur": {
|
|
60
|
+
"opacity": 1,
|
|
61
|
+
"blendMode": "normal",
|
|
62
|
+
"intensity": 50
|
|
63
|
+
},
|
|
64
|
+
"Bulge": {
|
|
65
|
+
"opacity": 1,
|
|
66
|
+
"blendMode": "normal",
|
|
67
|
+
"center": {
|
|
68
|
+
"x": .5,
|
|
69
|
+
"y": .5
|
|
70
|
+
},
|
|
71
|
+
"strength": 1,
|
|
72
|
+
"radius": 1,
|
|
73
|
+
"falloff": .5,
|
|
74
|
+
"edges": "stretch"
|
|
75
|
+
},
|
|
76
|
+
"ChannelBlur": {
|
|
77
|
+
"opacity": 1,
|
|
78
|
+
"blendMode": "normal",
|
|
79
|
+
"redIntensity": 0,
|
|
80
|
+
"greenIntensity": 20,
|
|
81
|
+
"blueIntensity": 40
|
|
82
|
+
},
|
|
83
|
+
"Checkerboard": {
|
|
84
|
+
"opacity": 1,
|
|
85
|
+
"blendMode": "normal",
|
|
86
|
+
"colorA": "#cccccc",
|
|
87
|
+
"colorB": "#999999",
|
|
88
|
+
"cells": 8,
|
|
89
|
+
"softness": 0,
|
|
90
|
+
"colorSpace": "linear"
|
|
91
|
+
},
|
|
92
|
+
"ChromaFlow": {
|
|
93
|
+
"opacity": 1,
|
|
94
|
+
"blendMode": "normal",
|
|
95
|
+
"baseColor": "#0066ff",
|
|
96
|
+
"upColor": "#00ff00",
|
|
97
|
+
"downColor": "#ff0000",
|
|
98
|
+
"leftColor": "#0000ff",
|
|
99
|
+
"rightColor": "#ffff00",
|
|
100
|
+
"intensity": 1,
|
|
101
|
+
"radius": 2,
|
|
102
|
+
"momentum": 30
|
|
103
|
+
},
|
|
104
|
+
"ChromaticAberration": {
|
|
105
|
+
"opacity": 1,
|
|
106
|
+
"blendMode": "normal",
|
|
107
|
+
"strength": .2,
|
|
108
|
+
"angle": 0,
|
|
109
|
+
"redOffset": -1,
|
|
110
|
+
"greenOffset": 0,
|
|
111
|
+
"blueOffset": 1
|
|
112
|
+
},
|
|
113
|
+
"Circle": {
|
|
114
|
+
"opacity": 1,
|
|
115
|
+
"blendMode": "normal",
|
|
116
|
+
"color": "#ffffff",
|
|
117
|
+
"radius": 1,
|
|
118
|
+
"softness": 0,
|
|
119
|
+
"center": {
|
|
120
|
+
"x": .5,
|
|
121
|
+
"y": .5
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"CRTScreen": {
|
|
125
|
+
"opacity": 1,
|
|
126
|
+
"blendMode": "normal",
|
|
127
|
+
"pixelSize": 128,
|
|
128
|
+
"colorShift": 1,
|
|
129
|
+
"scanlineIntensity": .3,
|
|
130
|
+
"scanlineFrequency": 200,
|
|
131
|
+
"brightness": 1.1,
|
|
132
|
+
"contrast": 1.2
|
|
133
|
+
},
|
|
134
|
+
"CursorTrail": {
|
|
135
|
+
"opacity": 1,
|
|
136
|
+
"blendMode": "normal",
|
|
137
|
+
"colorA": "#00aaff",
|
|
138
|
+
"colorB": "#ff00aa",
|
|
139
|
+
"radius": .5,
|
|
140
|
+
"length": .5,
|
|
141
|
+
"shrink": 1,
|
|
142
|
+
"colorSpace": "linear"
|
|
143
|
+
},
|
|
144
|
+
"DiffuseBlur": {
|
|
145
|
+
"opacity": 1,
|
|
146
|
+
"blendMode": "normal",
|
|
147
|
+
"intensity": 30,
|
|
148
|
+
"edges": "stretch"
|
|
149
|
+
},
|
|
150
|
+
"Dither": {
|
|
151
|
+
"opacity": 1,
|
|
152
|
+
"blendMode": "normal",
|
|
153
|
+
"pixelSize": 4,
|
|
154
|
+
"threshold": .5,
|
|
155
|
+
"colorA": "transparent",
|
|
156
|
+
"colorB": "#ffffff"
|
|
157
|
+
},
|
|
158
|
+
"DotGrid": {
|
|
159
|
+
"opacity": 1,
|
|
160
|
+
"blendMode": "normal",
|
|
161
|
+
"color": "#ffffff",
|
|
162
|
+
"density": 100,
|
|
163
|
+
"dotSize": .3,
|
|
164
|
+
"twinkle": 0
|
|
165
|
+
},
|
|
166
|
+
"Duotone": {
|
|
167
|
+
"opacity": 1,
|
|
168
|
+
"blendMode": "normal",
|
|
169
|
+
"colorA": "#ff0000",
|
|
170
|
+
"colorB": "#023af4",
|
|
171
|
+
"blend": .5,
|
|
172
|
+
"colorSpace": "linear"
|
|
173
|
+
},
|
|
174
|
+
"FilmGrain": {
|
|
175
|
+
"opacity": 1,
|
|
176
|
+
"blendMode": "normal",
|
|
177
|
+
"strength": .5
|
|
178
|
+
},
|
|
179
|
+
"FloatingParticles": {
|
|
180
|
+
"opacity": 1,
|
|
181
|
+
"blendMode": "normal",
|
|
182
|
+
"randomness": .25,
|
|
183
|
+
"speed": .25,
|
|
184
|
+
"angle": 90,
|
|
185
|
+
"particleSize": 1,
|
|
186
|
+
"particleSoftness": 0,
|
|
187
|
+
"twinkle": .5,
|
|
188
|
+
"count": 5,
|
|
189
|
+
"particleColor": "#ffffff",
|
|
190
|
+
"speedVariance": .3,
|
|
191
|
+
"angleVariance": 30,
|
|
192
|
+
"particleDensity": 3
|
|
193
|
+
},
|
|
194
|
+
"GlassTiles": {
|
|
195
|
+
"opacity": 1,
|
|
196
|
+
"blendMode": "normal",
|
|
197
|
+
"intensity": 1,
|
|
198
|
+
"tileCount": 100
|
|
199
|
+
},
|
|
200
|
+
"Glow": {
|
|
201
|
+
"opacity": 1,
|
|
202
|
+
"blendMode": "normal",
|
|
203
|
+
"intensity": 1,
|
|
204
|
+
"threshold": .5,
|
|
205
|
+
"size": 10
|
|
206
|
+
},
|
|
207
|
+
"Godrays": {
|
|
208
|
+
"opacity": 1,
|
|
209
|
+
"blendMode": "normal",
|
|
210
|
+
"center": {
|
|
211
|
+
"x": 0,
|
|
212
|
+
"y": 0
|
|
213
|
+
},
|
|
214
|
+
"density": .3,
|
|
215
|
+
"intensity": .8,
|
|
216
|
+
"spotty": 1,
|
|
217
|
+
"speed": .5,
|
|
218
|
+
"rayColor": "#4283fb",
|
|
219
|
+
"backgroundColor": "transparent"
|
|
220
|
+
},
|
|
221
|
+
"Grayscale": {
|
|
222
|
+
"opacity": 1,
|
|
223
|
+
"blendMode": "normal"
|
|
224
|
+
},
|
|
225
|
+
"Grid": {
|
|
226
|
+
"opacity": 1,
|
|
227
|
+
"blendMode": "normal",
|
|
228
|
+
"color": "#ffffff",
|
|
229
|
+
"cells": 10,
|
|
230
|
+
"thickness": 1
|
|
231
|
+
},
|
|
232
|
+
"GridDistortion": {
|
|
233
|
+
"opacity": 1,
|
|
234
|
+
"blendMode": "normal",
|
|
235
|
+
"intensity": 1,
|
|
236
|
+
"swirl": 0,
|
|
237
|
+
"decay": 3,
|
|
238
|
+
"radius": 1,
|
|
239
|
+
"gridSize": 20,
|
|
240
|
+
"edges": "stretch"
|
|
241
|
+
},
|
|
242
|
+
"Group": {
|
|
243
|
+
"opacity": 1,
|
|
244
|
+
"blendMode": "normal"
|
|
245
|
+
},
|
|
246
|
+
"Halftone": {
|
|
247
|
+
"opacity": 1,
|
|
248
|
+
"blendMode": "normal",
|
|
249
|
+
"frequency": 100,
|
|
250
|
+
"angle": 45,
|
|
251
|
+
"smoothness": .1
|
|
252
|
+
},
|
|
253
|
+
"HueShift": {
|
|
254
|
+
"opacity": 1,
|
|
255
|
+
"blendMode": "normal",
|
|
256
|
+
"shift": 0
|
|
257
|
+
},
|
|
258
|
+
"ImageTexture": {
|
|
259
|
+
"opacity": 1,
|
|
260
|
+
"blendMode": "normal",
|
|
261
|
+
"url": "https://shaders.com/sample.jpg",
|
|
262
|
+
"objectFit": "cover"
|
|
263
|
+
},
|
|
264
|
+
"Invert": {
|
|
265
|
+
"opacity": 1,
|
|
266
|
+
"blendMode": "normal"
|
|
267
|
+
},
|
|
268
|
+
"LinearBlur": {
|
|
269
|
+
"opacity": 1,
|
|
270
|
+
"blendMode": "normal",
|
|
271
|
+
"intensity": 30,
|
|
272
|
+
"angle": 0
|
|
273
|
+
},
|
|
274
|
+
"LinearGradient": {
|
|
275
|
+
"opacity": 1,
|
|
276
|
+
"blendMode": "normal",
|
|
277
|
+
"colorA": "#1aff00",
|
|
278
|
+
"colorB": "#0000ff",
|
|
279
|
+
"start": {
|
|
280
|
+
"x": 0,
|
|
281
|
+
"y": .5
|
|
282
|
+
},
|
|
283
|
+
"end": {
|
|
284
|
+
"x": 1,
|
|
285
|
+
"y": .5
|
|
286
|
+
},
|
|
287
|
+
"angle": 0,
|
|
288
|
+
"edges": "stretch",
|
|
289
|
+
"colorSpace": "linear"
|
|
290
|
+
},
|
|
291
|
+
"Liquify": {
|
|
292
|
+
"opacity": 1,
|
|
293
|
+
"blendMode": "normal",
|
|
294
|
+
"intensity": 1,
|
|
295
|
+
"swirl": 0,
|
|
296
|
+
"decay": 3,
|
|
297
|
+
"radius": 1,
|
|
298
|
+
"edges": "stretch"
|
|
299
|
+
},
|
|
300
|
+
"Pixelate": {
|
|
301
|
+
"opacity": 1,
|
|
302
|
+
"blendMode": "normal",
|
|
303
|
+
"scale": 50
|
|
304
|
+
},
|
|
305
|
+
"PolarCoordinates": {
|
|
306
|
+
"opacity": 1,
|
|
307
|
+
"blendMode": "normal",
|
|
308
|
+
"center": {
|
|
309
|
+
"x": .5,
|
|
310
|
+
"y": .5
|
|
311
|
+
},
|
|
312
|
+
"wrap": 1,
|
|
313
|
+
"radius": 1,
|
|
314
|
+
"intensity": 1,
|
|
315
|
+
"edges": "transparent"
|
|
316
|
+
},
|
|
317
|
+
"Posterize": {
|
|
318
|
+
"opacity": 1,
|
|
319
|
+
"blendMode": "normal",
|
|
320
|
+
"intensity": 5
|
|
321
|
+
},
|
|
322
|
+
"ProgressiveBlur": {
|
|
323
|
+
"opacity": 1,
|
|
324
|
+
"blendMode": "normal",
|
|
325
|
+
"intensity": 50,
|
|
326
|
+
"angle": 0,
|
|
327
|
+
"center": {
|
|
328
|
+
"x": 0,
|
|
329
|
+
"y": .5
|
|
330
|
+
},
|
|
331
|
+
"falloff": 1
|
|
332
|
+
},
|
|
333
|
+
"RadialGradient": {
|
|
334
|
+
"opacity": 1,
|
|
335
|
+
"blendMode": "normal",
|
|
336
|
+
"colorA": "#ff0000",
|
|
337
|
+
"colorB": "#0000ff",
|
|
338
|
+
"center": {
|
|
339
|
+
"x": .5,
|
|
340
|
+
"y": .5
|
|
341
|
+
},
|
|
342
|
+
"radius": 1,
|
|
343
|
+
"colorSpace": "linear"
|
|
344
|
+
},
|
|
345
|
+
"RectangularCoordinates": {
|
|
346
|
+
"opacity": 1,
|
|
347
|
+
"blendMode": "normal",
|
|
348
|
+
"center": {
|
|
349
|
+
"x": .5,
|
|
350
|
+
"y": .5
|
|
351
|
+
},
|
|
352
|
+
"scale": 1,
|
|
353
|
+
"intensity": 1,
|
|
354
|
+
"edges": "transparent"
|
|
355
|
+
},
|
|
356
|
+
"Ripples": {
|
|
357
|
+
"opacity": 1,
|
|
358
|
+
"blendMode": "normal",
|
|
359
|
+
"center": {
|
|
360
|
+
"x": .5,
|
|
361
|
+
"y": .5
|
|
362
|
+
},
|
|
363
|
+
"colorA": "#ffffff",
|
|
364
|
+
"colorB": "#000000",
|
|
365
|
+
"speed": 1,
|
|
366
|
+
"frequency": 20,
|
|
367
|
+
"softness": 0,
|
|
368
|
+
"thickness": .5,
|
|
369
|
+
"phase": 0
|
|
370
|
+
},
|
|
371
|
+
"Saturation": {
|
|
372
|
+
"opacity": 1,
|
|
373
|
+
"blendMode": "normal",
|
|
374
|
+
"intensity": 1
|
|
375
|
+
},
|
|
376
|
+
"SimplexNoise": {
|
|
377
|
+
"opacity": 1,
|
|
378
|
+
"blendMode": "normal",
|
|
379
|
+
"colorA": "#ffffff",
|
|
380
|
+
"colorB": "#000000",
|
|
381
|
+
"scale": 2,
|
|
382
|
+
"balance": 0,
|
|
383
|
+
"contrast": 0,
|
|
384
|
+
"seed": 0,
|
|
385
|
+
"speed": 1
|
|
386
|
+
},
|
|
387
|
+
"SineWave": {
|
|
388
|
+
"opacity": 1,
|
|
389
|
+
"blendMode": "normal",
|
|
390
|
+
"color": "#ffffff",
|
|
391
|
+
"amplitude": .15,
|
|
392
|
+
"frequency": 1,
|
|
393
|
+
"speed": 1,
|
|
394
|
+
"angle": 0,
|
|
395
|
+
"position": {
|
|
396
|
+
"x": .5,
|
|
397
|
+
"y": .5
|
|
398
|
+
},
|
|
399
|
+
"thickness": .2,
|
|
400
|
+
"softness": .4
|
|
401
|
+
},
|
|
402
|
+
"SolidColor": {
|
|
403
|
+
"opacity": 1,
|
|
404
|
+
"blendMode": "normal",
|
|
405
|
+
"color": "#5b18ca"
|
|
406
|
+
},
|
|
407
|
+
"Spherize": {
|
|
408
|
+
"opacity": 1,
|
|
409
|
+
"blendMode": "normal",
|
|
410
|
+
"radius": 1,
|
|
411
|
+
"depth": 1,
|
|
412
|
+
"center": {
|
|
413
|
+
"x": .5,
|
|
414
|
+
"y": .5
|
|
415
|
+
},
|
|
416
|
+
"lightPosition": {
|
|
417
|
+
"x": .3,
|
|
418
|
+
"y": .3
|
|
419
|
+
},
|
|
420
|
+
"lightIntensity": .5,
|
|
421
|
+
"lightSoftness": .5,
|
|
422
|
+
"lightColor": "#ffffff"
|
|
423
|
+
},
|
|
424
|
+
"Spiral": {
|
|
425
|
+
"opacity": 1,
|
|
426
|
+
"blendMode": "normal",
|
|
427
|
+
"colorA": "#000000",
|
|
428
|
+
"colorB": "#ffffff",
|
|
429
|
+
"strokeWidth": .5,
|
|
430
|
+
"strokeFalloff": 0,
|
|
431
|
+
"softness": 0,
|
|
432
|
+
"speed": 1,
|
|
433
|
+
"center": {
|
|
434
|
+
"x": .5,
|
|
435
|
+
"y": .5
|
|
436
|
+
},
|
|
437
|
+
"scale": 1,
|
|
438
|
+
"colorSpace": "linear"
|
|
439
|
+
},
|
|
440
|
+
"Strands": {
|
|
441
|
+
"opacity": 1,
|
|
442
|
+
"blendMode": "normal",
|
|
443
|
+
"speed": .5,
|
|
444
|
+
"amplitude": 1,
|
|
445
|
+
"frequency": 1,
|
|
446
|
+
"lineCount": 12,
|
|
447
|
+
"lineWidth": .1,
|
|
448
|
+
"waveColor": "#f1c907",
|
|
449
|
+
"pinEdges": true,
|
|
450
|
+
"start": {
|
|
451
|
+
"x": 0,
|
|
452
|
+
"y": .5
|
|
453
|
+
},
|
|
454
|
+
"end": {
|
|
455
|
+
"x": 1,
|
|
456
|
+
"y": .5
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"Stretch": {
|
|
460
|
+
"opacity": 1,
|
|
461
|
+
"blendMode": "normal",
|
|
462
|
+
"center": {
|
|
463
|
+
"x": .5,
|
|
464
|
+
"y": .5
|
|
465
|
+
},
|
|
466
|
+
"strength": 1,
|
|
467
|
+
"angle": 0,
|
|
468
|
+
"falloff": 0,
|
|
469
|
+
"edges": "stretch"
|
|
470
|
+
},
|
|
471
|
+
"Swirl": {
|
|
472
|
+
"opacity": 1,
|
|
473
|
+
"blendMode": "normal",
|
|
474
|
+
"colorA": "#1275d8",
|
|
475
|
+
"colorB": "#e19136",
|
|
476
|
+
"speed": 1,
|
|
477
|
+
"detail": 1,
|
|
478
|
+
"blend": 50,
|
|
479
|
+
"coarseX": 50,
|
|
480
|
+
"coarseY": 50,
|
|
481
|
+
"mediumX": 50,
|
|
482
|
+
"mediumY": 50,
|
|
483
|
+
"fineX": 50,
|
|
484
|
+
"fineY": 50,
|
|
485
|
+
"colorSpace": "linear"
|
|
486
|
+
},
|
|
487
|
+
"TiltShift": {
|
|
488
|
+
"opacity": 1,
|
|
489
|
+
"blendMode": "normal",
|
|
490
|
+
"intensity": 50,
|
|
491
|
+
"width": .3,
|
|
492
|
+
"falloff": .3,
|
|
493
|
+
"angle": 0,
|
|
494
|
+
"center": {
|
|
495
|
+
"x": .5,
|
|
496
|
+
"y": .5
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"Tritone": {
|
|
500
|
+
"opacity": 1,
|
|
501
|
+
"blendMode": "normal",
|
|
502
|
+
"colorA": "#ce1bea",
|
|
503
|
+
"colorB": "#2fff00",
|
|
504
|
+
"colorC": "#ffff00",
|
|
505
|
+
"blendMid": .5,
|
|
506
|
+
"colorSpace": "linear"
|
|
507
|
+
},
|
|
508
|
+
"Twirl": {
|
|
509
|
+
"opacity": 1,
|
|
510
|
+
"blendMode": "normal",
|
|
511
|
+
"center": {
|
|
512
|
+
"x": .5,
|
|
513
|
+
"y": .5
|
|
514
|
+
},
|
|
515
|
+
"intensity": 1,
|
|
516
|
+
"edges": "stretch"
|
|
517
|
+
},
|
|
518
|
+
"Vibrance": {
|
|
519
|
+
"opacity": 1,
|
|
520
|
+
"blendMode": "normal",
|
|
521
|
+
"intensity": 0
|
|
522
|
+
},
|
|
523
|
+
"WaveDistortion": {
|
|
524
|
+
"opacity": 1,
|
|
525
|
+
"blendMode": "normal",
|
|
526
|
+
"strength": .3,
|
|
527
|
+
"frequency": 1,
|
|
528
|
+
"speed": 1,
|
|
529
|
+
"angle": 0,
|
|
530
|
+
"waveType": "sine",
|
|
531
|
+
"edges": "stretch"
|
|
532
|
+
},
|
|
533
|
+
"ZoomBlur": {
|
|
534
|
+
"opacity": 1,
|
|
535
|
+
"blendMode": "normal",
|
|
536
|
+
"intensity": 30,
|
|
537
|
+
"center": {
|
|
538
|
+
"x": .5,
|
|
539
|
+
"y": .5
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
function generatePropString(props, componentType, indent = " ") {
|
|
544
|
+
return Object.entries(props).filter(([key, value]) => {
|
|
545
|
+
const componentDefaults = shaderMetadata[componentType] || {};
|
|
546
|
+
if (componentDefaults.hasOwnProperty(key)) {
|
|
547
|
+
const defaultValue = componentDefaults[key];
|
|
548
|
+
if (typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
549
|
+
return value !== defaultValue;
|
|
550
|
+
}
|
|
551
|
+
if (key === "opacity" && value === 1) return false;
|
|
552
|
+
if (key === "blendMode" && value === "normal") return false;
|
|
553
|
+
return true;
|
|
554
|
+
}).map(([key, value]) => {
|
|
555
|
+
if (typeof value === "string") return `${key}="${value}"`;
|
|
556
|
+
else if (typeof value === "object") return `${key}={${JSON.stringify(value)}}`;
|
|
557
|
+
else return `${key}={${value}}`;
|
|
558
|
+
}).join("\n" + indent + " ");
|
|
559
|
+
}
|
|
560
|
+
function isIdUsedAsMaskSource(id, allComponents) {
|
|
561
|
+
const flatComponents = [];
|
|
562
|
+
function flattenComponents(components) {
|
|
563
|
+
for (const component of components) {
|
|
564
|
+
flatComponents.push(component);
|
|
565
|
+
if (component.children) flattenComponents(component.children);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
flattenComponents(allComponents);
|
|
569
|
+
return flatComponents.some((component) => component.props?.maskSource === id);
|
|
570
|
+
}
|
|
571
|
+
function generatePresetCode(preset) {
|
|
572
|
+
const generateComponentString = (config, indent = " ") => {
|
|
573
|
+
const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
|
|
574
|
+
let idString = "";
|
|
575
|
+
if (config.id) {
|
|
576
|
+
if (isIdUsedAsMaskSource(config.id, preset.components)) idString = `id="${config.id}"`;
|
|
577
|
+
}
|
|
578
|
+
const attributes = [idString, propString].filter(Boolean).join("\n" + indent + " ");
|
|
579
|
+
if (config.children && config.children.length > 0) {
|
|
580
|
+
const childrenString = config.children.map((child) => generateComponentString(child, indent + " ")).join("\n");
|
|
581
|
+
if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${childrenString}\n${indent}</${config.type}>`;
|
|
582
|
+
else return `${indent}<${config.type}>\n${childrenString}\n${indent}</${config.type}>`;
|
|
583
|
+
} else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes} />`;
|
|
584
|
+
else return `${indent}<${config.type} />`;
|
|
585
|
+
};
|
|
586
|
+
return `<Shader>\n${preset.components.map((config) => generateComponentString(config)).join("\n")}\n</Shader>`;
|
|
587
|
+
}
|
|
588
|
+
const availableComponents = [
|
|
589
|
+
"AngularBlur",
|
|
590
|
+
"Ascii",
|
|
591
|
+
"Beam",
|
|
592
|
+
"Blob",
|
|
593
|
+
"Blur",
|
|
594
|
+
"Bulge",
|
|
595
|
+
"CRTScreen",
|
|
596
|
+
"ChannelBlur",
|
|
597
|
+
"Checkerboard",
|
|
598
|
+
"ChromaFlow",
|
|
599
|
+
"ChromaticAberration",
|
|
600
|
+
"Circle",
|
|
601
|
+
"CursorTrail",
|
|
602
|
+
"DiffuseBlur",
|
|
603
|
+
"Dither",
|
|
604
|
+
"DotGrid",
|
|
605
|
+
"Duotone",
|
|
606
|
+
"FilmGrain",
|
|
607
|
+
"FloatingParticles",
|
|
608
|
+
"GlassTiles",
|
|
609
|
+
"Glow",
|
|
610
|
+
"Godrays",
|
|
611
|
+
"Grayscale",
|
|
612
|
+
"Grid",
|
|
613
|
+
"GridDistortion",
|
|
614
|
+
"Group",
|
|
615
|
+
"Halftone",
|
|
616
|
+
"HueShift",
|
|
617
|
+
"ImageTexture",
|
|
618
|
+
"Invert",
|
|
619
|
+
"LinearBlur",
|
|
620
|
+
"LinearGradient",
|
|
621
|
+
"Liquify",
|
|
622
|
+
"Pixelate",
|
|
623
|
+
"PolarCoordinates",
|
|
624
|
+
"Posterize",
|
|
625
|
+
"ProgressiveBlur",
|
|
626
|
+
"RadialGradient",
|
|
627
|
+
"RectangularCoordinates",
|
|
628
|
+
"Ripples",
|
|
629
|
+
"Saturation",
|
|
630
|
+
"SimplexNoise",
|
|
631
|
+
"SineWave",
|
|
632
|
+
"SolidColor",
|
|
633
|
+
"Spherize",
|
|
634
|
+
"Spiral",
|
|
635
|
+
"Strands",
|
|
636
|
+
"Stretch",
|
|
637
|
+
"Swirl",
|
|
638
|
+
"TiltShift",
|
|
639
|
+
"Tritone",
|
|
640
|
+
"Twirl",
|
|
641
|
+
"Vibrance",
|
|
642
|
+
"WaveDistortion",
|
|
643
|
+
"ZoomBlur"
|
|
644
|
+
];
|
|
645
|
+
export { generatePresetCode as n, availableComponents as t };
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as AngularBlur } from './components/AngularBlur.svelte';
|
|
2
2
|
export { default as Ascii } from './components/Ascii.svelte';
|
|
3
|
+
export { default as Beam } from './components/Beam.svelte';
|
|
3
4
|
export { default as Blob } from './components/Blob.svelte';
|
|
4
5
|
export { default as Blur } from './components/Blur.svelte';
|
|
5
6
|
export { default as Bulge } from './components/Bulge.svelte';
|