shaders 2.2.42 → 2.2.44
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/WebcamTexture-D4Uv7Plz.js +168 -0
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -168
- package/dist/core/registry.d.ts +10 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +166 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/WebcamTexture/index.d.ts +21 -0
- package/dist/core/shaders/WebcamTexture/index.d.ts.map +1 -0
- package/dist/core/shaders/WebcamTexture/index.js +2 -0
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/react/AngularBlur.js +144 -0
- package/dist/react/Ascii.js +144 -0
- package/dist/react/Beam.js +144 -0
- package/dist/react/Blob.js +144 -0
- package/dist/react/Blur.js +144 -0
- package/dist/react/BrightnessContrast.js +144 -0
- package/dist/react/Bulge.js +144 -0
- package/dist/react/CRTScreen.js +144 -0
- package/dist/react/ChannelBlur.js +144 -0
- package/dist/react/Checkerboard.js +144 -0
- package/dist/react/ChromaFlow.js +144 -0
- package/dist/react/ChromaticAberration.js +144 -0
- package/dist/react/Circle.js +144 -0
- package/dist/react/CursorTrail.js +144 -0
- package/dist/react/DiffuseBlur.js +144 -0
- package/dist/react/Dither.js +144 -0
- package/dist/react/DotGrid.js +144 -0
- package/dist/react/Duotone.js +144 -0
- package/dist/react/FilmGrain.js +144 -0
- package/dist/react/FloatingParticles.js +144 -0
- package/dist/react/GlassTiles.js +144 -0
- package/dist/react/Glow.js +144 -0
- package/dist/react/Godrays.js +144 -0
- package/dist/react/Grayscale.js +144 -0
- package/dist/react/Grid.js +144 -0
- package/dist/react/GridDistortion.js +144 -0
- package/dist/react/Group.js +144 -0
- package/dist/react/Halftone.js +144 -0
- package/dist/react/HueShift.js +144 -0
- package/dist/react/ImageTexture.js +144 -0
- package/dist/react/Invert.js +144 -0
- package/dist/react/LinearBlur.js +144 -0
- package/dist/react/LinearGradient.js +144 -0
- package/dist/react/Liquify.js +144 -0
- package/dist/react/Perspective.js +144 -0
- package/dist/react/Pixelate.js +144 -0
- package/dist/react/PolarCoordinates.js +144 -0
- package/dist/react/Posterize.js +144 -0
- package/dist/react/ProgressiveBlur.js +144 -0
- package/dist/react/RadialGradient.js +144 -0
- package/dist/react/RectangularCoordinates.js +144 -0
- package/dist/react/Ripples.js +144 -0
- package/dist/react/Saturation.js +144 -0
- package/dist/react/Shader.js +166 -0
- package/dist/react/Sharpness.js +144 -0
- package/dist/react/Shatter.js +144 -0
- package/dist/react/SimplexNoise.js +144 -0
- package/dist/react/SineWave.js +144 -0
- package/dist/react/SolidColor.js +144 -0
- package/dist/react/Spherize.js +144 -0
- package/dist/react/Spiral.js +144 -0
- package/dist/react/Strands.js +144 -0
- package/dist/react/Stretch.js +144 -0
- package/dist/react/Stripes.js +144 -0
- package/dist/react/Swirl.js +144 -0
- package/dist/react/TiltShift.js +144 -0
- package/dist/react/Tint.js +144 -0
- package/dist/react/Tritone.js +144 -0
- package/dist/react/Twirl.js +144 -0
- package/dist/react/Vibrance.js +144 -0
- package/dist/react/WaveDistortion.js +144 -0
- package/dist/react/WebcamTexture.js +144 -0
- package/dist/react/ZoomBlur.js +144 -0
- package/dist/react/components/WebcamTexture.d.ts +31 -0
- package/dist/react/components/WebcamTexture.d.ts.map +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +65 -8646
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +392 -1
- package/dist/registry.js +91 -0
- package/dist/solid/components/AngularBlur.js +148 -0
- package/dist/solid/components/Ascii.js +148 -0
- package/dist/solid/components/Beam.js +148 -0
- package/dist/solid/components/Blob.js +148 -0
- package/dist/solid/components/Blur.js +148 -0
- package/dist/solid/components/BrightnessContrast.js +148 -0
- package/dist/solid/components/Bulge.js +148 -0
- package/dist/solid/components/CRTScreen.js +148 -0
- package/dist/solid/components/ChannelBlur.js +148 -0
- package/dist/solid/components/Checkerboard.js +148 -0
- package/dist/solid/components/ChromaFlow.js +148 -0
- package/dist/solid/components/ChromaticAberration.js +148 -0
- package/dist/solid/components/Circle.js +148 -0
- package/dist/solid/components/CursorTrail.js +148 -0
- package/dist/solid/components/DiffuseBlur.js +148 -0
- package/dist/solid/components/Dither.js +148 -0
- package/dist/solid/components/DotGrid.js +148 -0
- package/dist/solid/components/Duotone.js +148 -0
- package/dist/solid/components/FilmGrain.js +148 -0
- package/dist/solid/components/FloatingParticles.js +148 -0
- package/dist/solid/components/GlassTiles.js +148 -0
- package/dist/solid/components/Glow.js +148 -0
- package/dist/solid/components/Godrays.js +148 -0
- package/dist/solid/components/Grayscale.js +148 -0
- package/dist/solid/components/Grid.js +148 -0
- package/dist/solid/components/GridDistortion.js +148 -0
- package/dist/solid/components/Group.js +148 -0
- package/dist/solid/components/Halftone.js +148 -0
- package/dist/solid/components/HueShift.js +148 -0
- package/dist/solid/components/ImageTexture.js +148 -0
- package/dist/solid/components/Invert.js +148 -0
- package/dist/solid/components/LinearBlur.js +148 -0
- package/dist/solid/components/LinearGradient.js +148 -0
- package/dist/solid/components/Liquify.js +148 -0
- package/dist/solid/components/Perspective.js +148 -0
- package/dist/solid/components/Pixelate.js +148 -0
- package/dist/solid/components/PolarCoordinates.js +148 -0
- package/dist/solid/components/Posterize.js +148 -0
- package/dist/solid/components/ProgressiveBlur.js +148 -0
- package/dist/solid/components/RadialGradient.js +148 -0
- package/dist/solid/components/RectangularCoordinates.js +148 -0
- package/dist/solid/components/Ripples.js +148 -0
- package/dist/solid/components/Saturation.js +148 -0
- package/dist/solid/components/Sharpness.js +148 -0
- package/dist/solid/components/Shatter.js +148 -0
- package/dist/solid/components/SimplexNoise.js +148 -0
- package/dist/solid/components/SineWave.js +148 -0
- package/dist/solid/components/SolidColor.js +148 -0
- package/dist/solid/components/Spherize.js +148 -0
- package/dist/solid/components/Spiral.js +148 -0
- package/dist/solid/components/Strands.js +148 -0
- package/dist/solid/components/Stretch.js +148 -0
- package/dist/solid/components/Stripes.js +148 -0
- package/dist/solid/components/Swirl.js +148 -0
- package/dist/solid/components/TiltShift.js +148 -0
- package/dist/solid/components/Tint.js +148 -0
- package/dist/solid/components/Tritone.js +148 -0
- package/dist/solid/components/Twirl.js +148 -0
- package/dist/solid/components/Vibrance.js +148 -0
- package/dist/solid/components/WaveDistortion.js +148 -0
- package/dist/solid/components/WebcamTexture.d.ts +28 -0
- package/dist/solid/components/WebcamTexture.d.ts.map +1 -0
- package/dist/solid/components/WebcamTexture.js +148 -0
- package/dist/solid/components/ZoomBlur.js +148 -0
- package/dist/solid/engine/Shader.js +189 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +126 -8847
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +66 -414
- package/dist/svelte/components/WebcamTexture.svelte.d.ts +19 -0
- package/dist/svelte/generatePresetCode-CtXcoyI0.js +393 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +115 -4
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/AngularBlur.js +3 -0
- package/dist/vue/AngularBlur.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/Ascii.js +3 -0
- package/dist/vue/Ascii.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Beam.js +3 -0
- package/dist/vue/Beam.vue_vue_type_script_setup_true_lang.js +132 -0
- package/dist/vue/Blob.js +3 -0
- package/dist/vue/Blob.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/vue/Blur.js +3 -0
- package/dist/vue/Blur.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/BrightnessContrast.js +3 -0
- package/dist/vue/BrightnessContrast.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/Bulge.js +3 -0
- package/dist/vue/Bulge.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/CRTScreen.js +3 -0
- package/dist/vue/CRTScreen.vue_vue_type_script_setup_true_lang.js +129 -0
- package/dist/vue/ChannelBlur.js +3 -0
- package/dist/vue/ChannelBlur.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/Checkerboard.js +3 -0
- package/dist/vue/Checkerboard.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/ChromaFlow.js +3 -0
- package/dist/vue/ChromaFlow.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/vue/ChromaticAberration.js +3 -0
- package/dist/vue/ChromaticAberration.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Circle.js +3 -0
- package/dist/vue/Circle.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/CursorTrail.js +3 -0
- package/dist/vue/CursorTrail.vue_vue_type_script_setup_true_lang.js +129 -0
- package/dist/vue/DiffuseBlur.js +3 -0
- package/dist/vue/DiffuseBlur.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/Dither.js +3 -0
- package/dist/vue/Dither.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/DotGrid.js +3 -0
- package/dist/vue/DotGrid.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Duotone.js +3 -0
- package/dist/vue/Duotone.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/FilmGrain.js +3 -0
- package/dist/vue/FilmGrain.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/FloatingParticles.js +3 -0
- package/dist/vue/FloatingParticles.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/vue/GlassTiles.js +3 -0
- package/dist/vue/GlassTiles.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Glow.js +3 -0
- package/dist/vue/Glow.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/Godrays.js +3 -0
- package/dist/vue/Godrays.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/vue/Grayscale.js +3 -0
- package/dist/vue/Grayscale.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/vue/Grid.js +3 -0
- package/dist/vue/Grid.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/GridDistortion.js +3 -0
- package/dist/vue/GridDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
- package/dist/vue/Group.js +3 -0
- package/dist/vue/Group.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/vue/Halftone.js +3 -0
- package/dist/vue/Halftone.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/HueShift.js +3 -0
- package/dist/vue/HueShift.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/ImageTexture.js +3 -0
- package/dist/vue/ImageTexture.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/Invert.js +3 -0
- package/dist/vue/Invert.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/vue/LinearBlur.js +3 -0
- package/dist/vue/LinearBlur.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/LinearGradient.js +3 -0
- package/dist/vue/LinearGradient.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/vue/Liquify.js +3 -0
- package/dist/vue/Liquify.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Perspective.js +3 -0
- package/dist/vue/Perspective.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/vue/Pixelate.js +3 -0
- package/dist/vue/Pixelate.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/PolarCoordinates.js +3 -0
- package/dist/vue/PolarCoordinates.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Posterize.js +3 -0
- package/dist/vue/Posterize.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/ProgressiveBlur.js +3 -0
- package/dist/vue/ProgressiveBlur.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/RadialGradient.js +3 -0
- package/dist/vue/RadialGradient.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/RectangularCoordinates.js +3 -0
- package/dist/vue/RectangularCoordinates.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Ripples.js +3 -0
- package/dist/vue/Ripples.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/vue/Saturation.js +3 -0
- package/dist/vue/Saturation.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/Shader.js +3 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +153 -0
- package/dist/vue/Sharpness.js +3 -0
- package/dist/vue/Sharpness.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/Shatter.js +3 -0
- package/dist/vue/Shatter.vue_vue_type_script_setup_true_lang.js +132 -0
- package/dist/vue/SimplexNoise.js +3 -0
- package/dist/vue/SimplexNoise.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/vue/SineWave.js +3 -0
- package/dist/vue/SineWave.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/vue/SolidColor.js +3 -0
- package/dist/vue/SolidColor.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/Spherize.js +3 -0
- package/dist/vue/Spherize.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/vue/Spiral.js +3 -0
- package/dist/vue/Spiral.vue_vue_type_script_setup_true_lang.js +132 -0
- package/dist/vue/Strands.js +3 -0
- package/dist/vue/Strands.vue_vue_type_script_setup_true_lang.js +132 -0
- package/dist/vue/Stretch.js +3 -0
- package/dist/vue/Stretch.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Stripes.js +3 -0
- package/dist/vue/Stripes.vue_vue_type_script_setup_true_lang.js +132 -0
- package/dist/vue/Swirl.js +3 -0
- package/dist/vue/Swirl.vue_vue_type_script_setup_true_lang.js +129 -0
- package/dist/vue/TiltShift.js +3 -0
- package/dist/vue/TiltShift.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Tint.js +3 -0
- package/dist/vue/Tint.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/Tritone.js +3 -0
- package/dist/vue/Tritone.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/vue/Twirl.js +3 -0
- package/dist/vue/Twirl.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/Vibrance.js +3 -0
- package/dist/vue/Vibrance.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/vue/WaveDistortion.js +3 -0
- package/dist/vue/WaveDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
- package/dist/vue/WebcamTexture.js +3 -0
- package/dist/vue/WebcamTexture.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/ZoomBlur.js +3 -0
- package/dist/vue/ZoomBlur.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/vue/components/WebcamTexture.vue.d.ts +57 -0
- package/dist/vue/components/WebcamTexture.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +65 -7749
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +391 -1
- package/package.json +9 -1
- package/dist/react/generatePresetCode-BrkW1bEe.js +0 -741
- package/dist/svelte/generatePresetCode-bx7z5wvC.js +0 -741
- package/dist/vue/generatePresetCode-_7ZzqQPH.js +0 -740
- /package/dist/core/{ZoomBlur-CTrw7HxX.js → ZoomBlur-CIkkDBIo.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAkXD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAgE/B,CAAA"}
|
|
@@ -1,2 +1,392 @@
|
|
|
1
|
-
|
|
1
|
+
function camelToKebab(str) {
|
|
2
|
+
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3
|
+
}
|
|
4
|
+
var DEFAULT_TRANSFORM = {
|
|
5
|
+
offsetX: 0,
|
|
6
|
+
offsetY: 0,
|
|
7
|
+
rotation: 0,
|
|
8
|
+
scale: 1,
|
|
9
|
+
anchorX: .5,
|
|
10
|
+
anchorY: .5,
|
|
11
|
+
edges: "transparent"
|
|
12
|
+
};
|
|
13
|
+
var shaderMetadata = {
|
|
14
|
+
"AngularBlur": {
|
|
15
|
+
"opacity": 1,
|
|
16
|
+
"blendMode": "normal"
|
|
17
|
+
},
|
|
18
|
+
"Ascii": {
|
|
19
|
+
"opacity": 1,
|
|
20
|
+
"blendMode": "normal"
|
|
21
|
+
},
|
|
22
|
+
"Beam": {
|
|
23
|
+
"opacity": 1,
|
|
24
|
+
"blendMode": "normal"
|
|
25
|
+
},
|
|
26
|
+
"Blob": {
|
|
27
|
+
"opacity": 1,
|
|
28
|
+
"blendMode": "normal"
|
|
29
|
+
},
|
|
30
|
+
"Blur": {
|
|
31
|
+
"opacity": 1,
|
|
32
|
+
"blendMode": "normal"
|
|
33
|
+
},
|
|
34
|
+
"BrightnessContrast": {
|
|
35
|
+
"opacity": 1,
|
|
36
|
+
"blendMode": "normal"
|
|
37
|
+
},
|
|
38
|
+
"Bulge": {
|
|
39
|
+
"opacity": 1,
|
|
40
|
+
"blendMode": "normal"
|
|
41
|
+
},
|
|
42
|
+
"CRTScreen": {
|
|
43
|
+
"opacity": 1,
|
|
44
|
+
"blendMode": "normal"
|
|
45
|
+
},
|
|
46
|
+
"ChannelBlur": {
|
|
47
|
+
"opacity": 1,
|
|
48
|
+
"blendMode": "normal"
|
|
49
|
+
},
|
|
50
|
+
"Checkerboard": {
|
|
51
|
+
"opacity": 1,
|
|
52
|
+
"blendMode": "normal"
|
|
53
|
+
},
|
|
54
|
+
"ChromaFlow": {
|
|
55
|
+
"opacity": 1,
|
|
56
|
+
"blendMode": "normal"
|
|
57
|
+
},
|
|
58
|
+
"ChromaticAberration": {
|
|
59
|
+
"opacity": 1,
|
|
60
|
+
"blendMode": "normal"
|
|
61
|
+
},
|
|
62
|
+
"Circle": {
|
|
63
|
+
"opacity": 1,
|
|
64
|
+
"blendMode": "normal"
|
|
65
|
+
},
|
|
66
|
+
"CursorTrail": {
|
|
67
|
+
"opacity": 1,
|
|
68
|
+
"blendMode": "normal"
|
|
69
|
+
},
|
|
70
|
+
"DiffuseBlur": {
|
|
71
|
+
"opacity": 1,
|
|
72
|
+
"blendMode": "normal"
|
|
73
|
+
},
|
|
74
|
+
"Dither": {
|
|
75
|
+
"opacity": 1,
|
|
76
|
+
"blendMode": "normal"
|
|
77
|
+
},
|
|
78
|
+
"DotGrid": {
|
|
79
|
+
"opacity": 1,
|
|
80
|
+
"blendMode": "normal"
|
|
81
|
+
},
|
|
82
|
+
"Duotone": {
|
|
83
|
+
"opacity": 1,
|
|
84
|
+
"blendMode": "normal"
|
|
85
|
+
},
|
|
86
|
+
"FilmGrain": {
|
|
87
|
+
"opacity": 1,
|
|
88
|
+
"blendMode": "normal"
|
|
89
|
+
},
|
|
90
|
+
"FloatingParticles": {
|
|
91
|
+
"opacity": 1,
|
|
92
|
+
"blendMode": "normal"
|
|
93
|
+
},
|
|
94
|
+
"GlassTiles": {
|
|
95
|
+
"opacity": 1,
|
|
96
|
+
"blendMode": "normal"
|
|
97
|
+
},
|
|
98
|
+
"Glow": {
|
|
99
|
+
"opacity": 1,
|
|
100
|
+
"blendMode": "normal"
|
|
101
|
+
},
|
|
102
|
+
"Godrays": {
|
|
103
|
+
"opacity": 1,
|
|
104
|
+
"blendMode": "normal"
|
|
105
|
+
},
|
|
106
|
+
"Grayscale": {
|
|
107
|
+
"opacity": 1,
|
|
108
|
+
"blendMode": "normal"
|
|
109
|
+
},
|
|
110
|
+
"Grid": {
|
|
111
|
+
"opacity": 1,
|
|
112
|
+
"blendMode": "normal"
|
|
113
|
+
},
|
|
114
|
+
"GridDistortion": {
|
|
115
|
+
"opacity": 1,
|
|
116
|
+
"blendMode": "normal"
|
|
117
|
+
},
|
|
118
|
+
"Group": {
|
|
119
|
+
"opacity": 1,
|
|
120
|
+
"blendMode": "normal"
|
|
121
|
+
},
|
|
122
|
+
"Halftone": {
|
|
123
|
+
"opacity": 1,
|
|
124
|
+
"blendMode": "normal"
|
|
125
|
+
},
|
|
126
|
+
"HueShift": {
|
|
127
|
+
"opacity": 1,
|
|
128
|
+
"blendMode": "normal"
|
|
129
|
+
},
|
|
130
|
+
"ImageTexture": {
|
|
131
|
+
"opacity": 1,
|
|
132
|
+
"blendMode": "normal"
|
|
133
|
+
},
|
|
134
|
+
"Invert": {
|
|
135
|
+
"opacity": 1,
|
|
136
|
+
"blendMode": "normal"
|
|
137
|
+
},
|
|
138
|
+
"LinearBlur": {
|
|
139
|
+
"opacity": 1,
|
|
140
|
+
"blendMode": "normal"
|
|
141
|
+
},
|
|
142
|
+
"LinearGradient": {
|
|
143
|
+
"opacity": 1,
|
|
144
|
+
"blendMode": "normal"
|
|
145
|
+
},
|
|
146
|
+
"Liquify": {
|
|
147
|
+
"opacity": 1,
|
|
148
|
+
"blendMode": "normal"
|
|
149
|
+
},
|
|
150
|
+
"Perspective": {
|
|
151
|
+
"opacity": 1,
|
|
152
|
+
"blendMode": "normal"
|
|
153
|
+
},
|
|
154
|
+
"Pixelate": {
|
|
155
|
+
"opacity": 1,
|
|
156
|
+
"blendMode": "normal"
|
|
157
|
+
},
|
|
158
|
+
"PolarCoordinates": {
|
|
159
|
+
"opacity": 1,
|
|
160
|
+
"blendMode": "normal"
|
|
161
|
+
},
|
|
162
|
+
"Posterize": {
|
|
163
|
+
"opacity": 1,
|
|
164
|
+
"blendMode": "normal"
|
|
165
|
+
},
|
|
166
|
+
"ProgressiveBlur": {
|
|
167
|
+
"opacity": 1,
|
|
168
|
+
"blendMode": "normal"
|
|
169
|
+
},
|
|
170
|
+
"RadialGradient": {
|
|
171
|
+
"opacity": 1,
|
|
172
|
+
"blendMode": "normal"
|
|
173
|
+
},
|
|
174
|
+
"RectangularCoordinates": {
|
|
175
|
+
"opacity": 1,
|
|
176
|
+
"blendMode": "normal"
|
|
177
|
+
},
|
|
178
|
+
"Ripples": {
|
|
179
|
+
"opacity": 1,
|
|
180
|
+
"blendMode": "normal"
|
|
181
|
+
},
|
|
182
|
+
"Saturation": {
|
|
183
|
+
"opacity": 1,
|
|
184
|
+
"blendMode": "normal"
|
|
185
|
+
},
|
|
186
|
+
"Sharpness": {
|
|
187
|
+
"opacity": 1,
|
|
188
|
+
"blendMode": "normal"
|
|
189
|
+
},
|
|
190
|
+
"Shatter": {
|
|
191
|
+
"opacity": 1,
|
|
192
|
+
"blendMode": "normal"
|
|
193
|
+
},
|
|
194
|
+
"SimplexNoise": {
|
|
195
|
+
"opacity": 1,
|
|
196
|
+
"blendMode": "normal"
|
|
197
|
+
},
|
|
198
|
+
"SineWave": {
|
|
199
|
+
"opacity": 1,
|
|
200
|
+
"blendMode": "normal"
|
|
201
|
+
},
|
|
202
|
+
"SolidColor": {
|
|
203
|
+
"opacity": 1,
|
|
204
|
+
"blendMode": "normal"
|
|
205
|
+
},
|
|
206
|
+
"Spherize": {
|
|
207
|
+
"opacity": 1,
|
|
208
|
+
"blendMode": "normal"
|
|
209
|
+
},
|
|
210
|
+
"Spiral": {
|
|
211
|
+
"opacity": 1,
|
|
212
|
+
"blendMode": "normal"
|
|
213
|
+
},
|
|
214
|
+
"Strands": {
|
|
215
|
+
"opacity": 1,
|
|
216
|
+
"blendMode": "normal"
|
|
217
|
+
},
|
|
218
|
+
"Stretch": {
|
|
219
|
+
"opacity": 1,
|
|
220
|
+
"blendMode": "normal"
|
|
221
|
+
},
|
|
222
|
+
"Stripes": {
|
|
223
|
+
"opacity": 1,
|
|
224
|
+
"blendMode": "normal"
|
|
225
|
+
},
|
|
226
|
+
"Swirl": {
|
|
227
|
+
"opacity": 1,
|
|
228
|
+
"blendMode": "normal"
|
|
229
|
+
},
|
|
230
|
+
"TiltShift": {
|
|
231
|
+
"opacity": 1,
|
|
232
|
+
"blendMode": "normal"
|
|
233
|
+
},
|
|
234
|
+
"Tint": {
|
|
235
|
+
"opacity": 1,
|
|
236
|
+
"blendMode": "normal"
|
|
237
|
+
},
|
|
238
|
+
"Tritone": {
|
|
239
|
+
"opacity": 1,
|
|
240
|
+
"blendMode": "normal"
|
|
241
|
+
},
|
|
242
|
+
"Twirl": {
|
|
243
|
+
"opacity": 1,
|
|
244
|
+
"blendMode": "normal"
|
|
245
|
+
},
|
|
246
|
+
"Vibrance": {
|
|
247
|
+
"opacity": 1,
|
|
248
|
+
"blendMode": "normal"
|
|
249
|
+
},
|
|
250
|
+
"WaveDistortion": {
|
|
251
|
+
"opacity": 1,
|
|
252
|
+
"blendMode": "normal"
|
|
253
|
+
},
|
|
254
|
+
"WebcamTexture": {
|
|
255
|
+
"opacity": 1,
|
|
256
|
+
"blendMode": "normal"
|
|
257
|
+
},
|
|
258
|
+
"ZoomBlur": {
|
|
259
|
+
"opacity": 1,
|
|
260
|
+
"blendMode": "normal"
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
function generatePropString(props, componentType, indent = " ") {
|
|
264
|
+
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
265
|
+
if (key === "maskType" && value === "alpha") return false;
|
|
266
|
+
if (key === "transform" && typeof value === "object") {
|
|
267
|
+
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
268
|
+
}
|
|
269
|
+
const componentDefaults = shaderMetadata[componentType] || {};
|
|
270
|
+
if (componentDefaults.hasOwnProperty(key)) {
|
|
271
|
+
const defaultValue = componentDefaults[key];
|
|
272
|
+
if (value != null && defaultValue != null && typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
273
|
+
return value !== defaultValue;
|
|
274
|
+
}
|
|
275
|
+
if (key === "opacity" && value === 1) return false;
|
|
276
|
+
if (key === "blendMode" && value === "normal") return false;
|
|
277
|
+
return true;
|
|
278
|
+
}).map(([key, value]) => {
|
|
279
|
+
const kebabKey = camelToKebab(key);
|
|
280
|
+
if (key === "transform" && typeof value === "object") {
|
|
281
|
+
const nonDefaultKeys = {};
|
|
282
|
+
for (const k in value) if (value[k] !== DEFAULT_TRANSFORM[k]) nonDefaultKeys[k] = value[k];
|
|
283
|
+
const keys = Object.keys(nonDefaultKeys).sort();
|
|
284
|
+
if (keys.length > 1) return `:${kebabKey}="{\n${indent} ${keys.map((k) => `'${k}':${typeof nonDefaultKeys[k] === "string" ? `'${nonDefaultKeys[k]}'` : nonDefaultKeys[k]}`).join(`,\n${indent} `)}\n${indent} }"`;
|
|
285
|
+
else if (keys.length === 1) {
|
|
286
|
+
const k = keys[0];
|
|
287
|
+
const v = nonDefaultKeys[k];
|
|
288
|
+
return `:${kebabKey}="{'${k}':${typeof v === "string" ? `'${v}'` : v}}"`;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (typeof value === "string") return `${kebabKey}="${value}"`;
|
|
292
|
+
else if (value !== null && typeof value === "object") {
|
|
293
|
+
const roundedValue = { ...value };
|
|
294
|
+
if ("x" in roundedValue && typeof roundedValue.x === "number") roundedValue.x = Math.round(roundedValue.x * 100) / 100;
|
|
295
|
+
if ("y" in roundedValue && typeof roundedValue.y === "number") roundedValue.y = Math.round(roundedValue.y * 100) / 100;
|
|
296
|
+
return `:${kebabKey}="${JSON.stringify(roundedValue).replace(/"/g, "'")}"`;
|
|
297
|
+
} else return `:${kebabKey}="${value}"`;
|
|
298
|
+
}).join("\n" + indent + " ");
|
|
299
|
+
}
|
|
300
|
+
function isIdUsedAsMaskSource(id, allComponents) {
|
|
301
|
+
const flatComponents = [];
|
|
302
|
+
function flattenComponents(components) {
|
|
303
|
+
for (const component of components) {
|
|
304
|
+
flatComponents.push(component);
|
|
305
|
+
if (component.children) flattenComponents(component.children);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
flattenComponents(allComponents);
|
|
309
|
+
return flatComponents.some((component) => component.props?.maskSource === id);
|
|
310
|
+
}
|
|
311
|
+
function generatePresetCode(preset) {
|
|
312
|
+
const generateComponentString = (config, indent = " ") => {
|
|
313
|
+
const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
|
|
314
|
+
let idString = "";
|
|
315
|
+
if (config.id) {
|
|
316
|
+
if (isIdUsedAsMaskSource(config.id, preset.components)) idString = `id="${config.id}"`;
|
|
317
|
+
}
|
|
318
|
+
const attributes = [idString, propString].filter(Boolean).join("\n" + indent + " ");
|
|
319
|
+
if (config.children && config.children.length > 0) {
|
|
320
|
+
const childrenString = config.children.map((child) => generateComponentString(child, indent + " ")).join("\n");
|
|
321
|
+
if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${childrenString}\n${indent}</${config.type}>`;
|
|
322
|
+
else return `${indent}<${config.type}>\n${childrenString}\n${indent}</${config.type}>`;
|
|
323
|
+
} else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}/>`;
|
|
324
|
+
else return `${indent}<${config.type}/>`;
|
|
325
|
+
};
|
|
326
|
+
return `<Shader>\n${preset.components.map((config) => generateComponentString(config)).join("\n")}\n</Shader>`;
|
|
327
|
+
}
|
|
328
|
+
const availableComponents = [
|
|
329
|
+
"AngularBlur",
|
|
330
|
+
"Ascii",
|
|
331
|
+
"Beam",
|
|
332
|
+
"Blob",
|
|
333
|
+
"Blur",
|
|
334
|
+
"BrightnessContrast",
|
|
335
|
+
"Bulge",
|
|
336
|
+
"CRTScreen",
|
|
337
|
+
"ChannelBlur",
|
|
338
|
+
"Checkerboard",
|
|
339
|
+
"ChromaFlow",
|
|
340
|
+
"ChromaticAberration",
|
|
341
|
+
"Circle",
|
|
342
|
+
"CursorTrail",
|
|
343
|
+
"DiffuseBlur",
|
|
344
|
+
"Dither",
|
|
345
|
+
"DotGrid",
|
|
346
|
+
"Duotone",
|
|
347
|
+
"FilmGrain",
|
|
348
|
+
"FloatingParticles",
|
|
349
|
+
"GlassTiles",
|
|
350
|
+
"Glow",
|
|
351
|
+
"Godrays",
|
|
352
|
+
"Grayscale",
|
|
353
|
+
"Grid",
|
|
354
|
+
"GridDistortion",
|
|
355
|
+
"Group",
|
|
356
|
+
"Halftone",
|
|
357
|
+
"HueShift",
|
|
358
|
+
"ImageTexture",
|
|
359
|
+
"Invert",
|
|
360
|
+
"LinearBlur",
|
|
361
|
+
"LinearGradient",
|
|
362
|
+
"Liquify",
|
|
363
|
+
"Perspective",
|
|
364
|
+
"Pixelate",
|
|
365
|
+
"PolarCoordinates",
|
|
366
|
+
"Posterize",
|
|
367
|
+
"ProgressiveBlur",
|
|
368
|
+
"RadialGradient",
|
|
369
|
+
"RectangularCoordinates",
|
|
370
|
+
"Ripples",
|
|
371
|
+
"Saturation",
|
|
372
|
+
"Sharpness",
|
|
373
|
+
"Shatter",
|
|
374
|
+
"SimplexNoise",
|
|
375
|
+
"SineWave",
|
|
376
|
+
"SolidColor",
|
|
377
|
+
"Spherize",
|
|
378
|
+
"Spiral",
|
|
379
|
+
"Strands",
|
|
380
|
+
"Stretch",
|
|
381
|
+
"Stripes",
|
|
382
|
+
"Swirl",
|
|
383
|
+
"TiltShift",
|
|
384
|
+
"Tint",
|
|
385
|
+
"Tritone",
|
|
386
|
+
"Twirl",
|
|
387
|
+
"Vibrance",
|
|
388
|
+
"WaveDistortion",
|
|
389
|
+
"WebcamTexture",
|
|
390
|
+
"ZoomBlur"
|
|
391
|
+
];
|
|
2
392
|
export { availableComponents, generatePresetCode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaders",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.44",
|
|
4
4
|
"description": "Declarative shader components for Vue, React, and Svelte",
|
|
5
5
|
"author": "Simon Le Marchant<https://github.com/marchantweb>",
|
|
6
6
|
"homepage": "https://shaders.com/",
|
|
@@ -364,6 +364,11 @@
|
|
|
364
364
|
"types": "./dist/core/shaders/Shatter/index.d.ts",
|
|
365
365
|
"import": "./dist/core/shaders/Shatter/index.js",
|
|
366
366
|
"require": "./dist/core/shaders/Shatter/index.js"
|
|
367
|
+
},
|
|
368
|
+
"./core/WebcamTexture": {
|
|
369
|
+
"types": "./dist/core/shaders/WebcamTexture/index.d.ts",
|
|
370
|
+
"import": "./dist/core/shaders/WebcamTexture/index.js",
|
|
371
|
+
"require": "./dist/core/shaders/WebcamTexture/index.js"
|
|
367
372
|
}
|
|
368
373
|
},
|
|
369
374
|
"typesVersions": {
|
|
@@ -581,6 +586,9 @@
|
|
|
581
586
|
"core/WaveDistortion": [
|
|
582
587
|
"./dist/core/shaders/WaveDistortion/index.d.ts"
|
|
583
588
|
],
|
|
589
|
+
"core/WebcamTexture": [
|
|
590
|
+
"./dist/core/shaders/WebcamTexture/index.d.ts"
|
|
591
|
+
],
|
|
584
592
|
"core/ZoomBlur": [
|
|
585
593
|
"./dist/core/shaders/ZoomBlur/index.d.ts"
|
|
586
594
|
],
|