react-native-effects 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +313 -0
  3. package/lib/module/components/Aurora.js +184 -0
  4. package/lib/module/components/Aurora.js.map +1 -0
  5. package/lib/module/components/CalicoSwirl.js +155 -0
  6. package/lib/module/components/CalicoSwirl.js.map +1 -0
  7. package/lib/module/components/Campfire.js +225 -0
  8. package/lib/module/components/Campfire.js.map +1 -0
  9. package/lib/module/components/CircularGradient.js +52 -0
  10. package/lib/module/components/CircularGradient.js.map +1 -0
  11. package/lib/module/components/Iridescence.js +57 -0
  12. package/lib/module/components/Iridescence.js.map +1 -0
  13. package/lib/module/components/LinearGradient.js +48 -0
  14. package/lib/module/components/LinearGradient.js.map +1 -0
  15. package/lib/module/components/LiquidChrome.js +75 -0
  16. package/lib/module/components/LiquidChrome.js.map +1 -0
  17. package/lib/module/components/ShaderView/index.js +252 -0
  18. package/lib/module/components/ShaderView/index.js.map +1 -0
  19. package/lib/module/components/ShaderView/types.js +4 -0
  20. package/lib/module/components/ShaderView/types.js.map +1 -0
  21. package/lib/module/components/ShaderViewWithPanGesture/index.js +196 -0
  22. package/lib/module/components/ShaderViewWithPanGesture/index.js.map +1 -0
  23. package/lib/module/components/Silk.js +83 -0
  24. package/lib/module/components/Silk.js.map +1 -0
  25. package/lib/module/consts.js +154 -0
  26. package/lib/module/consts.js.map +1 -0
  27. package/lib/module/hooks/useClock.js +15 -0
  28. package/lib/module/hooks/useClock.js.map +1 -0
  29. package/lib/module/hooks/useParamsSynchronizable.js +37 -0
  30. package/lib/module/hooks/useParamsSynchronizable.js.map +1 -0
  31. package/lib/module/hooks/useWGPUSetup.js +54 -0
  32. package/lib/module/hooks/useWGPUSetup.js.map +1 -0
  33. package/lib/module/index.js +15 -0
  34. package/lib/module/index.js.map +1 -0
  35. package/lib/module/package.json +1 -0
  36. package/lib/module/shaders/TRIANGLE_VERTEX_SHADER.js +20 -0
  37. package/lib/module/shaders/TRIANGLE_VERTEX_SHADER.js.map +1 -0
  38. package/lib/module/shaders/uniforms.js +21 -0
  39. package/lib/module/shaders/uniforms.js.map +1 -0
  40. package/lib/module/utils/backgroundRuntime.js +12 -0
  41. package/lib/module/utils/backgroundRuntime.js.map +1 -0
  42. package/lib/module/utils/colors.js +94 -0
  43. package/lib/module/utils/colors.js.map +1 -0
  44. package/lib/module/utils/initWebGPU.js +40 -0
  45. package/lib/module/utils/initWebGPU.js.map +1 -0
  46. package/lib/typescript/package.json +1 -0
  47. package/lib/typescript/src/components/Aurora.d.ts +17 -0
  48. package/lib/typescript/src/components/Aurora.d.ts.map +1 -0
  49. package/lib/typescript/src/components/CalicoSwirl.d.ts +13 -0
  50. package/lib/typescript/src/components/CalicoSwirl.d.ts.map +1 -0
  51. package/lib/typescript/src/components/Campfire.d.ts +17 -0
  52. package/lib/typescript/src/components/Campfire.d.ts.map +1 -0
  53. package/lib/typescript/src/components/CircularGradient.d.ts +19 -0
  54. package/lib/typescript/src/components/CircularGradient.d.ts.map +1 -0
  55. package/lib/typescript/src/components/Iridescence.d.ts +11 -0
  56. package/lib/typescript/src/components/Iridescence.d.ts.map +1 -0
  57. package/lib/typescript/src/components/LinearGradient.d.ts +15 -0
  58. package/lib/typescript/src/components/LinearGradient.d.ts.map +1 -0
  59. package/lib/typescript/src/components/LiquidChrome.d.ts +17 -0
  60. package/lib/typescript/src/components/LiquidChrome.d.ts.map +1 -0
  61. package/lib/typescript/src/components/ShaderView/index.d.ts +3 -0
  62. package/lib/typescript/src/components/ShaderView/index.d.ts.map +1 -0
  63. package/lib/typescript/src/components/ShaderView/types.d.ts +35 -0
  64. package/lib/typescript/src/components/ShaderView/types.d.ts.map +1 -0
  65. package/lib/typescript/src/components/ShaderViewWithPanGesture/index.d.ts +35 -0
  66. package/lib/typescript/src/components/ShaderViewWithPanGesture/index.d.ts.map +1 -0
  67. package/lib/typescript/src/components/Silk.d.ts +17 -0
  68. package/lib/typescript/src/components/Silk.d.ts.map +1 -0
  69. package/lib/typescript/src/consts.d.ts +2 -0
  70. package/lib/typescript/src/consts.d.ts.map +1 -0
  71. package/lib/typescript/src/hooks/useClock.d.ts +3 -0
  72. package/lib/typescript/src/hooks/useClock.d.ts.map +1 -0
  73. package/lib/typescript/src/hooks/useParamsSynchronizable.d.ts +22 -0
  74. package/lib/typescript/src/hooks/useParamsSynchronizable.d.ts.map +1 -0
  75. package/lib/typescript/src/hooks/useWGPUSetup.d.ts +15 -0
  76. package/lib/typescript/src/hooks/useWGPUSetup.d.ts.map +1 -0
  77. package/lib/typescript/src/index.d.ts +16 -0
  78. package/lib/typescript/src/index.d.ts.map +1 -0
  79. package/lib/typescript/src/shaders/TRIANGLE_VERTEX_SHADER.d.ts +2 -0
  80. package/lib/typescript/src/shaders/TRIANGLE_VERTEX_SHADER.d.ts.map +1 -0
  81. package/lib/typescript/src/shaders/uniforms.d.ts +6 -0
  82. package/lib/typescript/src/shaders/uniforms.d.ts.map +1 -0
  83. package/lib/typescript/src/utils/backgroundRuntime.d.ts +3 -0
  84. package/lib/typescript/src/utils/backgroundRuntime.d.ts.map +1 -0
  85. package/lib/typescript/src/utils/colors.d.ts +22 -0
  86. package/lib/typescript/src/utils/colors.d.ts.map +1 -0
  87. package/lib/typescript/src/utils/initWebGPU.d.ts +23 -0
  88. package/lib/typescript/src/utils/initWebGPU.d.ts.map +1 -0
  89. package/package.json +175 -7
  90. package/src/components/Aurora.tsx +203 -0
  91. package/src/components/CalicoSwirl.tsx +167 -0
  92. package/src/components/Campfire.tsx +244 -0
  93. package/src/components/CircularGradient.tsx +76 -0
  94. package/src/components/Iridescence.tsx +67 -0
  95. package/src/components/LinearGradient.tsx +62 -0
  96. package/src/components/LiquidChrome.tsx +94 -0
  97. package/src/components/ShaderView/index.tsx +262 -0
  98. package/src/components/ShaderView/types.ts +36 -0
  99. package/src/components/ShaderViewWithPanGesture/index.tsx +225 -0
  100. package/src/components/Silk.tsx +102 -0
  101. package/src/consts.ts +152 -0
  102. package/src/hooks/useClock.ts +20 -0
  103. package/src/hooks/useParamsSynchronizable.ts +52 -0
  104. package/src/hooks/useWGPUSetup.tsx +73 -0
  105. package/src/index.tsx +32 -0
  106. package/src/shaders/TRIANGLE_VERTEX_SHADER.ts +17 -0
  107. package/src/shaders/uniforms.ts +18 -0
  108. package/src/utils/backgroundRuntime.ts +10 -0
  109. package/src/utils/colors.ts +117 -0
  110. package/src/utils/initWebGPU.ts +47 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ export const NAMED_COLORS = {
4
+ // Basic colors
5
+ black: 0x000000,
6
+ white: 0xffffff,
7
+ red: 0xff0000,
8
+ green: 0x008000,
9
+ blue: 0x0000ff,
10
+ yellow: 0xffff00,
11
+ cyan: 0x00ffff,
12
+ magenta: 0xff00ff,
13
+ silver: 0xc0c0c0,
14
+ gray: 0x808080,
15
+ grey: 0x808080,
16
+ maroon: 0x800000,
17
+ olive: 0x808000,
18
+ lime: 0x00ff00,
19
+ aqua: 0x00ffff,
20
+ teal: 0x008080,
21
+ navy: 0x000080,
22
+ fuchsia: 0xff00ff,
23
+ purple: 0x800080,
24
+ // Extended colors
25
+ aliceblue: 0xf0f8ff,
26
+ antiquewhite: 0xfaebd7,
27
+ aquamarine: 0x7fffd4,
28
+ azure: 0xf0ffff,
29
+ beige: 0xf5f5dc,
30
+ bisque: 0xffe4c4,
31
+ blanchedalmond: 0xffebcd,
32
+ blueviolet: 0x8a2be2,
33
+ brown: 0xa52a2a,
34
+ burlywood: 0xdeb887,
35
+ cadetblue: 0x5f9ea0,
36
+ chartreuse: 0x7fff00,
37
+ chocolate: 0xd2691e,
38
+ coral: 0xff7f50,
39
+ cornflowerblue: 0x6495ed,
40
+ cornsilk: 0xfff8dc,
41
+ crimson: 0xdc143c,
42
+ darkblue: 0x00008b,
43
+ darkcyan: 0x008b8b,
44
+ darkgoldenrod: 0xb8860b,
45
+ darkgray: 0xa9a9a9,
46
+ darkgrey: 0xa9a9a9,
47
+ darkgreen: 0x006400,
48
+ darkkhaki: 0xbdb76b,
49
+ darkmagenta: 0x8b008b,
50
+ darkolivegreen: 0x556b2f,
51
+ darkorange: 0xff8c00,
52
+ darkorchid: 0x9932cc,
53
+ darkred: 0x8b0000,
54
+ darksalmon: 0xe9967a,
55
+ darkseagreen: 0x8fbc8f,
56
+ darkslateblue: 0x483d8b,
57
+ darkslategray: 0x2f4f4f,
58
+ darkslategrey: 0x2f4f4f,
59
+ darkturquoise: 0x00ced1,
60
+ darkviolet: 0x9400d3,
61
+ deeppink: 0xff1493,
62
+ deepskyblue: 0x00bfff,
63
+ dimgray: 0x696969,
64
+ dimgrey: 0x696969,
65
+ dodgerblue: 0x1e90ff,
66
+ firebrick: 0xb22222,
67
+ floralwhite: 0xfffaf0,
68
+ forestgreen: 0x228b22,
69
+ gainsboro: 0xdcdcdc,
70
+ ghostwhite: 0xf8f8ff,
71
+ gold: 0xffd700,
72
+ goldenrod: 0xdaa520,
73
+ greenyellow: 0xadff2f,
74
+ honeydew: 0xf0fff0,
75
+ hotpink: 0xff69b4,
76
+ indianred: 0xcd5c5c,
77
+ indigo: 0x4b0082,
78
+ ivory: 0xfffff0,
79
+ khaki: 0xf0e68c,
80
+ lavender: 0xe6e6fa,
81
+ lavenderblush: 0xfff0f5,
82
+ lawngreen: 0x7cfc00,
83
+ lemonchiffon: 0xfffacd,
84
+ lightblue: 0xadd8e6,
85
+ lightcoral: 0xf08080,
86
+ lightcyan: 0xe0ffff,
87
+ lightgoldenrodyellow: 0xfafad2,
88
+ lightgray: 0xd3d3d3,
89
+ lightgrey: 0xd3d3d3,
90
+ lightgreen: 0x90ee90,
91
+ lightpink: 0xffb6c1,
92
+ lightsalmon: 0xffa07a,
93
+ lightseagreen: 0x20b2aa,
94
+ lightskyblue: 0x87cefa,
95
+ lightslategray: 0x778899,
96
+ lightslategrey: 0x778899,
97
+ lightsteelblue: 0xb0c4de,
98
+ lightyellow: 0xffffe0,
99
+ limegreen: 0x32cd32,
100
+ linen: 0xfaf0e6,
101
+ mediumaquamarine: 0x66cdaa,
102
+ mediumblue: 0x0000cd,
103
+ mediumorchid: 0xba55d3,
104
+ mediumpurple: 0x9370db,
105
+ mediumseagreen: 0x3cb371,
106
+ mediumslateblue: 0x7b68ee,
107
+ mediumspringgreen: 0x00fa9a,
108
+ mediumturquoise: 0x48d1cc,
109
+ mediumvioletred: 0xc71585,
110
+ midnightblue: 0x191970,
111
+ mintcream: 0xf5fffa,
112
+ mistyrose: 0xffe4e1,
113
+ moccasin: 0xffe4b5,
114
+ navajowhite: 0xffdead,
115
+ oldlace: 0xfdf5e6,
116
+ olivedrab: 0x6b8e23,
117
+ orange: 0xffa500,
118
+ orangered: 0xff4500,
119
+ orchid: 0xda70d6,
120
+ palegoldenrod: 0xeee8aa,
121
+ palegreen: 0x98fb98,
122
+ paleturquoise: 0xafeeee,
123
+ palevioletred: 0xdb7093,
124
+ papayawhip: 0xffefd5,
125
+ peachpuff: 0xffdab9,
126
+ peru: 0xcd853f,
127
+ pink: 0xffc0cb,
128
+ plum: 0xdda0dd,
129
+ powderblue: 0xb0e0e6,
130
+ rosybrown: 0xbc8f8f,
131
+ royalblue: 0x4169e1,
132
+ saddlebrown: 0x8b4513,
133
+ salmon: 0xfa8072,
134
+ sandybrown: 0xf4a460,
135
+ seagreen: 0x2e8b57,
136
+ seashell: 0xfff5ee,
137
+ sienna: 0xa0522d,
138
+ skyblue: 0x87ceeb,
139
+ slateblue: 0x6a5acd,
140
+ slategray: 0x708090,
141
+ slategrey: 0x708090,
142
+ snow: 0xfffafa,
143
+ springgreen: 0x00ff7f,
144
+ steelblue: 0x4682b4,
145
+ tan: 0xd2b48c,
146
+ thistle: 0xd8bfd8,
147
+ tomato: 0xff6347,
148
+ turquoise: 0x40e0d0,
149
+ violet: 0xee82ee,
150
+ wheat: 0xf5deb3,
151
+ whitesmoke: 0xf5f5f5,
152
+ yellowgreen: 0x9acd32
153
+ };
154
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAMED_COLORS","black","white","red","green","blue","yellow","cyan","magenta","silver","gray","grey","maroon","olive","lime","aqua","teal","navy","fuchsia","purple","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen"],"sourceRoot":"../../src","sources":["consts.ts"],"mappings":";;AAAA,OAAO,MAAMA,YAAoC,GAAG;EAClD;EACAC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,QAAQ;EACfC,GAAG,EAAE,QAAQ;EACbC,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE,QAAQ;EACdC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,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBC,WAAW,EAAE;AACf,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ import { useCallback } from 'react';
4
+ import { useFrameCallback, useSharedValue } from 'react-native-reanimated';
5
+ export function useClock() {
6
+ const clock = useSharedValue(0);
7
+ const callback = useCallback(info => {
8
+ 'worklet';
9
+
10
+ clock.value = info.timeSinceFirstFrame;
11
+ }, [clock]);
12
+ useFrameCallback(callback);
13
+ return clock;
14
+ }
15
+ //# sourceMappingURL=useClock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useFrameCallback","useSharedValue","useClock","clock","callback","info","value","timeSinceFirstFrame"],"sourceRoot":"../../../src","sources":["hooks/useClock.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SACEC,gBAAgB,EAChBC,cAAc,QAGT,yBAAyB;AAEhC,OAAO,SAASC,QAAQA,CAAA,EAAwB;EAC9C,MAAMC,KAAK,GAAGF,cAAc,CAAC,CAAC,CAAC;EAC/B,MAAMG,QAAQ,GAAGL,WAAW,CACzBM,IAAe,IAAK;IACnB,SAAS;;IACTF,KAAK,CAACG,KAAK,GAAGD,IAAI,CAACE,mBAAmB;EACxC,CAAC,EACD,CAACJ,KAAK,CACR,CAAC;EACDH,gBAAgB,CAACI,QAAQ,CAAC;EAC1B,OAAOD,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ import { useCallback, useRef } from 'react';
4
+ import { createSynchronizable } from 'react-native-worklets';
5
+ /**
6
+ * Creates a {@link ParamsSynchronizable} — a 4-float channel written into the
7
+ * dedicated `u.live` slot of a {@link ShaderView} every frame. It has its own
8
+ * uniform slot, so it leaves all 8 static `params` untouched.
9
+ *
10
+ * The returned `setParamsSynchronizable` runs on the JS thread (call it from gesture or scroll
11
+ * handlers); the values are read by the off-thread render loop. By convention
12
+ * the four floats carry `(x, y, active, extra)` for pointer input, or
13
+ * `(progress, ...)` for scroll-driven effects — but the meaning is up to the
14
+ * shader consuming `u.live`.
15
+ *
16
+ * Pass `initial` to seed the channel's starting value (read once on first
17
+ * render), so the shader has a sane resting state before the first update —
18
+ * e.g. `[0.5, 0.5, 0, 0]` to start a pointer at screen center. Defaults to all
19
+ * zeros.
20
+ */
21
+ export function useParamsSynchronizable(initial = [0, 0, 0, 0]) {
22
+ // Lazily create once; `initial` is only a seed, so it is read on first render
23
+ // and ignored thereafter.
24
+ const ref = useRef(null);
25
+ if (ref.current === null) {
26
+ ref.current = createSynchronizable(Float64Array.of(initial[0], initial[1], initial[2], initial[3]));
27
+ }
28
+ const paramsSynchronizable = ref.current;
29
+ const setParamsSynchronizable = useCallback((x, y, active, extra) => {
30
+ paramsSynchronizable.setBlocking(() => Float64Array.of(x, y, active, extra));
31
+ }, [paramsSynchronizable]);
32
+ return {
33
+ paramsSynchronizable,
34
+ setParamsSynchronizable
35
+ };
36
+ }
37
+ //# sourceMappingURL=useParamsSynchronizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useRef","createSynchronizable","useParamsSynchronizable","initial","ref","current","Float64Array","of","paramsSynchronizable","setParamsSynchronizable","x","y","active","extra","setBlocking"],"sourceRoot":"../../../src","sources":["hooks/useParamsSynchronizable.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAC3C,SAASC,oBAAoB,QAAQ,uBAAuB;AAG5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,OAAkD,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EASjE;EACA;EACA;EACA,MAAMC,GAAG,GAAGJ,MAAM,CAA8B,IAAI,CAAC;EACrD,IAAII,GAAG,CAACC,OAAO,KAAK,IAAI,EAAE;IACxBD,GAAG,CAACC,OAAO,GAAGJ,oBAAoB,CAChCK,YAAY,CAACC,EAAE,CAACJ,OAAO,CAAC,CAAC,CAAC,EAAEA,OAAO,CAAC,CAAC,CAAC,EAAEA,OAAO,CAAC,CAAC,CAAC,EAAEA,OAAO,CAAC,CAAC,CAAC,CAChE,CAAC;EACH;EACA,MAAMK,oBAAoB,GAAGJ,GAAG,CAACC,OAAO;EAExC,MAAMI,uBAAuB,GAAGV,WAAW,CACzC,CAACW,CAAS,EAAEC,CAAS,EAAEC,MAAc,EAAEC,KAAa,KAAK;IACvDL,oBAAoB,CAACM,WAAW,CAAC,MAC/BR,YAAY,CAACC,EAAE,CAACG,CAAC,EAAEC,CAAC,EAAEC,MAAM,EAAEC,KAAK,CACrC,CAAC;EACH,CAAC,EACD,CAACL,oBAAoB,CACvB,CAAC;EAED,OAAO;IAAEA,oBAAoB;IAAEC;EAAwB,CAAC;AAC1D","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ import { PixelRatio } from 'react-native';
4
+ import { useCanvasRef } from 'react-native-webgpu';
5
+ import { useEffect, useState } from 'react';
6
+ import { initWebGPU } from "../utils/initWebGPU.js";
7
+ import { BackgroundRuntime } from "../utils/backgroundRuntime.js";
8
+ export function useWGPUSetup() {
9
+ const canvasRef = useCanvasRef();
10
+ const [resources, setResources] = useState(null);
11
+ const runtime = BackgroundRuntime;
12
+ useEffect(() => {
13
+ let cancelled = false;
14
+ (async () => {
15
+ const adapter = await navigator.gpu.requestAdapter();
16
+ if (!adapter || cancelled) {
17
+ return;
18
+ }
19
+ const device = await adapter.requestDevice();
20
+ if (cancelled) {
21
+ return;
22
+ }
23
+ const context = canvasRef.current.getContext('webgpu');
24
+ const canvas = context.canvas;
25
+ const dpr = PixelRatio.get();
26
+ canvas.width = canvas.width * dpr;
27
+ canvas.height = canvas.height * dpr;
28
+ const presentationFormat = navigator.gpu.getPreferredCanvasFormat();
29
+ context.configure({
30
+ device,
31
+ format: presentationFormat,
32
+ alphaMode: 'premultiplied'
33
+ });
34
+ initWebGPU(runtime);
35
+ if (!cancelled) {
36
+ setResources({
37
+ device,
38
+ context,
39
+ presentationFormat
40
+ });
41
+ }
42
+ })();
43
+ return () => {
44
+ cancelled = true;
45
+ };
46
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
+ }, []);
48
+ return {
49
+ canvasRef,
50
+ runtime,
51
+ resources
52
+ };
53
+ }
54
+ //# sourceMappingURL=useWGPUSetup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PixelRatio","useCanvasRef","useEffect","useState","initWebGPU","BackgroundRuntime","useWGPUSetup","canvasRef","resources","setResources","runtime","cancelled","adapter","navigator","gpu","requestAdapter","device","requestDevice","context","current","getContext","canvas","dpr","get","width","height","presentationFormat","getPreferredCanvasFormat","configure","format","alphaMode"],"sourceRoot":"../../../src","sources":["hooks/useWGPUSetup.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SACEC,YAAY,QAGP,qBAAqB;AAC5B,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SAASC,UAAU,QAAQ,wBAAqB;AAChD,SAASC,iBAAiB,QAAQ,+BAA4B;AAc9D,OAAO,SAASC,YAAYA,CAAA,EAAoB;EAC9C,MAAMC,SAAS,GAAGN,YAAY,CAAC,CAAC;EAChC,MAAM,CAACO,SAAS,EAAEC,YAAY,CAAC,GAAGN,QAAQ,CAAsB,IAAI,CAAC;EACrE,MAAMO,OAAO,GAAGL,iBAAiB;EAEjCH,SAAS,CAAC,MAAM;IACd,IAAIS,SAAS,GAAG,KAAK;IAErB,CAAC,YAAY;MACX,MAAMC,OAAO,GAAG,MAAMC,SAAS,CAACC,GAAG,CAACC,cAAc,CAAC,CAAC;MACpD,IAAI,CAACH,OAAO,IAAID,SAAS,EAAE;QACzB;MACF;MAEA,MAAMK,MAAM,GAAG,MAAMJ,OAAO,CAACK,aAAa,CAAC,CAAC;MAC5C,IAAIN,SAAS,EAAE;QACb;MACF;MAEA,MAAMO,OAAO,GAAGX,SAAS,CAACY,OAAO,CAAEC,UAAU,CAAC,QAAQ,CAAE;MACxD,MAAMC,MAAM,GAAGH,OAAO,CAACG,MAGtB;MACD,MAAMC,GAAG,GAAGtB,UAAU,CAACuB,GAAG,CAAC,CAAC;MAC5BF,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACG,KAAK,GAAGF,GAAG;MACjCD,MAAM,CAACI,MAAM,GAAGJ,MAAM,CAACI,MAAM,GAAGH,GAAG;MAEnC,MAAMI,kBAAkB,GAAGb,SAAS,CAACC,GAAG,CAACa,wBAAwB,CAAC,CAAC;MACnET,OAAO,CAACU,SAAS,CAAC;QAChBZ,MAAM;QACNa,MAAM,EAAEH,kBAAkB;QAC1BI,SAAS,EAAE;MACb,CAAC,CAAC;MAEF1B,UAAU,CAACM,OAAO,CAAC;MAEnB,IAAI,CAACC,SAAS,EAAE;QACdF,YAAY,CAAC;UAAEO,MAAM;UAAEE,OAAO;UAAEQ;QAAmB,CAAC,CAAC;MACvD;IACF,CAAC,EAAE,CAAC;IAEJ,OAAO,MAAM;MACXf,SAAS,GAAG,IAAI;IAClB,CAAC;IACD;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEJ,SAAS;IAAEG,OAAO;IAAEF;EAAU,CAAC;AAC1C","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ import CircularGradient from "./components/CircularGradient.js";
4
+ import LinearGradient from "./components/LinearGradient.js";
5
+ import ShaderView from "./components/ShaderView/index.js";
6
+ import ShaderViewWithPanGesture from "./components/ShaderViewWithPanGesture/index.js";
7
+ import Iridescence from "./components/Iridescence.js";
8
+ import LiquidChrome from "./components/LiquidChrome.js";
9
+ import Silk from "./components/Silk.js";
10
+ import Campfire from "./components/Campfire.js";
11
+ import CalicoSwirl from "./components/CalicoSwirl.js";
12
+ import Aurora from "./components/Aurora.js";
13
+ import { useParamsSynchronizable } from "./hooks/useParamsSynchronizable.js";
14
+ export { CircularGradient, LinearGradient, ShaderView, ShaderViewWithPanGesture, Iridescence, LiquidChrome, Silk, Campfire, CalicoSwirl, Aurora, useParamsSynchronizable };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CircularGradient","LinearGradient","ShaderView","ShaderViewWithPanGesture","Iridescence","LiquidChrome","Silk","Campfire","CalicoSwirl","Aurora","useParamsSynchronizable"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,gBAAgB,MAAM,kCAA+B;AAC5D,OAAOC,cAAc,MAAM,gCAA6B;AACxD,OAAOC,UAAU,MAAM,kCAAyB;AAChD,OAAOC,wBAAwB,MAAM,gDAAuC;AAC5E,OAAOC,WAAW,MAAM,6BAA0B;AAClD,OAAOC,YAAY,MAAM,8BAA2B;AACpD,OAAOC,IAAI,MAAM,sBAAmB;AACpC,OAAOC,QAAQ,MAAM,0BAAuB;AAC5C,OAAOC,WAAW,MAAM,6BAA0B;AAClD,OAAOC,MAAM,MAAM,wBAAqB;AACxC,SAASC,uBAAuB,QAAQ,oCAAiC;AASzE,SACEV,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,wBAAwB,EACxBC,WAAW,EACXC,YAAY,EACZC,IAAI,EACJC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,uBAAuB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ export const TRIANGLE_VERTEX_SHADER = /* wgsl */`
4
+ struct VSOut {
5
+ @builtin(position) pos: vec4<f32>,
6
+ @location(0) ndc: vec2<f32>,
7
+ };
8
+
9
+ @vertex
10
+ fn main(@builtin(vertex_index) vid: u32) -> VSOut {
11
+ var p = array<vec2<f32>,3>(
12
+ vec2<f32>(-1.0,-3.0), vec2<f32>(-1.0,1.0), vec2<f32>(3.0,1.0)
13
+ );
14
+ var o: VSOut;
15
+ o.pos = vec4<f32>(p[vid], 0, 1.0);
16
+ o.ndc = p[vid];
17
+ return o;
18
+ }
19
+ `;
20
+ //# sourceMappingURL=TRIANGLE_VERTEX_SHADER.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TRIANGLE_VERTEX_SHADER"],"sourceRoot":"../../../src","sources":["shaders/TRIANGLE_VERTEX_SHADER.ts"],"mappings":";;AAAA,OAAO,MAAMA,sBAAsB,GAAG,UAAW;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ /** 112 bytes = 7 × vec4<f32> */
4
+ export const UNIFORM_BUFFER_SIZE = 112;
5
+
6
+ /** Number of float32 values in the uniform buffer */
7
+ export const UNIFORM_FLOAT_COUNT = UNIFORM_BUFFER_SIZE / 4; // 28
8
+
9
+ export const UNIFORMS_WGSL = /* wgsl */`
10
+ struct Uniforms {
11
+ resolution: vec4<f32>, // (width, height, aspect, pixelRatio)
12
+ time: vec4<f32>, // (seconds, dt, 0, 0)
13
+ color0: vec4<f32>, // colors[0] RGBA
14
+ color1: vec4<f32>, // colors[1] RGBA
15
+ params0: vec4<f32>, // params[0..3]
16
+ params1: vec4<f32>, // params[4..7]
17
+ live: vec4<f32>, // paramsSynchronizable (touch/scroll/audio); (0,0,0,0) when unused
18
+ };
19
+ @group(0) @binding(0) var<uniform> u: Uniforms;
20
+ `;
21
+ //# sourceMappingURL=uniforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UNIFORM_BUFFER_SIZE","UNIFORM_FLOAT_COUNT","UNIFORMS_WGSL"],"sourceRoot":"../../../src","sources":["shaders/uniforms.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,mBAAmB,GAAG,GAAG;;AAEtC;AACA,OAAO,MAAMC,mBAAmB,GAAGD,mBAAmB,GAAG,CAAC,CAAC,CAAC;;AAE5D,OAAO,MAAME,aAAa,GAAG,UAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ import { createWorkletRuntime, scheduleOnRuntime } from 'react-native-worklets';
4
+ export const BackgroundRuntime = createWorkletRuntime({
5
+ name: 'react-native-effects'
6
+ });
7
+ export function runOnBackground(callback) {
8
+ 'worklet';
9
+
10
+ return scheduleOnRuntime(BackgroundRuntime, callback);
11
+ }
12
+ //# sourceMappingURL=backgroundRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createWorkletRuntime","scheduleOnRuntime","BackgroundRuntime","name","runOnBackground","callback"],"sourceRoot":"../../../src","sources":["utils/backgroundRuntime.ts"],"mappings":";;AAAA,SAASA,oBAAoB,EAAEC,iBAAiB,QAAQ,uBAAuB;AAE/E,OAAO,MAAMC,iBAAiB,GAAGF,oBAAoB,CAAC;EACpDG,IAAI,EAAE;AACR,CAAC,CAAC;AAEF,OAAO,SAASC,eAAeA,CAACC,QAAkC,EAAE;EAClE,SAAS;;EACT,OAAOJ,iBAAiB,CAACC,iBAAiB,EAAEG,QAAQ,CAAC;AACvD","ignoreList":[]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ import { NAMED_COLORS } from "../consts.js";
4
+
5
+ /**
6
+ * RGBA color values normalized to 0-1 range
7
+ */
8
+
9
+ /**
10
+ * Converts various color formats to RGBA object
11
+ * @param color - Can be:
12
+ * - Hex number (0xff0000)
13
+ * - Hex string ("#ff0000" or "ff0000")
14
+ * - RGB string ("rgb(255, 0, 0)")
15
+ * - RGBA string ("rgba(255, 0, 0, 0.5)")
16
+ * - Named color ("red", "blue", "purple", etc.)
17
+ * @returns RGBA object with normalized values (0-1), alpha defaults to 1.0 for non-rgba formats
18
+ */
19
+ export function colorToVec4(color) {
20
+ 'worklet';
21
+
22
+ // Handle hex number
23
+ if (typeof color === 'number') {
24
+ return {
25
+ r: (color >> 16 & 0xff) / 255,
26
+ g: (color >> 8 & 0xff) / 255,
27
+ b: (color & 0xff) / 255,
28
+ a: 1.0
29
+ };
30
+ }
31
+ if (typeof color === 'string') {
32
+ const trimmed = color.trim();
33
+
34
+ // Handle rgba() format
35
+ if (trimmed.startsWith('rgba(') && trimmed.endsWith(')')) {
36
+ const rgbaMatch = trimmed.match(/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([0-9.]+)\s*\)/);
37
+ if (!rgbaMatch) {
38
+ throw new Error(`[react-native-effects] Invalid RGBA format: ${color}. Expected rgba(r, g, b, a).`);
39
+ }
40
+ return {
41
+ r: Math.max(0, Math.min(255, parseInt(rgbaMatch[1], 10))) / 255,
42
+ g: Math.max(0, Math.min(255, parseInt(rgbaMatch[2], 10))) / 255,
43
+ b: Math.max(0, Math.min(255, parseInt(rgbaMatch[3], 10))) / 255,
44
+ a: Math.max(0, Math.min(1, parseFloat(rgbaMatch[4])))
45
+ };
46
+ }
47
+
48
+ // Handle rgb() format
49
+ if (trimmed.startsWith('rgb(') && trimmed.endsWith(')')) {
50
+ const rgbMatch = trimmed.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);
51
+ if (!rgbMatch) {
52
+ throw new Error(`[react-native-effects] Invalid RGB format: ${color}. Expected rgb(r, g, b).`);
53
+ }
54
+ return {
55
+ r: Math.max(0, Math.min(255, parseInt(rgbMatch[1], 10))) / 255,
56
+ g: Math.max(0, Math.min(255, parseInt(rgbMatch[2], 10))) / 255,
57
+ b: Math.max(0, Math.min(255, parseInt(rgbMatch[3], 10))) / 255,
58
+ a: 1.0
59
+ };
60
+ }
61
+ const lowerColor = trimmed.toLowerCase();
62
+
63
+ // Handle named colors
64
+ if (lowerColor in NAMED_COLORS) {
65
+ const hexValue = NAMED_COLORS[lowerColor];
66
+ if (hexValue !== undefined) {
67
+ return {
68
+ r: (hexValue >> 16 & 0xff) / 255,
69
+ g: (hexValue >> 8 & 0xff) / 255,
70
+ b: (hexValue & 0xff) / 255,
71
+ a: 1.0
72
+ };
73
+ }
74
+ }
75
+
76
+ // Handle hex string
77
+ const hex = trimmed.replace('#', '');
78
+ if (hex.length !== 6) {
79
+ throw new Error(`[react-native-effects] Invalid hex color: ${color}. Must be 6 characters.`);
80
+ }
81
+ const num = parseInt(hex, 16);
82
+ if (isNaN(num)) {
83
+ throw new Error(`[react-native-effects] Invalid hex color: ${color}. Must be valid hexadecimal.`);
84
+ }
85
+ return {
86
+ r: (num >> 16 & 0xff) / 255,
87
+ g: (num >> 8 & 0xff) / 255,
88
+ b: (num & 0xff) / 255,
89
+ a: 1.0
90
+ };
91
+ }
92
+ throw new Error(`[react-native-effects] Invalid color format: ${color}. Expected hex number, hex string, rgb() string, or named color.`);
93
+ }
94
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NAMED_COLORS","colorToVec4","color","r","g","b","a","trimmed","trim","startsWith","endsWith","rgbaMatch","match","Error","Math","max","min","parseInt","parseFloat","rgbMatch","lowerColor","toLowerCase","hexValue","undefined","hex","replace","length","num","isNaN"],"sourceRoot":"../../../src","sources":["utils/colors.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAW;;AAIxC;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAiB,EAAQ;EACnD,SAAS;;EACT;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO;MACLC,CAAC,EAAE,CAAED,KAAK,IAAI,EAAE,GAAI,IAAI,IAAI,GAAG;MAC/BE,CAAC,EAAE,CAAEF,KAAK,IAAI,CAAC,GAAI,IAAI,IAAI,GAAG;MAC9BG,CAAC,EAAE,CAACH,KAAK,GAAG,IAAI,IAAI,GAAG;MACvBI,CAAC,EAAE;IACL,CAAC;EACH;EAEA,IAAI,OAAOJ,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMK,OAAO,GAAGL,KAA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IAEA,MAAMyB,GAAG,GAAGV,QAAQ,CAACO,GAAG,EAAE,EAAE,CAAC;IAC7B,IAAII,KAAK,CAACD,GAAG,CAAC,EAAE;MACd,MAAM,IAAId,KAAK,CACb,6CAA6CX,KAAK,8BACpD,CAAC;IACH;IAEA,OAAO;MACLC,CAAC,EAAE,CAAEwB,GAAG,IAAI,EAAE,GAAI,IAAI,IAAI,GAAG;MAC7BvB,CAAC,EAAE,CAAEuB,GAAG,IAAI,CAAC,GAAI,IAAI,IAAI,GAAG;MAC5BtB,CAAC,EAAE,CAACsB,GAAG,GAAG,IAAI,IAAI,GAAG;MACrBrB,CAAC,EAAE;IACL,CAAC;EACH;EAEA,MAAM,IAAIO,KAAK,CACb,gDAAgDX,KAAK,kEACvD,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ import { scheduleOnRuntime } from 'react-native-worklets';
4
+
5
+ /**
6
+ * Installs WebGPU globals on the given worklet runtime.
7
+ *
8
+ * Worklet runtimes run on a separate JS context that lacks browser-like globals.
9
+ * This function captures WebGPU constants and `navigator.gpu` from the RN thread
10
+ * and injects them into the worklet's `globalThis` so that WebGPU code can run
11
+ * as if it were in a browser environment.
12
+ *
13
+ * @param runtime - The worklet runtime to initialize
14
+ */
15
+ export function initWebGPU(runtime) {
16
+ const navigator = globalThis.navigator;
17
+ const GPUBufferUsage = globalThis.GPUBufferUsage;
18
+ const GPUColorWrite = globalThis.GPUColorWrite;
19
+ const GPUMapMode = globalThis.GPUMapMode;
20
+ const GPUShaderStage = globalThis.GPUShaderStage;
21
+ const GPUTextureUsage = globalThis.GPUTextureUsage;
22
+ scheduleOnRuntime(runtime, () => {
23
+ 'worklet';
24
+
25
+ if (globalThis.self) {
26
+ return;
27
+ }
28
+ globalThis.self = globalThis;
29
+ globalThis.navigator = {
30
+ gpu: navigator.gpu
31
+ };
32
+ globalThis.GPUBufferUsage = GPUBufferUsage;
33
+ globalThis.GPUColorWrite = GPUColorWrite;
34
+ globalThis.GPUMapMode = GPUMapMode;
35
+ globalThis.GPUShaderStage = GPUShaderStage;
36
+ globalThis.GPUTextureUsage = GPUTextureUsage;
37
+ globalThis.setImmediate = globalThis.requestAnimationFrame;
38
+ });
39
+ }
40
+ //# sourceMappingURL=initWebGPU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["scheduleOnRuntime","initWebGPU","runtime","navigator","globalThis","GPUBufferUsage","GPUColorWrite","GPUMapMode","GPUShaderStage","GPUTextureUsage","self","gpu","setImmediate","requestAnimationFrame"],"sourceRoot":"../../../src","sources":["utils/initWebGPU.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAA6B,uBAAuB;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,OAAuB,EAAE;EAClD,MAAMC,SAAS,GAAGC,UAAU,CAACD,SAAyB;EACtD,MAAME,cAAc,GAAGD,UAAU,CAACC,cAAc;EAChD,MAAMC,aAAa,GAAGF,UAAU,CAACE,aAAa;EAC9C,MAAMC,UAAU,GAAGH,UAAU,CAACG,UAAU;EACxC,MAAMC,cAAc,GAAGJ,UAAU,CAACI,cAAc;EAChD,MAAMC,eAAe,GAAGL,UAAU,CAACK,eAAe;EAElDT,iBAAiB,CAACE,OAAO,EAAE,MAAM;IAC/B,SAAS;;IAET,IAAIE,UAAU,CAACM,IAAI,EAAE;MACnB;IACF;IACAN,UAAU,CAACM,IAAI,GAAGN,UAAU;IAC5BA,UAAU,CAACD,SAAS,GAAG;MAAEQ,GAAG,EAAER,SAAS,CAACQ;IAAI,CAAyB;IACrEP,UAAU,CAACC,cAAc,GAAGA,cAAc;IAC1CD,UAAU,CAACE,aAAa,GAAGA,aAAa;IACxCF,UAAU,CAACG,UAAU,GAAGA,UAAU;IAClCH,UAAU,CAACI,cAAc,GAAGA,cAAc;IAC1CJ,UAAU,CAACK,eAAe,GAAGA,eAAe;IAC5CL,UAAU,CAACQ,YAAY,GACrBR,UAAU,CAACS,qBAA4C;EAC3D,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,17 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { ColorInput } from '../utils/colors';
3
+ type Props = ViewProps & {
4
+ /** Base tint color for the aurora effect. */
5
+ color?: ColorInput;
6
+ /** Animation speed multiplier. Default: 1.0 */
7
+ speed?: number;
8
+ /** Brightness of the aurora bands. Default: 1.0 */
9
+ intensity?: number;
10
+ /** Number of aurora curtain layers (1-5). Default: 3 */
11
+ layers?: number;
12
+ /** How wavy/turbulent the curtains are. Default: 1.0 */
13
+ waviness?: number;
14
+ };
15
+ export default function Aurora({ color, speed, intensity, layers, waviness, ...viewProps }: Props): import("react").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=Aurora.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Aurora.d.ts","sourceRoot":"","sources":["../../../../src/components/Aurora.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,KAAiB,EACjB,KAAW,EACX,SAAe,EACf,MAAY,EACZ,QAAc,EACd,GAAG,SAAS,EACb,EAAE,KAAK,+BAiBP"}
@@ -0,0 +1,13 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { ColorInput } from '../utils/colors';
3
+ type Props = ViewProps & {
4
+ /** The color tint for the calico swirl effect. */
5
+ color?: ColorInput;
6
+ /** Animation speed multiplier. Default: 1.0 */
7
+ speed?: number;
8
+ /** Intensity of the effect. Default: 1.0 */
9
+ intensity?: number;
10
+ };
11
+ export default function CalicoSwirl({ color, speed, intensity, ...viewProps }: Props): import("react").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=CalicoSwirl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalicoSwirl.d.ts","sourceRoot":"","sources":["../../../../src/components/CalicoSwirl.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,kDAAkD;IAClD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAiB,EACjB,KAAW,EACX,SAAe,EACf,GAAG,SAAS,EACb,EAAE,KAAK,+BAcP"}
@@ -0,0 +1,17 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { ColorInput } from '../utils/colors';
3
+ type Props = ViewProps & {
4
+ /** The color tint for the fire effect. */
5
+ color?: ColorInput;
6
+ /** Animation speed multiplier. Default: 1.0 */
7
+ speed?: number;
8
+ /** Size of the sparks. Default: 1.0 */
9
+ sparkSize?: number;
10
+ /** Intensity of the fire. Default: 1.0 */
11
+ fireIntensity?: number;
12
+ /** Intensity of the smoke. Default: 1.0 */
13
+ smokeIntensity?: number;
14
+ };
15
+ export default function Campfire({ color, speed, sparkSize, fireIntensity, smokeIntensity, ...viewProps }: Props): import("react").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=Campfire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Campfire.d.ts","sourceRoot":"","sources":["../../../../src/components/Campfire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAiB,EACjB,KAAW,EACX,SAAe,EACf,aAAmB,EACnB,cAAoB,EACpB,GAAG,SAAS,EACb,EAAE,KAAK,+BAiBP"}
@@ -0,0 +1,19 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { ColorInput } from '../utils/colors';
3
+ type Props = ViewProps & {
4
+ /** The color at the center of the gradient. */
5
+ centerColor: ColorInput;
6
+ /** The color at the edge of the gradient. Default: transparent */
7
+ edgeColor?: ColorInput;
8
+ /** Horizontal center position (0-1). Default: 0.5 */
9
+ centerX?: number;
10
+ /** Vertical center position (0-1). Default: 0.5 */
11
+ centerY?: number;
12
+ /** Horizontal radius. Default: 0.5 */
13
+ sizeX?: number;
14
+ /** Vertical radius. Default: 0.5 */
15
+ sizeY?: number;
16
+ };
17
+ export default function CircularGradient({ centerColor, edgeColor, centerX, centerY, sizeX, sizeY, ...viewProps }: Props): import("react").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=CircularGradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircularGradient.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularGradient.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,+CAA+C;IAC/C,WAAW,EAAE,UAAU,CAAC;IACxB,kEAAkE;IAClE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,WAAW,EACX,SAA2B,EAC3B,OAAa,EACb,OAAa,EACb,KAAW,EACX,KAAW,EACX,GAAG,SAAS,EACb,EAAE,KAAK,+BAmBP"}
@@ -0,0 +1,11 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import type { ColorInput } from '../utils/colors';
3
+ type Props = ViewProps & {
4
+ /** The color tint for the iridescence effect. */
5
+ color?: ColorInput;
6
+ /** Animation speed multiplier. Default: 1.0 */
7
+ speed?: number;
8
+ };
9
+ export default function Iridescence({ color, speed, ...viewProps }: Props): import("react").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=Iridescence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Iridescence.d.ts","sourceRoot":"","sources":["../../../../src/components/Iridescence.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,iDAAiD;IACjD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAiB,EACjB,KAAW,EACX,GAAG,SAAS,EACb,EAAE,KAAK,+BAaP"}