@votax572002/fluxfx 0.1.5 → 0.1.7
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/README.md +96 -63
- package/dist/fluxfx.min.js +17 -17
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +59 -1
- package/dist/index.d.ts +59 -1
- package/dist/index.js +17 -17
- package/dist/react.cjs +17 -17
- package/dist/react.d.cts +153 -1
- package/dist/react.d.ts +153 -1
- package/dist/react.js +17 -17
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,63 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
# FluxFX
|
|
2
|
+
|
|
3
|
+
FluxFX is a TypeScript animation library for interactive web interfaces. It provides **8 WebGL2 shader effects** and **6 DOM motion effects** for plain HTML, JavaScript, React, Next.js, and Astro.
|
|
4
|
+
|
|
5
|
+
- **WebGL2:** Aurora, Liquid Metal, Fluid, Ink, Aetheria, Prism 3D, Brush Reveal, Spotlight
|
|
6
|
+
- **DOM:** Tilt 3D, Magnetic, Depth Carousel, Motion Scrub, Scroll Path, Card Stack
|
|
7
|
+
- **Integrations:** HTML data attributes, JavaScript API, typed React components, and `useFX`
|
|
8
|
+
- **Controls:** cleanup helpers, reduced-motion support, viewport pausing, and adaptive rendering options
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @votax572002/fluxfx
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
React is an optional peer dependency. Install it separately when using the React entry point:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install react
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick start: HTML
|
|
23
|
+
|
|
24
|
+
Load the CDN bundle and mark an element with `data-fx`. FluxFX initializes it automatically.
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<section data-fx="aurora" data-fx-speed="1" style="min-height: 60vh">
|
|
28
|
+
<h1>Interactive hero</h1>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@votax572002/fluxfx/dist/fluxfx.min.js"></script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For a self-hosted setup, use `dist/fluxfx.min.js` from the installed package.
|
|
35
|
+
|
|
36
|
+
## Quick start: React
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Aurora, Magnetic } from '@votax572002/fluxfx/react';
|
|
40
|
+
|
|
41
|
+
export function Hero() {
|
|
42
|
+
return (
|
|
43
|
+
<Aurora style={{ minHeight: '60vh', padding: '3rem' }}>
|
|
44
|
+
<h1>Interactive hero</h1>
|
|
45
|
+
<Magnetic strength={0.35}>
|
|
46
|
+
<button type="button">Explore</button>
|
|
47
|
+
</Magnetic>
|
|
48
|
+
</Aurora>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
In Next.js, use FluxFX in a Client Component (`'use client'`). See the [React and Next.js guide](https://fluxfx.dev/docs/guides/react-nextjs/).
|
|
54
|
+
|
|
55
|
+
## Quick start: JavaScript API
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { FluxFX } from '@votax572002/fluxfx';
|
|
59
|
+
|
|
60
|
+
const element = document.querySelector<HTMLElement>('#hero');
|
|
61
|
+
|
|
62
|
+
if (element) {
|
|
63
|
+
const cleanup = FluxFX.apply(element, 'aurora', {
|
|
64
|
+
speed: 1.1,
|
|
65
|
+
quality: 'medium',
|
|
66
|
+
colors: ['#4f46e5', '#06b6d4', '#a855f7'],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Call cleanup() when the element is removed.
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`FluxFX.apply()` returns a cleanup function. The engine also provides `init()`, `update()`, `destroyAll()`, and `getStats()`.
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
- [Getting started](https://fluxfx.dev/docs/getting-started/)
|
|
78
|
+
- [Effect gallery](https://fluxfx.dev/docs/effects/)
|
|
79
|
+
- [HTML and CDN guide](https://fluxfx.dev/docs/guides/html/)
|
|
80
|
+
- [React and Next.js guide](https://fluxfx.dev/docs/guides/react-nextjs/)
|
|
81
|
+
- [Astro guide](https://fluxfx.dev/docs/guides/astro/)
|
|
82
|
+
- [Engine API](https://fluxfx.dev/docs/api/)
|
|
83
|
+
- [Architecture](https://fluxfx.dev/docs/architecture/)
|
|
84
|
+
- [Examples](https://fluxfx.dev/docs/examples/)
|
|
85
|
+
|
|
86
|
+
Machine-readable documentation and the coding-agent skill are in [`docs/`](https://github.com/jagguCoder/fluxfx/tree/main/docs), including [`llms.txt`](https://github.com/jagguCoder/fluxfx/blob/main/docs/llms.txt) and the [FluxFX skill](https://github.com/jagguCoder/fluxfx/blob/main/docs/skills/fluxfx/SKILL.md).
|
|
87
|
+
|
|
88
|
+
## Browser support and performance
|
|
89
|
+
|
|
90
|
+
WebGL effects require WebGL2. DOM effects do not create a WebGL context. Worker rendering uses browser capabilities when available and falls back when it cannot. Performance depends on the device, browser, effect, and page workload; test on your target devices and keep essential content usable when motion is reduced or unavailable.
|
|
91
|
+
|
|
92
|
+
## Project links
|
|
93
|
+
|
|
94
|
+
- [Documentation](https://fluxfx.dev/)
|
|
95
|
+
- [GitHub repository](https://github.com/jagguCoder/fluxfx)
|
|
96
|
+
- [npm package](https://www.npmjs.com/package/@votax572002/fluxfx)
|