shaders 2.2.43 → 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.
Files changed (274) hide show
  1. package/dist/core/index.d.ts +0 -2
  2. package/dist/core/index.d.ts.map +1 -1
  3. package/dist/core/index.js +8 -170
  4. package/dist/core/registry.d.ts +10 -0
  5. package/dist/core/registry.d.ts.map +1 -0
  6. package/dist/core/registry.js +166 -0
  7. package/dist/react/AngularBlur.js +144 -0
  8. package/dist/react/Ascii.js +144 -0
  9. package/dist/react/Beam.js +144 -0
  10. package/dist/react/Blob.js +144 -0
  11. package/dist/react/Blur.js +144 -0
  12. package/dist/react/BrightnessContrast.js +144 -0
  13. package/dist/react/Bulge.js +144 -0
  14. package/dist/react/CRTScreen.js +144 -0
  15. package/dist/react/ChannelBlur.js +144 -0
  16. package/dist/react/Checkerboard.js +144 -0
  17. package/dist/react/ChromaFlow.js +144 -0
  18. package/dist/react/ChromaticAberration.js +144 -0
  19. package/dist/react/Circle.js +144 -0
  20. package/dist/react/CursorTrail.js +144 -0
  21. package/dist/react/DiffuseBlur.js +144 -0
  22. package/dist/react/Dither.js +144 -0
  23. package/dist/react/DotGrid.js +144 -0
  24. package/dist/react/Duotone.js +144 -0
  25. package/dist/react/FilmGrain.js +144 -0
  26. package/dist/react/FloatingParticles.js +144 -0
  27. package/dist/react/GlassTiles.js +144 -0
  28. package/dist/react/Glow.js +144 -0
  29. package/dist/react/Godrays.js +144 -0
  30. package/dist/react/Grayscale.js +144 -0
  31. package/dist/react/Grid.js +144 -0
  32. package/dist/react/GridDistortion.js +144 -0
  33. package/dist/react/Group.js +144 -0
  34. package/dist/react/Halftone.js +144 -0
  35. package/dist/react/HueShift.js +144 -0
  36. package/dist/react/ImageTexture.js +144 -0
  37. package/dist/react/Invert.js +144 -0
  38. package/dist/react/LinearBlur.js +144 -0
  39. package/dist/react/LinearGradient.js +144 -0
  40. package/dist/react/Liquify.js +144 -0
  41. package/dist/react/Perspective.js +144 -0
  42. package/dist/react/Pixelate.js +144 -0
  43. package/dist/react/PolarCoordinates.js +144 -0
  44. package/dist/react/Posterize.js +144 -0
  45. package/dist/react/ProgressiveBlur.js +144 -0
  46. package/dist/react/RadialGradient.js +144 -0
  47. package/dist/react/RectangularCoordinates.js +144 -0
  48. package/dist/react/Ripples.js +144 -0
  49. package/dist/react/Saturation.js +144 -0
  50. package/dist/react/Shader.js +166 -0
  51. package/dist/react/Sharpness.js +144 -0
  52. package/dist/react/Shatter.js +144 -0
  53. package/dist/react/SimplexNoise.js +144 -0
  54. package/dist/react/SineWave.js +144 -0
  55. package/dist/react/SolidColor.js +144 -0
  56. package/dist/react/Spherize.js +144 -0
  57. package/dist/react/Spiral.js +144 -0
  58. package/dist/react/Strands.js +144 -0
  59. package/dist/react/Stretch.js +144 -0
  60. package/dist/react/Stripes.js +144 -0
  61. package/dist/react/Swirl.js +144 -0
  62. package/dist/react/TiltShift.js +144 -0
  63. package/dist/react/Tint.js +144 -0
  64. package/dist/react/Tritone.js +144 -0
  65. package/dist/react/Twirl.js +144 -0
  66. package/dist/react/Vibrance.js +144 -0
  67. package/dist/react/WaveDistortion.js +144 -0
  68. package/dist/react/WebcamTexture.js +144 -0
  69. package/dist/react/ZoomBlur.js +144 -0
  70. package/dist/react/index.js +64 -8784
  71. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  72. package/dist/react/utils/generatePresetCode.js +392 -1
  73. package/dist/solid/components/AngularBlur.js +148 -0
  74. package/dist/solid/components/Ascii.js +148 -0
  75. package/dist/solid/components/Beam.js +148 -0
  76. package/dist/solid/components/Blob.js +148 -0
  77. package/dist/solid/components/Blur.js +148 -0
  78. package/dist/solid/components/BrightnessContrast.js +148 -0
  79. package/dist/solid/components/Bulge.js +148 -0
  80. package/dist/solid/components/CRTScreen.js +148 -0
  81. package/dist/solid/components/ChannelBlur.js +148 -0
  82. package/dist/solid/components/Checkerboard.js +148 -0
  83. package/dist/solid/components/ChromaFlow.js +148 -0
  84. package/dist/solid/components/ChromaticAberration.js +148 -0
  85. package/dist/solid/components/Circle.js +148 -0
  86. package/dist/solid/components/CursorTrail.js +148 -0
  87. package/dist/solid/components/DiffuseBlur.js +148 -0
  88. package/dist/solid/components/Dither.js +148 -0
  89. package/dist/solid/components/DotGrid.js +148 -0
  90. package/dist/solid/components/Duotone.js +148 -0
  91. package/dist/solid/components/FilmGrain.js +148 -0
  92. package/dist/solid/components/FloatingParticles.js +148 -0
  93. package/dist/solid/components/GlassTiles.js +148 -0
  94. package/dist/solid/components/Glow.js +148 -0
  95. package/dist/solid/components/Godrays.js +148 -0
  96. package/dist/solid/components/Grayscale.js +148 -0
  97. package/dist/solid/components/Grid.js +148 -0
  98. package/dist/solid/components/GridDistortion.js +148 -0
  99. package/dist/solid/components/Group.js +148 -0
  100. package/dist/solid/components/Halftone.js +148 -0
  101. package/dist/solid/components/HueShift.js +148 -0
  102. package/dist/solid/components/ImageTexture.js +148 -0
  103. package/dist/solid/components/Invert.js +148 -0
  104. package/dist/solid/components/LinearBlur.js +148 -0
  105. package/dist/solid/components/LinearGradient.js +148 -0
  106. package/dist/solid/components/Liquify.js +148 -0
  107. package/dist/solid/components/Perspective.js +148 -0
  108. package/dist/solid/components/Pixelate.js +148 -0
  109. package/dist/solid/components/PolarCoordinates.js +148 -0
  110. package/dist/solid/components/Posterize.js +148 -0
  111. package/dist/solid/components/ProgressiveBlur.js +148 -0
  112. package/dist/solid/components/RadialGradient.js +148 -0
  113. package/dist/solid/components/RectangularCoordinates.js +148 -0
  114. package/dist/solid/components/Ripples.js +148 -0
  115. package/dist/solid/components/Saturation.js +148 -0
  116. package/dist/solid/components/Sharpness.js +148 -0
  117. package/dist/solid/components/Shatter.js +148 -0
  118. package/dist/solid/components/SimplexNoise.js +148 -0
  119. package/dist/solid/components/SineWave.js +148 -0
  120. package/dist/solid/components/SolidColor.js +148 -0
  121. package/dist/solid/components/Spherize.js +148 -0
  122. package/dist/solid/components/Spiral.js +148 -0
  123. package/dist/solid/components/Strands.js +148 -0
  124. package/dist/solid/components/Stretch.js +148 -0
  125. package/dist/solid/components/Stripes.js +148 -0
  126. package/dist/solid/components/Swirl.js +148 -0
  127. package/dist/solid/components/TiltShift.js +148 -0
  128. package/dist/solid/components/Tint.js +148 -0
  129. package/dist/solid/components/Tritone.js +148 -0
  130. package/dist/solid/components/Twirl.js +148 -0
  131. package/dist/solid/components/Vibrance.js +148 -0
  132. package/dist/solid/components/WaveDistortion.js +148 -0
  133. package/dist/solid/components/WebcamTexture.js +148 -0
  134. package/dist/solid/components/ZoomBlur.js +148 -0
  135. package/dist/solid/engine/Shader.js +189 -0
  136. package/dist/solid/index.js +126 -8989
  137. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  138. package/dist/solid/utils/generatePresetCode.js +62 -417
  139. package/dist/svelte/generatePresetCode-CtXcoyI0.js +393 -0
  140. package/dist/svelte/index.js +1 -1
  141. package/dist/svelte/utils/generatePresetCode.js +1 -1
  142. package/dist/vue/AngularBlur.js +3 -0
  143. package/dist/vue/AngularBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  144. package/dist/vue/Ascii.js +3 -0
  145. package/dist/vue/Ascii.vue_vue_type_script_setup_true_lang.js +127 -0
  146. package/dist/vue/Beam.js +3 -0
  147. package/dist/vue/Beam.vue_vue_type_script_setup_true_lang.js +132 -0
  148. package/dist/vue/Blob.js +3 -0
  149. package/dist/vue/Blob.vue_vue_type_script_setup_true_lang.js +137 -0
  150. package/dist/vue/Blur.js +3 -0
  151. package/dist/vue/Blur.vue_vue_type_script_setup_true_lang.js +124 -0
  152. package/dist/vue/BrightnessContrast.js +3 -0
  153. package/dist/vue/BrightnessContrast.vue_vue_type_script_setup_true_lang.js +125 -0
  154. package/dist/vue/Bulge.js +3 -0
  155. package/dist/vue/Bulge.vue_vue_type_script_setup_true_lang.js +128 -0
  156. package/dist/vue/CRTScreen.js +3 -0
  157. package/dist/vue/CRTScreen.vue_vue_type_script_setup_true_lang.js +129 -0
  158. package/dist/vue/ChannelBlur.js +3 -0
  159. package/dist/vue/ChannelBlur.vue_vue_type_script_setup_true_lang.js +126 -0
  160. package/dist/vue/Checkerboard.js +3 -0
  161. package/dist/vue/Checkerboard.vue_vue_type_script_setup_true_lang.js +128 -0
  162. package/dist/vue/ChromaFlow.js +3 -0
  163. package/dist/vue/ChromaFlow.vue_vue_type_script_setup_true_lang.js +131 -0
  164. package/dist/vue/ChromaticAberration.js +3 -0
  165. package/dist/vue/ChromaticAberration.vue_vue_type_script_setup_true_lang.js +128 -0
  166. package/dist/vue/Circle.js +3 -0
  167. package/dist/vue/Circle.vue_vue_type_script_setup_true_lang.js +127 -0
  168. package/dist/vue/CursorTrail.js +3 -0
  169. package/dist/vue/CursorTrail.vue_vue_type_script_setup_true_lang.js +129 -0
  170. package/dist/vue/DiffuseBlur.js +3 -0
  171. package/dist/vue/DiffuseBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  172. package/dist/vue/Dither.js +3 -0
  173. package/dist/vue/Dither.vue_vue_type_script_setup_true_lang.js +127 -0
  174. package/dist/vue/DotGrid.js +3 -0
  175. package/dist/vue/DotGrid.vue_vue_type_script_setup_true_lang.js +127 -0
  176. package/dist/vue/Duotone.js +3 -0
  177. package/dist/vue/Duotone.vue_vue_type_script_setup_true_lang.js +127 -0
  178. package/dist/vue/FilmGrain.js +3 -0
  179. package/dist/vue/FilmGrain.vue_vue_type_script_setup_true_lang.js +124 -0
  180. package/dist/vue/FloatingParticles.js +3 -0
  181. package/dist/vue/FloatingParticles.vue_vue_type_script_setup_true_lang.js +134 -0
  182. package/dist/vue/GlassTiles.js +3 -0
  183. package/dist/vue/GlassTiles.vue_vue_type_script_setup_true_lang.js +127 -0
  184. package/dist/vue/Glow.js +3 -0
  185. package/dist/vue/Glow.vue_vue_type_script_setup_true_lang.js +126 -0
  186. package/dist/vue/Godrays.js +3 -0
  187. package/dist/vue/Godrays.vue_vue_type_script_setup_true_lang.js +130 -0
  188. package/dist/vue/Grayscale.js +3 -0
  189. package/dist/vue/Grayscale.vue_vue_type_script_setup_true_lang.js +123 -0
  190. package/dist/vue/Grid.js +3 -0
  191. package/dist/vue/Grid.vue_vue_type_script_setup_true_lang.js +126 -0
  192. package/dist/vue/GridDistortion.js +3 -0
  193. package/dist/vue/GridDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
  194. package/dist/vue/Group.js +3 -0
  195. package/dist/vue/Group.vue_vue_type_script_setup_true_lang.js +123 -0
  196. package/dist/vue/Halftone.js +3 -0
  197. package/dist/vue/Halftone.vue_vue_type_script_setup_true_lang.js +126 -0
  198. package/dist/vue/HueShift.js +3 -0
  199. package/dist/vue/HueShift.vue_vue_type_script_setup_true_lang.js +124 -0
  200. package/dist/vue/ImageTexture.js +3 -0
  201. package/dist/vue/ImageTexture.vue_vue_type_script_setup_true_lang.js +125 -0
  202. package/dist/vue/Invert.js +3 -0
  203. package/dist/vue/Invert.vue_vue_type_script_setup_true_lang.js +123 -0
  204. package/dist/vue/LinearBlur.js +3 -0
  205. package/dist/vue/LinearBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  206. package/dist/vue/LinearGradient.js +3 -0
  207. package/dist/vue/LinearGradient.vue_vue_type_script_setup_true_lang.js +130 -0
  208. package/dist/vue/Liquify.js +3 -0
  209. package/dist/vue/Liquify.vue_vue_type_script_setup_true_lang.js +128 -0
  210. package/dist/vue/Perspective.js +3 -0
  211. package/dist/vue/Perspective.vue_vue_type_script_setup_true_lang.js +130 -0
  212. package/dist/vue/Pixelate.js +3 -0
  213. package/dist/vue/Pixelate.vue_vue_type_script_setup_true_lang.js +124 -0
  214. package/dist/vue/PolarCoordinates.js +3 -0
  215. package/dist/vue/PolarCoordinates.vue_vue_type_script_setup_true_lang.js +128 -0
  216. package/dist/vue/Posterize.js +3 -0
  217. package/dist/vue/Posterize.vue_vue_type_script_setup_true_lang.js +124 -0
  218. package/dist/vue/ProgressiveBlur.js +3 -0
  219. package/dist/vue/ProgressiveBlur.vue_vue_type_script_setup_true_lang.js +127 -0
  220. package/dist/vue/RadialGradient.js +3 -0
  221. package/dist/vue/RadialGradient.vue_vue_type_script_setup_true_lang.js +128 -0
  222. package/dist/vue/RectangularCoordinates.js +3 -0
  223. package/dist/vue/RectangularCoordinates.vue_vue_type_script_setup_true_lang.js +127 -0
  224. package/dist/vue/Ripples.js +3 -0
  225. package/dist/vue/Ripples.vue_vue_type_script_setup_true_lang.js +131 -0
  226. package/dist/vue/Saturation.js +3 -0
  227. package/dist/vue/Saturation.vue_vue_type_script_setup_true_lang.js +124 -0
  228. package/dist/vue/Shader.js +3 -0
  229. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +153 -0
  230. package/dist/vue/Sharpness.js +3 -0
  231. package/dist/vue/Sharpness.vue_vue_type_script_setup_true_lang.js +124 -0
  232. package/dist/vue/Shatter.js +3 -0
  233. package/dist/vue/Shatter.vue_vue_type_script_setup_true_lang.js +132 -0
  234. package/dist/vue/SimplexNoise.js +3 -0
  235. package/dist/vue/SimplexNoise.vue_vue_type_script_setup_true_lang.js +130 -0
  236. package/dist/vue/SineWave.js +3 -0
  237. package/dist/vue/SineWave.vue_vue_type_script_setup_true_lang.js +131 -0
  238. package/dist/vue/SolidColor.js +3 -0
  239. package/dist/vue/SolidColor.vue_vue_type_script_setup_true_lang.js +124 -0
  240. package/dist/vue/Spherize.js +3 -0
  241. package/dist/vue/Spherize.vue_vue_type_script_setup_true_lang.js +130 -0
  242. package/dist/vue/Spiral.js +3 -0
  243. package/dist/vue/Spiral.vue_vue_type_script_setup_true_lang.js +132 -0
  244. package/dist/vue/Strands.js +3 -0
  245. package/dist/vue/Strands.vue_vue_type_script_setup_true_lang.js +132 -0
  246. package/dist/vue/Stretch.js +3 -0
  247. package/dist/vue/Stretch.vue_vue_type_script_setup_true_lang.js +128 -0
  248. package/dist/vue/Stripes.js +3 -0
  249. package/dist/vue/Stripes.vue_vue_type_script_setup_true_lang.js +132 -0
  250. package/dist/vue/Swirl.js +3 -0
  251. package/dist/vue/Swirl.vue_vue_type_script_setup_true_lang.js +129 -0
  252. package/dist/vue/TiltShift.js +3 -0
  253. package/dist/vue/TiltShift.vue_vue_type_script_setup_true_lang.js +128 -0
  254. package/dist/vue/Tint.js +3 -0
  255. package/dist/vue/Tint.vue_vue_type_script_setup_true_lang.js +126 -0
  256. package/dist/vue/Tritone.js +3 -0
  257. package/dist/vue/Tritone.vue_vue_type_script_setup_true_lang.js +128 -0
  258. package/dist/vue/Twirl.js +3 -0
  259. package/dist/vue/Twirl.vue_vue_type_script_setup_true_lang.js +126 -0
  260. package/dist/vue/Vibrance.js +3 -0
  261. package/dist/vue/Vibrance.vue_vue_type_script_setup_true_lang.js +124 -0
  262. package/dist/vue/WaveDistortion.js +3 -0
  263. package/dist/vue/WaveDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
  264. package/dist/vue/WebcamTexture.js +3 -0
  265. package/dist/vue/WebcamTexture.vue_vue_type_script_setup_true_lang.js +125 -0
  266. package/dist/vue/ZoomBlur.js +3 -0
  267. package/dist/vue/ZoomBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  268. package/dist/vue/index.js +64 -7870
  269. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  270. package/dist/vue/utils/generatePresetCode.js +391 -1
  271. package/package.json +1 -1
  272. package/dist/react/generatePresetCode-D0yiVxb4.js +0 -748
  273. package/dist/svelte/generatePresetCode-DUGaV_ym.js +0 -748
  274. package/dist/vue/generatePresetCode-CShQ8TLw.js +0 -747
@@ -1,748 +0,0 @@
1
- var DEFAULT_TRANSFORM = {
2
- offsetX: 0,
3
- offsetY: 0,
4
- rotation: 0,
5
- scale: 1,
6
- anchorX: .5,
7
- anchorY: .5,
8
- edges: "transparent"
9
- };
10
- function toObjectLiteral(obj) {
11
- return `{ ${Object.entries(obj).map(([key, value]) => {
12
- return `${key}: ${typeof value === "string" ? `"${value}"` : value}`;
13
- }).join(", ")} }`;
14
- }
15
- var shaderMetadata = {
16
- "AngularBlur": {
17
- "opacity": 1,
18
- "blendMode": "normal",
19
- "intensity": 20,
20
- "center": {
21
- "x": .5,
22
- "y": .5
23
- }
24
- },
25
- "Ascii": {
26
- "opacity": 1,
27
- "blendMode": "normal",
28
- "characters": "@%#*+=-:.",
29
- "cellSize": 30,
30
- "fontFamily": "JetBrains Mono",
31
- "spacing": 1
32
- },
33
- "Beam": {
34
- "opacity": 1,
35
- "blendMode": "normal",
36
- "startPosition": {
37
- "x": .2,
38
- "y": .5
39
- },
40
- "endPosition": {
41
- "x": .8,
42
- "y": .5
43
- },
44
- "startThickness": .2,
45
- "endThickness": .2,
46
- "startSoftness": .5,
47
- "endSoftness": .5,
48
- "insideColor": "#FF0000",
49
- "outsideColor": "#0000FF",
50
- "colorSpace": "linear"
51
- },
52
- "Blob": {
53
- "opacity": 1,
54
- "blendMode": "normal",
55
- "colorA": "#ff6b35",
56
- "colorB": "#e91e63",
57
- "size": .5,
58
- "deformation": .5,
59
- "softness": .5,
60
- "highlightIntensity": .5,
61
- "highlightX": .3,
62
- "highlightY": -.3,
63
- "highlightZ": .4,
64
- "highlightColor": "#ffe11a",
65
- "speed": .5,
66
- "seed": 1,
67
- "center": {
68
- "x": .5,
69
- "y": .5
70
- },
71
- "colorSpace": "linear"
72
- },
73
- "Blur": {
74
- "opacity": 1,
75
- "blendMode": "normal",
76
- "intensity": 50
77
- },
78
- "BrightnessContrast": {
79
- "opacity": 1,
80
- "blendMode": "normal",
81
- "brightness": 0,
82
- "contrast": 0
83
- },
84
- "Bulge": {
85
- "opacity": 1,
86
- "blendMode": "normal",
87
- "center": {
88
- "x": .5,
89
- "y": .5
90
- },
91
- "strength": 1,
92
- "radius": 1,
93
- "falloff": .5,
94
- "edges": "stretch"
95
- },
96
- "ChannelBlur": {
97
- "opacity": 1,
98
- "blendMode": "normal",
99
- "redIntensity": 0,
100
- "greenIntensity": 20,
101
- "blueIntensity": 40
102
- },
103
- "Checkerboard": {
104
- "opacity": 1,
105
- "blendMode": "normal",
106
- "colorA": "#cccccc",
107
- "colorB": "#999999",
108
- "cells": 8,
109
- "softness": 0,
110
- "colorSpace": "linear"
111
- },
112
- "ChromaFlow": {
113
- "opacity": 1,
114
- "blendMode": "normal",
115
- "baseColor": "#0066ff",
116
- "upColor": "#00ff00",
117
- "downColor": "#ff0000",
118
- "leftColor": "#0000ff",
119
- "rightColor": "#ffff00",
120
- "intensity": 1,
121
- "radius": 2,
122
- "momentum": 30
123
- },
124
- "ChromaticAberration": {
125
- "opacity": 1,
126
- "blendMode": "normal",
127
- "strength": .2,
128
- "angle": 0,
129
- "redOffset": -1,
130
- "greenOffset": 0,
131
- "blueOffset": 1
132
- },
133
- "Circle": {
134
- "opacity": 1,
135
- "blendMode": "normal",
136
- "color": "#ffffff",
137
- "radius": 1,
138
- "softness": 0,
139
- "center": {
140
- "x": .5,
141
- "y": .5
142
- }
143
- },
144
- "CRTScreen": {
145
- "opacity": 1,
146
- "blendMode": "normal",
147
- "pixelSize": 128,
148
- "colorShift": 1,
149
- "scanlineIntensity": .3,
150
- "scanlineFrequency": 200,
151
- "brightness": 1.1,
152
- "contrast": 1.2
153
- },
154
- "CursorTrail": {
155
- "opacity": 1,
156
- "blendMode": "normal",
157
- "colorA": "#00aaff",
158
- "colorB": "#ff00aa",
159
- "radius": .5,
160
- "length": .5,
161
- "shrink": 1,
162
- "colorSpace": "linear"
163
- },
164
- "DiffuseBlur": {
165
- "opacity": 1,
166
- "blendMode": "normal",
167
- "intensity": 30,
168
- "edges": "stretch"
169
- },
170
- "Dither": {
171
- "opacity": 1,
172
- "blendMode": "normal",
173
- "pixelSize": 4,
174
- "threshold": .5,
175
- "colorA": "transparent",
176
- "colorB": "#ffffff"
177
- },
178
- "DotGrid": {
179
- "opacity": 1,
180
- "blendMode": "normal",
181
- "color": "#ffffff",
182
- "density": 100,
183
- "dotSize": .3,
184
- "twinkle": 0
185
- },
186
- "Duotone": {
187
- "opacity": 1,
188
- "blendMode": "normal",
189
- "colorA": "#ff0000",
190
- "colorB": "#023af4",
191
- "blend": .5,
192
- "colorSpace": "linear"
193
- },
194
- "FilmGrain": {
195
- "opacity": 1,
196
- "blendMode": "normal",
197
- "strength": .5
198
- },
199
- "FloatingParticles": {
200
- "opacity": 1,
201
- "blendMode": "normal",
202
- "randomness": .25,
203
- "speed": .25,
204
- "angle": 90,
205
- "particleSize": 1,
206
- "particleSoftness": 0,
207
- "twinkle": .5,
208
- "count": 5,
209
- "particleColor": "#ffffff",
210
- "speedVariance": .3,
211
- "angleVariance": 30,
212
- "particleDensity": 3
213
- },
214
- "GlassTiles": {
215
- "opacity": 1,
216
- "blendMode": "normal",
217
- "intensity": 2,
218
- "tileCount": 20,
219
- "rotation": 0,
220
- "roundness": 0
221
- },
222
- "Glow": {
223
- "opacity": 1,
224
- "blendMode": "normal",
225
- "intensity": 1,
226
- "threshold": .5,
227
- "size": 10
228
- },
229
- "Godrays": {
230
- "opacity": 1,
231
- "blendMode": "normal",
232
- "center": {
233
- "x": 0,
234
- "y": 0
235
- },
236
- "density": .3,
237
- "intensity": .8,
238
- "spotty": 1,
239
- "speed": .5,
240
- "rayColor": "#4283fb",
241
- "backgroundColor": "transparent"
242
- },
243
- "Grayscale": {
244
- "opacity": 1,
245
- "blendMode": "normal"
246
- },
247
- "Grid": {
248
- "opacity": 1,
249
- "blendMode": "normal",
250
- "color": "#ffffff",
251
- "cells": 10,
252
- "thickness": 1
253
- },
254
- "GridDistortion": {
255
- "opacity": 1,
256
- "blendMode": "normal",
257
- "intensity": 1,
258
- "swirl": 0,
259
- "decay": 3,
260
- "radius": 1,
261
- "gridSize": 20,
262
- "edges": "stretch"
263
- },
264
- "Group": {
265
- "opacity": 1,
266
- "blendMode": "normal"
267
- },
268
- "Halftone": {
269
- "opacity": 1,
270
- "blendMode": "normal",
271
- "frequency": 100,
272
- "angle": 45,
273
- "smoothness": .1
274
- },
275
- "HueShift": {
276
- "opacity": 1,
277
- "blendMode": "normal",
278
- "shift": 0
279
- },
280
- "ImageTexture": {
281
- "opacity": 1,
282
- "blendMode": "normal",
283
- "url": "https://shaders.com/sample.jpg",
284
- "objectFit": "cover"
285
- },
286
- "Invert": {
287
- "opacity": 1,
288
- "blendMode": "normal"
289
- },
290
- "LinearBlur": {
291
- "opacity": 1,
292
- "blendMode": "normal",
293
- "intensity": 30,
294
- "angle": 0
295
- },
296
- "LinearGradient": {
297
- "opacity": 1,
298
- "blendMode": "normal",
299
- "colorA": "#1aff00",
300
- "colorB": "#0000ff",
301
- "start": {
302
- "x": 0,
303
- "y": .5
304
- },
305
- "end": {
306
- "x": 1,
307
- "y": .5
308
- },
309
- "angle": 0,
310
- "edges": "stretch",
311
- "colorSpace": "linear"
312
- },
313
- "Liquify": {
314
- "opacity": 1,
315
- "blendMode": "normal",
316
- "intensity": 1,
317
- "swirl": 0,
318
- "decay": 3,
319
- "radius": 1,
320
- "edges": "stretch"
321
- },
322
- "Perspective": {
323
- "opacity": 1,
324
- "blendMode": "normal",
325
- "center": {
326
- "x": .5,
327
- "y": .5
328
- },
329
- "pan": 0,
330
- "tilt": 0,
331
- "fov": 60,
332
- "zoom": 1,
333
- "offset": {
334
- "x": .5,
335
- "y": .5
336
- },
337
- "edges": "transparent"
338
- },
339
- "Pixelate": {
340
- "opacity": 1,
341
- "blendMode": "normal",
342
- "scale": 50
343
- },
344
- "PolarCoordinates": {
345
- "opacity": 1,
346
- "blendMode": "normal",
347
- "center": {
348
- "x": .5,
349
- "y": .5
350
- },
351
- "wrap": 1,
352
- "radius": 1,
353
- "intensity": 1,
354
- "edges": "transparent"
355
- },
356
- "Posterize": {
357
- "opacity": 1,
358
- "blendMode": "normal",
359
- "intensity": 5
360
- },
361
- "ProgressiveBlur": {
362
- "opacity": 1,
363
- "blendMode": "normal",
364
- "intensity": 50,
365
- "angle": 0,
366
- "center": {
367
- "x": 0,
368
- "y": .5
369
- },
370
- "falloff": 1
371
- },
372
- "RadialGradient": {
373
- "opacity": 1,
374
- "blendMode": "normal",
375
- "colorA": "#ff0000",
376
- "colorB": "#0000ff",
377
- "center": {
378
- "x": .5,
379
- "y": .5
380
- },
381
- "radius": 1,
382
- "colorSpace": "linear"
383
- },
384
- "RectangularCoordinates": {
385
- "opacity": 1,
386
- "blendMode": "normal",
387
- "center": {
388
- "x": .5,
389
- "y": .5
390
- },
391
- "scale": 1,
392
- "intensity": 1,
393
- "edges": "transparent"
394
- },
395
- "Ripples": {
396
- "opacity": 1,
397
- "blendMode": "normal",
398
- "center": {
399
- "x": .5,
400
- "y": .5
401
- },
402
- "colorA": "#ffffff",
403
- "colorB": "#000000",
404
- "speed": 1,
405
- "frequency": 20,
406
- "softness": 0,
407
- "thickness": .5,
408
- "phase": 0
409
- },
410
- "Saturation": {
411
- "opacity": 1,
412
- "blendMode": "normal",
413
- "intensity": 1
414
- },
415
- "Sharpness": {
416
- "opacity": 1,
417
- "blendMode": "normal",
418
- "sharpness": 0
419
- },
420
- "Shatter": {
421
- "opacity": 1,
422
- "blendMode": "normal",
423
- "crackWidth": 1,
424
- "intensity": 4,
425
- "radius": .4,
426
- "decay": 1,
427
- "seed": 2,
428
- "chromaticSplit": 1,
429
- "refractionStrength": 5,
430
- "shardLighting": .1,
431
- "edges": "mirror"
432
- },
433
- "SimplexNoise": {
434
- "opacity": 1,
435
- "blendMode": "normal",
436
- "colorA": "#ffffff",
437
- "colorB": "transparent",
438
- "scale": 2,
439
- "balance": 0,
440
- "contrast": 0,
441
- "seed": 0,
442
- "speed": 1
443
- },
444
- "SineWave": {
445
- "opacity": 1,
446
- "blendMode": "normal",
447
- "color": "#ffffff",
448
- "amplitude": .15,
449
- "frequency": 1,
450
- "speed": 1,
451
- "angle": 0,
452
- "position": {
453
- "x": .5,
454
- "y": .5
455
- },
456
- "thickness": .2,
457
- "softness": .4
458
- },
459
- "SolidColor": {
460
- "opacity": 1,
461
- "blendMode": "normal",
462
- "color": "#5b18ca"
463
- },
464
- "Spherize": {
465
- "opacity": 1,
466
- "blendMode": "normal",
467
- "radius": 1,
468
- "depth": 1,
469
- "center": {
470
- "x": .5,
471
- "y": .5
472
- },
473
- "lightPosition": {
474
- "x": .3,
475
- "y": .3
476
- },
477
- "lightIntensity": .5,
478
- "lightSoftness": .5,
479
- "lightColor": "#ffffff"
480
- },
481
- "Spiral": {
482
- "opacity": 1,
483
- "blendMode": "normal",
484
- "colorA": "#000000",
485
- "colorB": "#ffffff",
486
- "strokeWidth": .5,
487
- "strokeFalloff": 0,
488
- "softness": 0,
489
- "speed": 1,
490
- "center": {
491
- "x": .5,
492
- "y": .5
493
- },
494
- "scale": 1,
495
- "colorSpace": "linear"
496
- },
497
- "Strands": {
498
- "opacity": 1,
499
- "blendMode": "normal",
500
- "speed": .5,
501
- "amplitude": 1,
502
- "frequency": 1,
503
- "lineCount": 12,
504
- "lineWidth": .1,
505
- "waveColor": "#f1c907",
506
- "pinEdges": true,
507
- "start": {
508
- "x": 0,
509
- "y": .5
510
- },
511
- "end": {
512
- "x": 1,
513
- "y": .5
514
- }
515
- },
516
- "Stretch": {
517
- "opacity": 1,
518
- "blendMode": "normal",
519
- "center": {
520
- "x": .5,
521
- "y": .5
522
- },
523
- "strength": 1,
524
- "angle": 0,
525
- "falloff": 0,
526
- "edges": "stretch"
527
- },
528
- "Stripes": {
529
- "opacity": 1,
530
- "blendMode": "normal",
531
- "colorA": "#000000",
532
- "colorB": "#ffffff",
533
- "angle": 45,
534
- "density": 5,
535
- "balance": .5,
536
- "softness": 0,
537
- "speed": .2,
538
- "offset": 0,
539
- "colorSpace": "linear"
540
- },
541
- "Swirl": {
542
- "opacity": 1,
543
- "blendMode": "normal",
544
- "colorA": "#1275d8",
545
- "colorB": "#e19136",
546
- "speed": 1,
547
- "detail": 1,
548
- "blend": 50,
549
- "colorSpace": "linear"
550
- },
551
- "TiltShift": {
552
- "opacity": 1,
553
- "blendMode": "normal",
554
- "intensity": 50,
555
- "width": .3,
556
- "falloff": .3,
557
- "angle": 0,
558
- "center": {
559
- "x": .5,
560
- "y": .5
561
- }
562
- },
563
- "Tint": {
564
- "opacity": 1,
565
- "blendMode": "normal",
566
- "color": "#ff8800",
567
- "amount": .5,
568
- "preserveLuminosity": true
569
- },
570
- "Tritone": {
571
- "opacity": 1,
572
- "blendMode": "normal",
573
- "colorA": "#ce1bea",
574
- "colorB": "#2fff00",
575
- "colorC": "#ffff00",
576
- "blendMid": .5,
577
- "colorSpace": "linear"
578
- },
579
- "Twirl": {
580
- "opacity": 1,
581
- "blendMode": "normal",
582
- "center": {
583
- "x": .5,
584
- "y": .5
585
- },
586
- "intensity": 1,
587
- "edges": "stretch"
588
- },
589
- "Vibrance": {
590
- "opacity": 1,
591
- "blendMode": "normal",
592
- "intensity": 0
593
- },
594
- "WaveDistortion": {
595
- "opacity": 1,
596
- "blendMode": "normal",
597
- "strength": .3,
598
- "frequency": 1,
599
- "speed": 1,
600
- "angle": 0,
601
- "waveType": "sine",
602
- "edges": "stretch"
603
- },
604
- "WebcamTexture": {
605
- "opacity": 1,
606
- "blendMode": "normal",
607
- "objectFit": "cover",
608
- "mirror": true
609
- },
610
- "ZoomBlur": {
611
- "opacity": 1,
612
- "blendMode": "normal",
613
- "intensity": 30,
614
- "center": {
615
- "x": .5,
616
- "y": .5
617
- }
618
- }
619
- };
620
- function generatePropString(props, componentType, indent = " ") {
621
- return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
622
- if (key === "maskType" && value === "alpha") return false;
623
- if (key === "transform" && typeof value === "object") {
624
- if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
625
- }
626
- const componentDefaults = shaderMetadata[componentType] || {};
627
- if (componentDefaults.hasOwnProperty(key)) {
628
- const defaultValue = componentDefaults[key];
629
- if (value != null && defaultValue != null && typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
630
- return value !== defaultValue;
631
- }
632
- if (key === "opacity" && value === 1) return false;
633
- if (key === "blendMode" && value === "normal") return false;
634
- return true;
635
- }).map(([key, value]) => {
636
- if (key === "transform" && typeof value === "object") {
637
- const nonDefaultKeys = {};
638
- for (const k in value) if (value[k] !== DEFAULT_TRANSFORM[k]) nonDefaultKeys[k] = value[k];
639
- const keys = Object.keys(nonDefaultKeys).sort();
640
- if (keys.length > 1) return `${key}={{\n${indent} ${keys.map((k) => `${k}: ${typeof nonDefaultKeys[k] === "string" ? `"${nonDefaultKeys[k]}"` : nonDefaultKeys[k]}`).join(`,\n${indent} `)}\n${indent} }}`;
641
- else if (keys.length === 1) {
642
- const k = keys[0];
643
- const v = nonDefaultKeys[k];
644
- return `${key}={{ ${k}: ${typeof v === "string" ? `"${v}"` : v} }}`;
645
- }
646
- }
647
- if (typeof value === "string") return `${key}="${value}"`;
648
- else if (value !== null && typeof value === "object") {
649
- const roundedValue = { ...value };
650
- if ("x" in roundedValue && typeof roundedValue.x === "number") roundedValue.x = Math.round(roundedValue.x * 100) / 100;
651
- if ("y" in roundedValue && typeof roundedValue.y === "number") roundedValue.y = Math.round(roundedValue.y * 100) / 100;
652
- return `${key}={${toObjectLiteral(roundedValue)}}`;
653
- } else return `${key}={${value}}`;
654
- }).join("\n" + indent + " ");
655
- }
656
- function isIdUsedAsMaskSource(id, allComponents) {
657
- const flatComponents = [];
658
- function flattenComponents(components) {
659
- for (const component of components) {
660
- flatComponents.push(component);
661
- if (component.children) flattenComponents(component.children);
662
- }
663
- }
664
- flattenComponents(allComponents);
665
- return flatComponents.some((component) => component.props?.maskSource === id);
666
- }
667
- function generatePresetCode(preset) {
668
- const generateComponentString = (config, indent = " ") => {
669
- const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
670
- let idString = "";
671
- if (config.id) {
672
- if (isIdUsedAsMaskSource(config.id, preset.components)) idString = `id="${config.id}"`;
673
- }
674
- const attributes = [idString, propString].filter(Boolean).join("\n" + indent + " ");
675
- if (config.children && config.children.length > 0) {
676
- const childrenString = config.children.map((child) => generateComponentString(child, indent + " ")).join("\n");
677
- if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${childrenString}\n${indent}</${config.type}>`;
678
- else return `${indent}<${config.type}>\n${childrenString}\n${indent}</${config.type}>`;
679
- } else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes} />`;
680
- else return `${indent}<${config.type} />`;
681
- };
682
- return `<Shader>\n${preset.components.map((config) => generateComponentString(config)).join("\n")}\n</Shader>`;
683
- }
684
- const availableComponents = [
685
- "AngularBlur",
686
- "Ascii",
687
- "Beam",
688
- "Blob",
689
- "Blur",
690
- "BrightnessContrast",
691
- "Bulge",
692
- "CRTScreen",
693
- "ChannelBlur",
694
- "Checkerboard",
695
- "ChromaFlow",
696
- "ChromaticAberration",
697
- "Circle",
698
- "CursorTrail",
699
- "DiffuseBlur",
700
- "Dither",
701
- "DotGrid",
702
- "Duotone",
703
- "FilmGrain",
704
- "FloatingParticles",
705
- "GlassTiles",
706
- "Glow",
707
- "Godrays",
708
- "Grayscale",
709
- "Grid",
710
- "GridDistortion",
711
- "Group",
712
- "Halftone",
713
- "HueShift",
714
- "ImageTexture",
715
- "Invert",
716
- "LinearBlur",
717
- "LinearGradient",
718
- "Liquify",
719
- "Perspective",
720
- "Pixelate",
721
- "PolarCoordinates",
722
- "Posterize",
723
- "ProgressiveBlur",
724
- "RadialGradient",
725
- "RectangularCoordinates",
726
- "Ripples",
727
- "Saturation",
728
- "Sharpness",
729
- "Shatter",
730
- "SimplexNoise",
731
- "SineWave",
732
- "SolidColor",
733
- "Spherize",
734
- "Spiral",
735
- "Strands",
736
- "Stretch",
737
- "Stripes",
738
- "Swirl",
739
- "TiltShift",
740
- "Tint",
741
- "Tritone",
742
- "Twirl",
743
- "Vibrance",
744
- "WaveDistortion",
745
- "WebcamTexture",
746
- "ZoomBlur"
747
- ];
748
- export { generatePresetCode as n, availableComponents as t };