recoat 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +160 -0
  3. package/dist/index.d.mts +21 -0
  4. package/dist/index.d.ts +21 -0
  5. package/dist/index.js +1407 -0
  6. package/dist/index.mjs +1372 -0
  7. package/dist/text.d.mts +28 -0
  8. package/dist/text.d.ts +28 -0
  9. package/dist/text.js +1473 -0
  10. package/dist/text.mjs +1435 -0
  11. package/dist/three.d.mts +13 -0
  12. package/dist/three.d.ts +13 -0
  13. package/dist/three.js +1732 -0
  14. package/dist/three.mjs +1691 -0
  15. package/dist/types-Clm6ZZVT.d.mts +452 -0
  16. package/dist/types-Clm6ZZVT.d.ts +452 -0
  17. package/package.json +61 -9
  18. package/src/backgrounds/AsciiGrid.ts +208 -0
  19. package/src/backgrounds/Aurora.ts +121 -0
  20. package/src/backgrounds/ChromaticSpace.ts +398 -0
  21. package/src/backgrounds/DeepOcean.ts +385 -0
  22. package/src/backgrounds/FiberNodes.ts +298 -0
  23. package/src/backgrounds/GlitchFog.ts +232 -0
  24. package/src/backgrounds/ImpossibleStairs.ts +262 -0
  25. package/src/backgrounds/Labyrinth.ts +597 -0
  26. package/src/backgrounds/MagneticSand.ts +197 -0
  27. package/src/backgrounds/PixelCity.ts +206 -0
  28. package/src/backgrounds/StaticNoise.ts +160 -0
  29. package/src/backgrounds/Underwater.ts +403 -0
  30. package/src/backgrounds/VoronoiShatter.ts +239 -0
  31. package/src/createBackground.ts +34 -0
  32. package/src/index.ts +10 -0
  33. package/src/text/ChromaticText.ts +191 -0
  34. package/src/text/EchoTrail.ts +143 -0
  35. package/src/text/GlitchText.ts +86 -0
  36. package/src/text/GradientText.ts +68 -0
  37. package/src/text/GravityDrop.ts +200 -0
  38. package/src/text/InkBleed.ts +177 -0
  39. package/src/text/MagneticAssemble.ts +252 -0
  40. package/src/text/MatrixRain.ts +202 -0
  41. package/src/text/NeonPulse.ts +116 -0
  42. package/src/text/ScrambleReveal.ts +95 -0
  43. package/src/text/Typewriter.ts +80 -0
  44. package/src/text/WavyBounce.ts +86 -0
  45. package/src/text.ts +13 -0
  46. package/src/three.ts +6 -0
  47. package/src/types.ts +635 -0
  48. package/index.js +0 -7
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Murat Kamci
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # recoat
2
+
3
+ Animated backgrounds and text effects for the web. Zero dependencies.
4
+
5
+ - **13 Backgrounds** — Canvas-based (zero deps) + Three.js-powered (optional peer dep)
6
+ - **12 Text Animations** — DOM-based text effects, no canvas needed
7
+ - **TypeScript** — Full type definitions included
8
+ - **Tree-shakeable** — ESM + CJS, import only what you use
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install recoat
14
+ ```
15
+
16
+ ## Backgrounds
17
+
18
+ ### Canvas (zero dependencies)
19
+
20
+ ```js
21
+ import { Aurora } from 'recoat';
22
+
23
+ const bg = Aurora({ container: '#my-element' });
24
+ bg.start();
25
+ ```
26
+
27
+ Available: `Aurora`, `AsciiGrid`, `GlitchFog`, `StaticNoise`, `VoronoiShatter`, `MagneticSand`, `PixelCity`, `Underwater`
28
+
29
+ ### Three.js (requires `three` as peer dependency)
30
+
31
+ ```js
32
+ import { Labyrinth } from 'recoat/three';
33
+
34
+ const bg = Labyrinth({ container: '#my-element' });
35
+ bg.start();
36
+ ```
37
+
38
+ Available: `Labyrinth`, `ChromaticSpace`, `ImpossibleStairs`, `FiberNodes`, `DeepOcean`
39
+
40
+ ### Background API
41
+
42
+ Every background returns the same interface:
43
+
44
+ ```ts
45
+ interface BackgroundInstance {
46
+ start(): void;
47
+ stop(): void;
48
+ destroy(): void;
49
+ resize(width: number, height: number): void;
50
+ }
51
+ ```
52
+
53
+ ### Background Config
54
+
55
+ All backgrounds accept a config object:
56
+
57
+ ```ts
58
+ Aurora({
59
+ container: '#hero', // required — element or CSS selector
60
+ width: 1920, // optional — defaults to container width
61
+ height: 1080, // optional — defaults to container height
62
+ responsive: true, // optional — auto-resize on window resize
63
+ // ...effect-specific options (colors, speed, intensity, etc.)
64
+ });
65
+ ```
66
+
67
+ ## Text Animations
68
+
69
+ ```js
70
+ import { GlitchText } from 'recoat/text';
71
+
72
+ const anim = GlitchText({
73
+ element: '#my-heading',
74
+ text: 'Hello World',
75
+ });
76
+ anim.play();
77
+ ```
78
+
79
+ Available: `Typewriter`, `GlitchText`, `ScrambleReveal`, `ChromaticText`, `GradientText`, `NeonPulse`, `WavyBounce`, `MatrixRain`, `GravityDrop`, `InkBleed`, `MagneticAssemble`, `EchoTrail`
80
+
81
+ ### Text Animation API
82
+
83
+ Every text animation returns:
84
+
85
+ ```ts
86
+ interface TextAnimationInstance {
87
+ play(): void;
88
+ reset(): void;
89
+ destroy(): void;
90
+ }
91
+ ```
92
+
93
+ ## Entry Points
94
+
95
+ | Import from | Contents | Dependencies |
96
+ |---|---|---|
97
+ | `recoat` | 8 canvas backgrounds | None |
98
+ | `recoat/three` | 5 Three.js backgrounds | `three` (peer) |
99
+ | `recoat/text` | 12 text animations | None |
100
+
101
+ ## Usage with Frameworks
102
+
103
+ ### React
104
+
105
+ ```jsx
106
+ import { useEffect, useRef } from 'react';
107
+ import { Aurora } from 'recoat';
108
+
109
+ function Hero() {
110
+ const ref = useRef(null);
111
+
112
+ useEffect(() => {
113
+ if (!ref.current) return;
114
+ const bg = Aurora({ container: ref.current });
115
+ bg.start();
116
+ return () => bg.destroy();
117
+ }, []);
118
+
119
+ return <div ref={ref} style={{ width: '100%', height: '100vh' }} />;
120
+ }
121
+ ```
122
+
123
+ ### Vue
124
+
125
+ ```vue
126
+ <script setup>
127
+ import { ref, onMounted, onUnmounted } from 'vue';
128
+ import { Aurora } from 'recoat';
129
+
130
+ const el = ref(null);
131
+ let bg;
132
+
133
+ onMounted(() => {
134
+ bg = Aurora({ container: el.value });
135
+ bg.start();
136
+ });
137
+
138
+ onUnmounted(() => bg?.destroy());
139
+ </script>
140
+
141
+ <template>
142
+ <div ref="el" style="width: 100%; height: 100vh" />
143
+ </template>
144
+ ```
145
+
146
+ ### CDN / Script Tag
147
+
148
+ ```html
149
+ <div id="bg" style="width: 100%; height: 100vh"></div>
150
+
151
+ <script type="module">
152
+ import { Aurora } from 'https://unpkg.com/recoat/dist/index.mjs';
153
+
154
+ Aurora({ container: '#bg' }).start();
155
+ </script>
156
+ ```
157
+
158
+ ## License
159
+
160
+ MIT
@@ -0,0 +1,21 @@
1
+ import { B as BackgroundFactory, a as BackgroundConfig, b as BackgroundInstance, A as AuroraConfig, c as AsciiGridConfig, G as GlitchFogConfig, S as StaticNoiseConfig, V as VoronoiShatterConfig, M as MagneticSandConfig, P as PixelCityConfig, U as UnderwaterConfig } from './types-Clm6ZZVT.mjs';
2
+
3
+ declare function createBackground(factory: BackgroundFactory, config: BackgroundConfig): BackgroundInstance;
4
+
5
+ declare function Aurora(config: AuroraConfig): BackgroundInstance;
6
+
7
+ declare function AsciiGrid(config: AsciiGridConfig): BackgroundInstance;
8
+
9
+ declare function GlitchFog(config: GlitchFogConfig): BackgroundInstance;
10
+
11
+ declare function StaticNoise(config: StaticNoiseConfig): BackgroundInstance;
12
+
13
+ declare function VoronoiShatter(config: VoronoiShatterConfig): BackgroundInstance;
14
+
15
+ declare function MagneticSand(config: MagneticSandConfig): BackgroundInstance;
16
+
17
+ declare function PixelCity(config: PixelCityConfig): BackgroundInstance;
18
+
19
+ declare function Underwater(config: UnderwaterConfig): BackgroundInstance;
20
+
21
+ export { AsciiGrid, AsciiGridConfig, Aurora, AuroraConfig, BackgroundConfig, BackgroundInstance, GlitchFog, GlitchFogConfig, MagneticSand, MagneticSandConfig, PixelCity, PixelCityConfig, StaticNoise, StaticNoiseConfig, Underwater, UnderwaterConfig, VoronoiShatter, VoronoiShatterConfig, createBackground };
@@ -0,0 +1,21 @@
1
+ import { B as BackgroundFactory, a as BackgroundConfig, b as BackgroundInstance, A as AuroraConfig, c as AsciiGridConfig, G as GlitchFogConfig, S as StaticNoiseConfig, V as VoronoiShatterConfig, M as MagneticSandConfig, P as PixelCityConfig, U as UnderwaterConfig } from './types-Clm6ZZVT.js';
2
+
3
+ declare function createBackground(factory: BackgroundFactory, config: BackgroundConfig): BackgroundInstance;
4
+
5
+ declare function Aurora(config: AuroraConfig): BackgroundInstance;
6
+
7
+ declare function AsciiGrid(config: AsciiGridConfig): BackgroundInstance;
8
+
9
+ declare function GlitchFog(config: GlitchFogConfig): BackgroundInstance;
10
+
11
+ declare function StaticNoise(config: StaticNoiseConfig): BackgroundInstance;
12
+
13
+ declare function VoronoiShatter(config: VoronoiShatterConfig): BackgroundInstance;
14
+
15
+ declare function MagneticSand(config: MagneticSandConfig): BackgroundInstance;
16
+
17
+ declare function PixelCity(config: PixelCityConfig): BackgroundInstance;
18
+
19
+ declare function Underwater(config: UnderwaterConfig): BackgroundInstance;
20
+
21
+ export { AsciiGrid, AsciiGridConfig, Aurora, AuroraConfig, BackgroundConfig, BackgroundInstance, GlitchFog, GlitchFogConfig, MagneticSand, MagneticSandConfig, PixelCity, PixelCityConfig, StaticNoise, StaticNoiseConfig, Underwater, UnderwaterConfig, VoronoiShatter, VoronoiShatterConfig, createBackground };