aetheris 0.1.0-alpha.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.
- package/README.md +107 -0
- package/dist/Body-P2dJJsnJ.js +120 -0
- package/dist/Body-P2dJJsnJ.js.map +1 -0
- package/dist/Body-ebC4lyJ7.cjs +2 -0
- package/dist/Body-ebC4lyJ7.cjs.map +1 -0
- package/dist/MotionProvider-CEWupIo9.cjs +2 -0
- package/dist/MotionProvider-CEWupIo9.cjs.map +1 -0
- package/dist/MotionProvider-iE1UXJc6.js +27 -0
- package/dist/MotionProvider-iE1UXJc6.js.map +1 -0
- package/dist/backgrounds/AuroraBackground.d.ts +12 -0
- package/dist/backgrounds/AuroraBackground.d.ts.map +1 -0
- package/dist/backgrounds/GradientMeshBackground.d.ts +13 -0
- package/dist/backgrounds/GradientMeshBackground.d.ts.map +1 -0
- package/dist/backgrounds/index.cjs +2 -0
- package/dist/backgrounds/index.cjs.map +1 -0
- package/dist/backgrounds/index.d.ts +3 -0
- package/dist/backgrounds/index.d.ts.map +1 -0
- package/dist/backgrounds/index.js +118 -0
- package/dist/backgrounds/index.js.map +1 -0
- package/dist/backgrounds.d.ts +1 -0
- package/dist/batching-BN2ZpDzo.cjs +2 -0
- package/dist/batching-BN2ZpDzo.cjs.map +1 -0
- package/dist/batching-vPvT9JKb.js +52 -0
- package/dist/batching-vPvT9JKb.js.map +1 -0
- package/dist/buttons/ParticleBurstButton.d.ts +14 -0
- package/dist/buttons/ParticleBurstButton.d.ts.map +1 -0
- package/dist/buttons/SpringPressButton.d.ts +12 -0
- package/dist/buttons/SpringPressButton.d.ts.map +1 -0
- package/dist/buttons/index.cjs +2 -0
- package/dist/buttons/index.cjs.map +1 -0
- package/dist/buttons/index.d.ts +3 -0
- package/dist/buttons/index.d.ts.map +1 -0
- package/dist/buttons/index.js +137 -0
- package/dist/buttons/index.js.map +1 -0
- package/dist/buttons.d.ts +1 -0
- package/dist/cards/DepthCardPro.d.ts +13 -0
- package/dist/cards/DepthCardPro.d.ts.map +1 -0
- package/dist/cards/index.cjs +2 -0
- package/dist/cards/index.cjs.map +1 -0
- package/dist/cards/index.d.ts +2 -0
- package/dist/cards/index.d.ts.map +1 -0
- package/dist/cards/index.js +59 -0
- package/dist/cards/index.js.map +1 -0
- package/dist/cards.d.ts +1 -0
- package/dist/core/Body.d.ts +16 -0
- package/dist/core/Body.d.ts.map +1 -0
- package/dist/core/ForceField.d.ts +15 -0
- package/dist/core/ForceField.d.ts.map +1 -0
- package/dist/core/MotionOverlay.d.ts +8 -0
- package/dist/core/MotionOverlay.d.ts.map +1 -0
- package/dist/core/MotionProvider.d.ts +14 -0
- package/dist/core/MotionProvider.d.ts.map +1 -0
- package/dist/core/batching.d.ts +23 -0
- package/dist/core/batching.d.ts.map +1 -0
- package/dist/core/easing.d.ts +31 -0
- package/dist/core/easing.d.ts.map +1 -0
- package/dist/core/index.cjs +2 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +223 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/interpolation.d.ts +25 -0
- package/dist/core/interpolation.d.ts.map +1 -0
- package/dist/core/motionValue.d.ts +38 -0
- package/dist/core/motionValue.d.ts.map +1 -0
- package/dist/core/physics.d.ts +22 -0
- package/dist/core/physics.d.ts.map +1 -0
- package/dist/core/physicsWorld.d.ts +39 -0
- package/dist/core/physicsWorld.d.ts.map +1 -0
- package/dist/core/presets.d.ts +27 -0
- package/dist/core/presets.d.ts.map +1 -0
- package/dist/core/ticker.d.ts +21 -0
- package/dist/core/ticker.d.ts.map +1 -0
- package/dist/core/timeline.d.ts +34 -0
- package/dist/core/timeline.d.ts.map +1 -0
- package/dist/core.d.ts +1 -0
- package/dist/cursor/InertiaCursor.d.ts +9 -0
- package/dist/cursor/InertiaCursor.d.ts.map +1 -0
- package/dist/cursor/index.cjs +2 -0
- package/dist/cursor/index.cjs.map +1 -0
- package/dist/cursor/index.d.ts +2 -0
- package/dist/cursor/index.d.ts.map +1 -0
- package/dist/cursor/index.js +52 -0
- package/dist/cursor/index.js.map +1 -0
- package/dist/cursor.d.ts +1 -0
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +21 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAetherisProps.d.ts +19 -0
- package/dist/hooks/useAetherisProps.d.ts.map +1 -0
- package/dist/hooks/useAnimationFrame.d.ts +6 -0
- package/dist/hooks/useAnimationFrame.d.ts.map +1 -0
- package/dist/hooks/useMousePosition.d.ts +10 -0
- package/dist/hooks/useMousePosition.d.ts.map +1 -0
- package/dist/hooks/useReducedMotion.d.ts +7 -0
- package/dist/hooks/useReducedMotion.d.ts.map +1 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hover/GlowBorder.d.ts +14 -0
- package/dist/hover/GlowBorder.d.ts.map +1 -0
- package/dist/hover/MagneticCard.d.ts +14 -0
- package/dist/hover/MagneticCard.d.ts.map +1 -0
- package/dist/hover/index.cjs +2 -0
- package/dist/hover/index.cjs.map +1 -0
- package/dist/hover/index.d.ts +3 -0
- package/dist/hover/index.d.ts.map +1 -0
- package/dist/hover/index.js +115 -0
- package/dist/hover/index.js.map +1 -0
- package/dist/hover.d.ts +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/interpolation-C3PO0EIn.cjs +2 -0
- package/dist/interpolation-C3PO0EIn.cjs.map +1 -0
- package/dist/interpolation-DI9if1ma.js +17 -0
- package/dist/interpolation-DI9if1ma.js.map +1 -0
- package/dist/motionValue-BGCWkNUM.cjs +2 -0
- package/dist/motionValue-BGCWkNUM.cjs.map +1 -0
- package/dist/motionValue-C6kWEIe3.js +63 -0
- package/dist/motionValue-C6kWEIe3.js.map +1 -0
- package/dist/scroll/VelocityReveal.d.ts +12 -0
- package/dist/scroll/VelocityReveal.d.ts.map +1 -0
- package/dist/scroll/index.cjs +2 -0
- package/dist/scroll/index.cjs.map +1 -0
- package/dist/scroll/index.d.ts +2 -0
- package/dist/scroll/index.d.ts.map +1 -0
- package/dist/scroll/index.js +38 -0
- package/dist/scroll/index.js.map +1 -0
- package/dist/scroll.d.ts +1 -0
- package/dist/text/PhysicsSplitText.d.ts +12 -0
- package/dist/text/PhysicsSplitText.d.ts.map +1 -0
- package/dist/text/ScrambleText.d.ts +14 -0
- package/dist/text/ScrambleText.d.ts.map +1 -0
- package/dist/text/SplitTextReveal.d.ts +16 -0
- package/dist/text/SplitTextReveal.d.ts.map +1 -0
- package/dist/text/index.cjs +2 -0
- package/dist/text/index.cjs.map +1 -0
- package/dist/text/index.d.ts +4 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +135 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text.d.ts +1 -0
- package/dist/ticker-DVYSZRUG.cjs +2 -0
- package/dist/ticker-DVYSZRUG.cjs.map +1 -0
- package/dist/ticker-ztuWKiDZ.js +49 -0
- package/dist/ticker-ztuWKiDZ.js.map +1 -0
- package/dist/useAetherisProps-DCvwpEOc.cjs +2 -0
- package/dist/useAetherisProps-DCvwpEOc.cjs.map +1 -0
- package/dist/useAetherisProps-Df5HX2Nd.js +35 -0
- package/dist/useAetherisProps-Df5HX2Nd.js.map +1 -0
- package/dist/useAnimationFrame-CTzG2uLX.cjs +2 -0
- package/dist/useAnimationFrame-CTzG2uLX.cjs.map +1 -0
- package/dist/useAnimationFrame-D_Zb5j5z.js +13 -0
- package/dist/useAnimationFrame-D_Zb5j5z.js.map +1 -0
- package/package.json +110 -0
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Aetheris Motion Platform 🌌
|
|
2
|
+
|
|
3
|
+
> **A Physics-Native Motion Framework for React.**
|
|
4
|
+
|
|
5
|
+
Aetheris is an enterprise-grade, high-performance animation platform that evolves UI motion beyond simple transitions. Built on a custom physics engine and a reactive core, it empowers developers to create fluid, tactile, and GPU-accelerated experiences with zero overhead.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🏗️ Architecture & Philosophy
|
|
10
|
+
|
|
11
|
+
Aetheris is designed with a **Physics-First** approach. Unlike traditional interpolation-based libraries, Aetheris utilizes a real-time solver to calculate motion based on mass, tension, and friction, resulting in interfaces that feel organic and premium.
|
|
12
|
+
|
|
13
|
+
### The Reactive Core
|
|
14
|
+
* **Decentralized MotionValues**: Reactive stores that update at 120Hz+ without triggering React's reconciliation cycle.
|
|
15
|
+
* **Global Ticker**: A centralized `requestAnimationFrame` loop that synchronizes all platform operations.
|
|
16
|
+
* **DOM Batcher**: Intelligent write-batching that eliminates layout thrashing by grouping all mutations into a single frame phase.
|
|
17
|
+
* **Physics World**: A declarative coordinate space where bodies interact with forces (gravity, repulsion, attraction).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## � Project Structure
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
aetheris/
|
|
25
|
+
├── src/
|
|
26
|
+
│ ├── core/ # The Engine: Ticker, Batcher, Physics Solver, MotionValue
|
|
27
|
+
│ ├── hooks/ # Reactive hooks (useAnimationFrame, useAetherisProps)
|
|
28
|
+
│ ├── text/ # Text-based animations (Scramble, Physics Split)
|
|
29
|
+
│ ├── backgrounds/ # GPU-accelerated field & mesh backgrounds
|
|
30
|
+
│ ├── hover/ # Reactive mouse-tracking effects
|
|
31
|
+
│ ├── scroll/ # Momentum-based scroll triggers
|
|
32
|
+
│ ├── buttons/ # Tactile & Particle-based interaction
|
|
33
|
+
│ ├── cards/ # 3D Depth & Parallax systems
|
|
34
|
+
│ └── cursor/ # Physics-based custom cursor followers
|
|
35
|
+
├── dist/ # Optimized production bundles (ESM/CJS)
|
|
36
|
+
└── examples/
|
|
37
|
+
└── playground/ # Interactive showcase & real-time prop editor
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 💎 The Component Library
|
|
43
|
+
|
|
44
|
+
### ✍️ Text
|
|
45
|
+
* **`PhysicsSplitText`**: Characters as physical bodies that settle into place via spring dynamics.
|
|
46
|
+
* **`ScrambleText`**: High-frequency character shuffling for "cybernetic" reveals.
|
|
47
|
+
* **`SplitTextReveal`**: Staggered, smooth arrival for elegant headlines.
|
|
48
|
+
|
|
49
|
+
### 🌌 Backgrounds
|
|
50
|
+
* **`AuroraBackground`**: Atmospheric, fluid CSS-based atmospheric light.
|
|
51
|
+
* **`GradientMeshBackground`**: High-performance Canvas-based animated color fields.
|
|
52
|
+
|
|
53
|
+
### 🖱️ Interaction & Hover
|
|
54
|
+
* **`MagneticCard`**: 3D tilt interaction that attracts toward the cursor.
|
|
55
|
+
* **`GlowBorder`**: Mouse-reactive border tracing with customizable intensity.
|
|
56
|
+
* **`InertiaCursor`**: A custom cursor with physics-based lag and natural momentum.
|
|
57
|
+
|
|
58
|
+
### 📦 Layout & Elements
|
|
59
|
+
* **`DepthCardPro`**: Multi-layered 3D parallax with spring-based inertia.
|
|
60
|
+
* **`SpringPressButton`**: Restitution-based press/release dynamics.
|
|
61
|
+
* **`ParticleBurstButton`**: Physics-based particle explosions on interaction.
|
|
62
|
+
* **`VelocityReveal`**: Elements that skew and reveal based on scroll momentum.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🛠️ Developer Experience (DX)
|
|
67
|
+
|
|
68
|
+
### Engine HUD (`MotionOverlay`)
|
|
69
|
+
Monitor your engine performance in real-time. Toggle `debug` mode in `MotionProvider` to see:
|
|
70
|
+
- Real-time FPS monitoring.
|
|
71
|
+
- Batcher state & Physics optimization status.
|
|
72
|
+
- Force field visualizations.
|
|
73
|
+
|
|
74
|
+
### Global Configuration
|
|
75
|
+
Control your entire application's motion signature from a single provider.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { MotionProvider } from 'aetheris';
|
|
79
|
+
|
|
80
|
+
<MotionProvider config={{
|
|
81
|
+
debug: true,
|
|
82
|
+
intensityMultiplier: 1.2,
|
|
83
|
+
reducedMotion: 'auto'
|
|
84
|
+
}}>
|
|
85
|
+
<App />
|
|
86
|
+
</MotionProvider>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 🎡 Playground 2.0
|
|
92
|
+
The Aetheris Playground (`examples/playground`) is a full-scale sandbox featuring:
|
|
93
|
+
- **Real-time Knobs**: Adjust physics parameters (mass, damping) without reloading.
|
|
94
|
+
- **Physics Visualization**: View body wireframes and force vectors.
|
|
95
|
+
- **Preset Gallery**: Switch between `soft`, `dramatic`, `elastic`, and `cinematic` motion presets.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 🚀 Performance
|
|
100
|
+
- **Tree-shakeable**: Import only what you use via sub-modules (`aetheris/physics`, `aetheris/text`).
|
|
101
|
+
- **GPU Accelerated**: Heavy use of `translate3d`, `will-change`, and Canvas for 60fps+ performance.
|
|
102
|
+
- **SSR Compatible**: Safe for Next.js, Remix, and Gatsby.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 📜 License
|
|
107
|
+
MIT © 2026 Aetheris Framework
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useRef, useMemo, useEffect, useContext, createContext, useId } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { t as ticker } from "./ticker-ztuWKiDZ.js";
|
|
4
|
+
import { m as motionValue } from "./motionValue-C6kWEIe3.js";
|
|
5
|
+
import { b as batcher } from "./batching-vPvT9JKb.js";
|
|
6
|
+
const PhysicsContext = createContext(null);
|
|
7
|
+
const PhysicsWorld = ({
|
|
8
|
+
config = {},
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
const bodies = useRef(/* @__PURE__ */ new Map());
|
|
12
|
+
const forces = useRef(/* @__PURE__ */ new Map());
|
|
13
|
+
const worldConfig = useMemo(() => ({
|
|
14
|
+
gravity: { x: 0, y: 0, ...config.gravity },
|
|
15
|
+
drag: config.drag ?? 0.02
|
|
16
|
+
}), [config]);
|
|
17
|
+
const registerBody = (body) => {
|
|
18
|
+
bodies.current.set(body.id, body);
|
|
19
|
+
forces.current.set(body.id, { x: 0, y: 0 });
|
|
20
|
+
};
|
|
21
|
+
const unregisterBody = (id) => {
|
|
22
|
+
bodies.current.delete(id);
|
|
23
|
+
forces.current.delete(id);
|
|
24
|
+
};
|
|
25
|
+
const applyForce = (id, fx, fy) => {
|
|
26
|
+
const f = forces.current.get(id);
|
|
27
|
+
if (f) {
|
|
28
|
+
f.x += fx;
|
|
29
|
+
f.y += fy;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const update = (_, delta) => {
|
|
34
|
+
const dt = delta / 1e3;
|
|
35
|
+
if (dt <= 0) return;
|
|
36
|
+
bodies.current.forEach((body, id) => {
|
|
37
|
+
const f = forces.current.get(id) || { x: 0, y: 0 };
|
|
38
|
+
const ax = (f.x + worldConfig.gravity.x * body.mass) / body.mass;
|
|
39
|
+
const ay = (f.y + worldConfig.gravity.y * body.mass) / body.mass;
|
|
40
|
+
body.velocity.x += ax * dt;
|
|
41
|
+
body.velocity.y += ay * dt;
|
|
42
|
+
body.velocity.x *= 1 - (body.drag + worldConfig.drag);
|
|
43
|
+
body.velocity.y *= 1 - (body.drag + worldConfig.drag);
|
|
44
|
+
body.position.x.set(body.position.x.get() + body.velocity.x * dt);
|
|
45
|
+
body.position.y.set(body.position.y.get() + body.velocity.y * dt);
|
|
46
|
+
f.x = 0;
|
|
47
|
+
f.y = 0;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
ticker.add(update);
|
|
51
|
+
return () => ticker.remove(update);
|
|
52
|
+
}, [worldConfig]);
|
|
53
|
+
return /* @__PURE__ */ jsx(PhysicsContext.Provider, { value: { registerBody, unregisterBody, applyForce }, children });
|
|
54
|
+
};
|
|
55
|
+
const usePhysics = () => {
|
|
56
|
+
const context = useContext(PhysicsContext);
|
|
57
|
+
if (!context) throw new Error("usePhysics must be used within PhysicsWorld");
|
|
58
|
+
return context;
|
|
59
|
+
};
|
|
60
|
+
const Body = ({
|
|
61
|
+
children,
|
|
62
|
+
mass = 1,
|
|
63
|
+
drag = 0.05,
|
|
64
|
+
restitution = 0.5,
|
|
65
|
+
initialX = 0,
|
|
66
|
+
initialY = 0
|
|
67
|
+
}) => {
|
|
68
|
+
const id = useId();
|
|
69
|
+
const { registerBody, unregisterBody } = usePhysics();
|
|
70
|
+
const elementRef = useRef(null);
|
|
71
|
+
const position = useRef({
|
|
72
|
+
x: motionValue(initialX),
|
|
73
|
+
y: motionValue(initialY)
|
|
74
|
+
}).current;
|
|
75
|
+
const velocity = useRef({ x: 0, y: 0 }).current;
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const body = {
|
|
78
|
+
id,
|
|
79
|
+
position,
|
|
80
|
+
velocity,
|
|
81
|
+
mass,
|
|
82
|
+
restitution,
|
|
83
|
+
drag
|
|
84
|
+
};
|
|
85
|
+
registerBody(body);
|
|
86
|
+
const unsubX = position.x.onChange((x) => {
|
|
87
|
+
batcher.write(() => {
|
|
88
|
+
if (elementRef.current) {
|
|
89
|
+
elementRef.current.style.transform = `translate3d(${x}px, ${position.y.get()}px, 0)`;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
const unsubY = position.y.onChange((y) => {
|
|
94
|
+
batcher.write(() => {
|
|
95
|
+
if (elementRef.current) {
|
|
96
|
+
elementRef.current.style.transform = `translate3d(${position.x.get()}px, ${y}px, 0)`;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
return () => {
|
|
101
|
+
unregisterBody(id);
|
|
102
|
+
unsubX();
|
|
103
|
+
unsubY();
|
|
104
|
+
};
|
|
105
|
+
}, [id, mass, drag, restitution, registerBody, unregisterBody]);
|
|
106
|
+
return React.cloneElement(children, {
|
|
107
|
+
ref: elementRef,
|
|
108
|
+
style: {
|
|
109
|
+
...children.props.style,
|
|
110
|
+
position: "absolute",
|
|
111
|
+
willChange: "transform"
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
Body as B,
|
|
117
|
+
PhysicsWorld as P,
|
|
118
|
+
usePhysics as u
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=Body-P2dJJsnJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Body-P2dJJsnJ.js","sources":["../src/core/physicsWorld.tsx","../src/core/Body.tsx"],"names":[],"mappings":";;;;;AA4BA,MAAM,iBAAiB,cAA0C,IAAI;AAE9D,MAAM,eAAyF,CAAC;AAAA,EACnG,SAAS,CAAA;AAAA,EACT;AACJ,MAAM;AACF,QAAM,SAAS,OAA+B,oBAAI,KAAK;AACvD,QAAM,SAAS,OAA8C,oBAAI,KAAK;AAEtE,QAAM,cAAc,QAAQ,OAAO;AAAA,IAC/B,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,QAAA;AAAA,IACjC,MAAM,OAAO,QAAQ;AAAA,EAAA,IACrB,CAAC,MAAM,CAAC;AAEZ,QAAM,eAAe,CAAC,SAAoB;AACtC,WAAO,QAAQ,IAAI,KAAK,IAAI,IAAI;AAChC,WAAO,QAAQ,IAAI,KAAK,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG;AAAA,EAC9C;AAEA,QAAM,iBAAiB,CAAC,OAAe;AACnC,WAAO,QAAQ,OAAO,EAAE;AACxB,WAAO,QAAQ,OAAO,EAAE;AAAA,EAC5B;AAEA,QAAM,aAAa,CAAC,IAAY,IAAY,OAAe;AACvD,UAA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|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react"),t=require("react/jsx-runtime"),r=require("./ticker-DVYSZRUG.cjs"),s=require("./motionValue-BGCWkNUM.cjs"),i=require("./batching-BN2ZpDzo.cjs"),n=e.createContext(null),o=()=>{const t=e.useContext(n);if(!t)throw new Error("usePhysics must be used within PhysicsWorld");return t};exports.Body=({children:t,mass:r=1,drag:n=.05,restitution:c=.5,initialX:u=0,initialY:a=0})=>{const y=e.useId(),{registerBody:l,unregisterBody:d}=o(),g=e.useRef(null),x=e.useRef({x:s.motionValue(u),y:s.motionValue(a)}).current,p=e.useRef({x:0,y:0}).current;return e.useEffect(()=>{l({id:y,position:x,velocity:p,mass:r,restitution:c,drag:n});const e=x.x.onChange(e=>{i.batcher.write(()=>{g.current&&(g.current.style.transform=`translate3d(${e}px, ${x.y.get()}px, 0)`)})}),t=x.y.onChange(e=>{i.batcher.write(()=>{g.current&&(g.current.style.transform=`translate3d(${x.x.get()}px, ${e}px, 0)`)})});return()=>{d(y),e(),t()}},[y,r,n,c,l,d]),e.cloneElement(t,{ref:g,style:{...t.props.style,position:"absolute",willChange:"transform"}})},exports.PhysicsWorld=({config:s={},children:i})=>{const o=e.useRef(new Map),c=e.useRef(new Map),u=e.useMemo(()=>({gravity:{x:0,y:0,...s.gravity},drag:s.drag??.02}),[s]);return e.useEffect(()=>{const e=(e,t)=>{const r=t/1e3;r<=0||o.current.forEach((e,t)=>{const s=c.current.get(t)||{x:0,y:0},i=(s.y+u.gravity.y*e.mass)/e.mass;e.velocity.x+=(s.x+u.gravity.x*e.mass)/e.mass*r,e.velocity.y+=i*r,e.velocity.x*=1-(e.drag+u.drag),e.velocity.y*=1-(e.drag+u.drag),e.position.x.set(e.position.x.get()+e.velocity.x*r),e.position.y.set(e.position.y.get()+e.velocity.y*r),s.x=0,s.y=0})};return r.ticker.add(e),()=>r.ticker.remove(e)},[u]),t.jsx(n.Provider,{value:{registerBody:e=>{o.current.set(e.id,e),c.current.set(e.id,{x:0,y:0})},unregisterBody:e=>{o.current.delete(e),c.current.delete(e)},applyForce:(e,t,r)=>{const s=c.current.get(e);s&&(s.x+=t,s.y+=r)}},children:i})},exports.usePhysics=o;
|
|
2
|
+
//# sourceMappingURL=Body-ebC4lyJ7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Body-ebC4lyJ7.cjs","sources":["../src/core/physicsWorld.tsx","../src/core/Body.tsx"],"names":["PhysicsContext","createContext","usePhysics","context","useContext","Error","children","mass","drag","restitution","initialX","initialY","id","useId","registerBody","unregisterBody","elementRef","useRef","position","x","motionValue","y","current","velocity","useEffect","unsubX","onChange","batcher","write","style","transform","get","unsubY","React","cloneElement","ref","props","willChange","config","bodies","Map","forces","worldConfig","useMemo","gravity","update","_","delta","dt","forEach","body","f","ay","set","ticker","add","remove","jsx","Provider","value","delete","applyForce","fx","fy"],"mappings":"qLA4BMA,EAAiBC,EAAAA,cAA0C,MAyEpDC,EAAa,KACtB,MAAMC,EAAUC,EAAAA,WAAWJ,GAC3B,IAAKG,EAAS,MAAM,IAAIE,MAAM,+CAC9B,OAAOF,gBCtF8B,EACrCG,WACAC,OAAO,EACPC,OAAO,IACPC,cAAc,GACdC,WAAW,EACXC,WAAW,MAEX,MAAMC,EAAKC,EAAAA,SACLC,aAAEA,EAAAC,eAAcA,GAAmBb,IACnCc,EAAaC,EAAAA,OAAoB,MAEjCC,EAAWD,EAAAA,OAAO,CACpBE,EAAGC,EAAAA,YAAYV,GACfW,EAAGD,EAAAA,YAAYT,KAChBW,QAEGC,EAAWN,EAAAA,OAAO,CAAEE,EAAG,EAAGE,EAAG,IAAKC,QAqCxC,OAnCAE,EAAAA,UAAU,KAUNV,EATwB,CACpBF,KACAM,WACAK,WACAhB,OACAE,cACAD,SAKJ,MAAMiB,EAASP,EAASC,EAAEO,SAAUP,IAChCQ,EAAAA,QAAQC,MAAM,KACNZ,EAAWM,UACXN,EAAWM,QAAQO,MAAMC,UAAY,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ASC,EAAEkC,IAAIH,EAAKhC,SAASC,EAAEY,MAAQmB,EAAK3B,SAASJ,EAAI6B,GAC9DE,EAAKhC,SAASG,EAAEgC,IAAIH,EAAKhC,SAASG,EAAEU,MAAQmB,EAAK3B,SAASF,EAAI2B,GAG9DG,EAAEhC,EAAI,EACNgC,EAAE9B,EAAI,KAKd,OADAiC,EAAAA,OAAOC,IAAIV,GACJ,IAAMS,EAAAA,OAAOE,OAAOX,IAC5B,CAACH,IAGAe,MAACzD,EAAe0D,SAAf,CAAwBC,MAAO,CAAE7C,aArDhBoC,IAClBX,EAAOjB,QAAQ+B,IAAIH,EAAKtC,GAAIsC,GAC5BT,EAAOnB,QAAQ+B,IAAIH,EAAKtC,GAAI,CAAEO,EAAG,EAAGE,EAAG,KAmDSN,eAhD5BH,IACpB2B,EAAOjB,QAAQsC,OAAOhD,GACtB6B,EAAOnB,QAAQsC,OAAOhD,IA8C0CiD,WA3CjD,CAACjD,EAAYkD,EAAYC,KACxC,MAAMZ,EAAIV,EAAOnB,QAAQS,IAAInB,GACzBuC,IACAA,EAAEhC,GAAK2C,EACPX,EAAE9B,GAAK0C,KAwCNzD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("react"),o=t.createContext({debug:!1,reducedMotion:"auto",theme:"auto",intensityMultiplier:1});exports.MotionProvider=({config:r={},children:i})=>{const u=t.useMemo(()=>({debug:!1,reducedMotion:"auto",theme:"auto",intensityMultiplier:1,...r}),[r]);return e.jsx(o.Provider,{value:u,children:i})},exports.useMotionConfig=()=>t.useContext(o);
|
|
2
|
+
//# sourceMappingURL=MotionProvider-CEWupIo9.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MotionProvider-CEWupIo9.cjs","sources":["../src/core/MotionProvider.tsx"],"names":["MotionContext","createContext","debug","reducedMotion","theme","intensityMultiplier","config","children","value","useMemo","jsx","Provider","useContext"],"mappings":"qEASMA,EAAgBC,EAAAA,cAA4B,CAC9CC,OAAO,EACPC,cAAe,OACfC,MAAO,OACPC,oBAAqB,2BAGqE,EAC1FC,SAAS,CAAA,EACTC,eAEA,MAAMC,EAAQC,EAAAA,QAAQ,KAAA,CAClBP,OAAO,EACPC,cAAe,OACfC,MAAO,OACPC,oBAAqB,KAClBC,IACH,CAACA,IAEL,SAAOI,IAACV,EAAcW,SAAd,CAAuBH,QAAeD,sCAGnB,IAAMK,EAAAA,WAAWZ"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useContext, createContext } from "react";
|
|
3
|
+
const MotionContext = createContext({
|
|
4
|
+
debug: false,
|
|
5
|
+
reducedMotion: "auto",
|
|
6
|
+
theme: "auto",
|
|
7
|
+
intensityMultiplier: 1
|
|
8
|
+
});
|
|
9
|
+
const MotionProvider = ({
|
|
10
|
+
config = {},
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const value = useMemo(() => ({
|
|
14
|
+
debug: false,
|
|
15
|
+
reducedMotion: "auto",
|
|
16
|
+
theme: "auto",
|
|
17
|
+
intensityMultiplier: 1,
|
|
18
|
+
...config
|
|
19
|
+
}), [config]);
|
|
20
|
+
return /* @__PURE__ */ jsx(MotionContext.Provider, { value, children });
|
|
21
|
+
};
|
|
22
|
+
const useMotionConfig = () => useContext(MotionContext);
|
|
23
|
+
export {
|
|
24
|
+
MotionProvider as M,
|
|
25
|
+
useMotionConfig as u
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=MotionProvider-iE1UXJc6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MotionProvider-iE1UXJc6.js","sources":["../src/core/MotionProvider.tsx"],"names":[],"mappings":";;AASA,MAAM,gBAAgB,cAA4B;AAAA,EAC9C,OAAO;AAAA,EACP,eAAe;AAAA,EACf,OAAO;AAAA,EACP,qBAAqB;AACzB,CAAC;AAEM,MAAM,iBAAiF,CAAC;AAAA,EAC3F,SAAS,CAAA;AAAA,EACT;AACJ,MAAM;AACF,QAAM,QAAQ,QAAQ,OAAO;AAAA,IACzB,OAAO;AAAA,IACP,eAAe;AAAA,IACf,OAAO;AAAA,IACP,qBAAqB;AAAA,IACrB,GAAG;AAAA,EAAA,IACH,CAAC,MAAM,CAAC;AAEZ,SAAO,oBAAC,cAAc,UAAd,EAAuB,OAAe,SAAA,CAAS;AAC3D;AAEO,MAAM,kBAAkB,MAAM,WAAW,aAAa;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseAnimationProps } from '../hooks/useAetherisProps';
|
|
3
|
+
|
|
4
|
+
export interface AuroraBackgroundProps extends BaseAnimationProps {
|
|
5
|
+
colors?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* AuroraBackground
|
|
9
|
+
* A high-end fluid motion background simulating the northern lights.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AuroraBackground: React.FC<AuroraBackgroundProps>;
|
|
12
|
+
//# sourceMappingURL=AuroraBackground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuroraBackground.d.ts","sourceRoot":"","sources":["../../src/backgrounds/AuroraBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEjF,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC7D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAgD5D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface GradientMeshBackgroundProps {
|
|
4
|
+
colors?: string[];
|
|
5
|
+
className?: string;
|
|
6
|
+
speed?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* GradientMeshBackground
|
|
10
|
+
* A high-performance Canvas-based animated mesh gradient.
|
|
11
|
+
*/
|
|
12
|
+
export declare const GradientMeshBackground: React.FC<GradientMeshBackgroundProps>;
|
|
13
|
+
//# sourceMappingURL=GradientMeshBackground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientMeshBackground.d.ts","sourceRoot":"","sources":["../../src/backgrounds/GradientMeshBackground.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,2BAA2B;IACxC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA+DxE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("../useAnimationFrame-CTzG2uLX.cjs"),n=require("../useAetherisProps-DCvwpEOc.cjs");exports.AuroraBackground=t=>{const{colors:r=["#3ABEF9","#A7E6FF","#3572ef","#050c9c"],duration:a=20,intensity:i=1,className:s="",debug:o}=n.useAetherisProps(t);return e.jsxs("div",{className:`aetheris-aurora-container ${s}`,style:{position:"fixed",inset:0,backgroundColor:"#000",overflow:"hidden",zIndex:-1,border:o?"2px red solid":"none"},children:[e.jsx("div",{style:{position:"absolute",top:"-50%",left:"-50%",width:"200%",height:"200%",backgroundImage:`\n radial-gradient(circle at 50% 50%, ${r[0]}, transparent 50%),\n radial-gradient(circle at 20% 40%, ${r[1]}, transparent 40%),\n radial-gradient(circle at 80% 60%, ${r[2]}, transparent 45%),\n radial-gradient(circle at 40% 80%, ${r[3]}, transparent 50%)\n `,filter:"blur(80px) contrast(1.2)",opacity:.5*i,animation:`aetheris-aurora ${a}s infinite alternate ease-in-out`}}),e.jsx("style",{children:"\n @keyframes aetheris-aurora {\n 0% { transform: translate(0, 0) rotate(0deg); }\n 50% { transform: translate(5%, 10%) rotate(5deg); }\n 100% { transform: translate(-5%, 5%) rotate(-5deg); }\n }\n "})]})},exports.GradientMeshBackground=({colors:n=["#1a1a2e","#16213e","#0f3460","#e94560"],className:a="",speed:i=.001})=>{const s=t.useRef(null),o=t.useRef(0);return r.useAnimationFrame((e,t)=>{const r=s.current;if(!r)return;const a=r.getContext("2d");if(!a)return;o.current+=t*i;const{width:c,height:d}=r;a.clearRect(0,0,c,d);for(let i=0;i<n.length;i++){const e=(.5*Math.sin(o.current+2*i)+.5)*c,t=(.5*Math.cos(.8*o.current+1.5*i)+.5)*d,r=.8*Math.max(c,d),s=a.createRadialGradient(e,t,0,e,t,r);s.addColorStop(0,n[i]),s.addColorStop(1,"transparent"),a.fillStyle=s,a.globalCompositeOperation="screen",a.fillRect(0,0,c,d)}}),t.useEffect(()=>{const e=()=>{const e=s.current;e&&(e.width=window.innerWidth,e.height=window.innerHeight)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),e.jsx("canvas",{ref:s,className:`aetheris-gradient-mesh ${a}`,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:-1,pointerEvents:"none"}})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/backgrounds/AuroraBackground.tsx","../../src/backgrounds/GradientMeshBackground.tsx"],"names":["props","colors","duration","intensity","className","debug","useAetherisProps","jsxs","style","position","inset","backgroundColor","overflow","zIndex","border","children","jsx","top","left","width","height","backgroundImage","filter","opacity","animation","speed","canvasRef","useRef","timeRef","useAnimationFrame","_","delta","canvas","current","ctx","getContext","clearRect","i","length","x","Math","sin","y","cos","radius","max","gradient","createRadialGradient","addColorStop","fillStyle","globalCompositeOperation","fillRect","useEffect","resize","window","innerWidth","innerHeight","addEventListener","removeEventListener","ref","pointerEvents"],"mappings":"8PAWkEA,IAC9D,MAAMC,OACFA,EAAS,CAAC,UAAW,UAAW,UAAW,WAASC,SACpDA,EAAW,GAAAC,UACXA,EAAY,EAAAC,UACZA,EAAY,GAAAC,MACZA,GACAC,EAAAA,iBAAiBN,GAErB,OACIO,EAAAA,KAAC,MAAA,CACGH,UAAW,6BAA6BA,IACxCI,MAAO,CACHC,SAAU,QACVC,MAAO,EACPC,gBAAiB,OACjBC,SAAU,SACVC,QAAQ,EACRC,OAAQT,EAAQ,gBAAkB,QAGtCU,SAAA,CAAAC,EAAAA,IAAC,MAAA,CACGR,MAAO,CACHC,SAAU,WACVQ,IAAK,OACLC,KAAM,OACNC,MAAO,OACPC,OAAQ,OACRC,gBAAiB,oDACYpB,EAAO,yEACPA,EAAO,yEACPA,EAAO,yEACPA,EAAO,mCAEpCqB,OAAQ,2BACRC,QAAS,GAAMpB,EACfqB,UAAW,mBAAmBtB,6CAGrC,QAAA,CAAOa,SAAA,4RCrCyD,EACzEd,SAAS,CAAC,UAAW,UAAW,UAAW,WAC3CG,YAAY,GACZqB,QAAQ,SAER,MAAMC,EAAYC,EAAAA,OAA0B,MACtCC,EAAUD,EAAAA,OAAO,GA0CvB,OAxCAE,oBAAkB,CAACC,EAAGC,KAClB,MAAMC,EAASN,EAAUO,QACzB,IAAKD,EAAQ,OACb,MAAME,EAAMF,EAAOG,WAAW,MAC9B,IAAKD,EAAK,OAEVN,EAAQK,SAAWF,EAAQN,EAE3B,MAAMN,MAAEA,EAAAC,OAAOA,GAAWY,EAC1BE,EAAIE,UAAU,EAAG,EAAGjB,EAAOC,GAG3B,IAAA,IAASiB,EAAI,EAAGA,EAAIpC,EAAOqC,OAAQD,IAAK,CACpC,MAAME,GAAyC,GAApCC,KAAKC,IAAIb,EAAQK,QAAc,EAAJI,GAAe,IAAOlB,EACtDuB,GAAiD,GAA5CF,KAAKG,IAAsB,GAAlBf,EAAQK,QAAoB,IAAJI,GAAiB,IAAOjB,EAC9DwB,EAAmC,GAA1BJ,KAAKK,IAAI1B,EAAOC,GAEzB0B,EAAWZ,EAAIa,qBAAqBR,EAAGG,EAAG,EAAGH,EAAGG,EAAGE,GACzDE,EAASE,aAAa,EAAG/C,EAAOoC,IAChCS,EAASE,aAAa,EAAG,eAEzBd,EAAIe,UAAYH,EAChBZ,EAAIgB,yBAA2B,SAC/BhB,EAAIiB,SAAS,EAAG,EAAGhC,EAAOC,EAC9B,IAGJgC,EAAAA,UAAU,KACN,MAAMC,EAAS,KACX,MAAMrB,EAASN,EAAUO,QACrBD,IACAA,EAAOb,MAAQmC,OAAOC,WACtBvB,EAAOZ,OAASkC,OAAOE,cAK/B,OAFAF,OAAOG,iBAAiB,SAAUJ,GAClCA,IACO,IAAMC,OAAOI,oBAAoB,SAAUL,IACnD,IAGCrC,EAAAA,IAAC,SAAA,CACG2C,IAAKjC,EACLtB,UAAW,0BAA0BA,IACrCI,MAAO,CACHC,SAAU,QACVQ,IAAK,EACLC,KAAM,EACNC,MAAO,OACPC,OAAQ,OACRP,QAAQ,EACR+C,cAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backgrounds/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { u as useAnimationFrame } from "../useAnimationFrame-D_Zb5j5z.js";
|
|
4
|
+
import { u as useAetherisProps } from "../useAetherisProps-Df5HX2Nd.js";
|
|
5
|
+
const GradientMeshBackground = ({
|
|
6
|
+
colors = ["#1a1a2e", "#16213e", "#0f3460", "#e94560"],
|
|
7
|
+
className = "",
|
|
8
|
+
speed = 1e-3
|
|
9
|
+
}) => {
|
|
10
|
+
const canvasRef = useRef(null);
|
|
11
|
+
const timeRef = useRef(0);
|
|
12
|
+
useAnimationFrame((_, delta) => {
|
|
13
|
+
const canvas = canvasRef.current;
|
|
14
|
+
if (!canvas) return;
|
|
15
|
+
const ctx = canvas.getContext("2d");
|
|
16
|
+
if (!ctx) return;
|
|
17
|
+
timeRef.current += delta * speed;
|
|
18
|
+
const { width, height } = canvas;
|
|
19
|
+
ctx.clearRect(0, 0, width, height);
|
|
20
|
+
for (let i = 0; i < colors.length; i++) {
|
|
21
|
+
const x = (Math.sin(timeRef.current + i * 2) * 0.5 + 0.5) * width;
|
|
22
|
+
const y = (Math.cos(timeRef.current * 0.8 + i * 1.5) * 0.5 + 0.5) * height;
|
|
23
|
+
const radius = Math.max(width, height) * 0.8;
|
|
24
|
+
const gradient = ctx.createRadialGradient(x, y, 0, x, y, radius);
|
|
25
|
+
gradient.addColorStop(0, colors[i]);
|
|
26
|
+
gradient.addColorStop(1, "transparent");
|
|
27
|
+
ctx.fillStyle = gradient;
|
|
28
|
+
ctx.globalCompositeOperation = "screen";
|
|
29
|
+
ctx.fillRect(0, 0, width, height);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const resize = () => {
|
|
34
|
+
const canvas = canvasRef.current;
|
|
35
|
+
if (canvas) {
|
|
36
|
+
canvas.width = window.innerWidth;
|
|
37
|
+
canvas.height = window.innerHeight;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
window.addEventListener("resize", resize);
|
|
41
|
+
resize();
|
|
42
|
+
return () => window.removeEventListener("resize", resize);
|
|
43
|
+
}, []);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"canvas",
|
|
46
|
+
{
|
|
47
|
+
ref: canvasRef,
|
|
48
|
+
className: `aetheris-gradient-mesh ${className}`,
|
|
49
|
+
style: {
|
|
50
|
+
position: "fixed",
|
|
51
|
+
top: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "100%",
|
|
55
|
+
zIndex: -1,
|
|
56
|
+
pointerEvents: "none"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
const AuroraBackground = (props) => {
|
|
62
|
+
const {
|
|
63
|
+
colors = ["#3ABEF9", "#A7E6FF", "#3572ef", "#050c9c"],
|
|
64
|
+
duration = 20,
|
|
65
|
+
intensity = 1,
|
|
66
|
+
className = "",
|
|
67
|
+
debug
|
|
68
|
+
} = useAetherisProps(props);
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: `aetheris-aurora-container ${className}`,
|
|
73
|
+
style: {
|
|
74
|
+
position: "fixed",
|
|
75
|
+
inset: 0,
|
|
76
|
+
backgroundColor: "#000",
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
zIndex: -1,
|
|
79
|
+
border: debug ? "2px red solid" : "none"
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
style: {
|
|
86
|
+
position: "absolute",
|
|
87
|
+
top: "-50%",
|
|
88
|
+
left: "-50%",
|
|
89
|
+
width: "200%",
|
|
90
|
+
height: "200%",
|
|
91
|
+
backgroundImage: `
|
|
92
|
+
radial-gradient(circle at 50% 50%, ${colors[0]}, transparent 50%),
|
|
93
|
+
radial-gradient(circle at 20% 40%, ${colors[1]}, transparent 40%),
|
|
94
|
+
radial-gradient(circle at 80% 60%, ${colors[2]}, transparent 45%),
|
|
95
|
+
radial-gradient(circle at 40% 80%, ${colors[3]}, transparent 50%)
|
|
96
|
+
`,
|
|
97
|
+
filter: `blur(80px) contrast(1.2)`,
|
|
98
|
+
opacity: 0.5 * intensity,
|
|
99
|
+
animation: `aetheris-aurora ${duration}s infinite alternate ease-in-out`
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
104
|
+
@keyframes aetheris-aurora {
|
|
105
|
+
0% { transform: translate(0, 0) rotate(0deg); }
|
|
106
|
+
50% { transform: translate(5%, 10%) rotate(5deg); }
|
|
107
|
+
100% { transform: translate(-5%, 5%) rotate(-5deg); }
|
|
108
|
+
}
|
|
109
|
+
` })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
AuroraBackground,
|
|
116
|
+
GradientMeshBackground
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/backgrounds/GradientMeshBackground.tsx","../../src/backgrounds/AuroraBackground.tsx"],"names":[],"mappings":";;;;AAaO,MAAM,yBAAgE,CAAC;AAAA,EAC1E,SAAS,CAAC,WAAW,WAAW,WAAW,SAAS;AAAA,EACpD,YAAY;AAAA,EACZ,QAAQ;AACZ,MAAM;AACF,QAAM,YAAY,OAA0B,IAAI;AAChD,QAAM,UAAU,OAAO,CAAC;AAExB,oBAAkB,CAAC,GAAG,UAAU;AAC5B,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC,OAAQ;AACb,UAAM,MAAM,OAAO,WAAW,IAAI;AAClC,QAAI,CAAC,IAAK;AAEV,YAAQ,WAAW,QAAQ;AAE3B,UAAM,EAAE,OAAO,OAAA,IAAW;AAC1B,QAAI,UAAU,GAAG,GAAG,OAAO,MAAM;AAGjC,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACpC,YAAM,KAAK,KAAK,IAAI,QAAQ,UAAU,IAAI,CAAC,IAAI,MAAM,OAAO;AAC5D,YAAM,KAAK,KAAK,IAAI,QAAQ,UAAU,MAAM,IAAI,GAAG,IAAI,MAAM,OAAO;AACpE,YAAM,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AAA,MAAA;AAAA,MAGtC,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,OAAO;AAAA,cACH,UAAU;AAAA,cACV,KAAK;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,iBAAiB;AAAA,iDACY,OAAO,CAAC,CAAC;AAAA,iDACT,OAAO,CAAC,CAAC;AAAA,iDACT,OAAO,CAAC,CAAC;AAAA,iDACT,OAAO,CAAC,CAAC;AAAA;AAAA,cAEtC,QAAQ;AAAA,cACR,SAAS,MAAM;AAAA,cACf,WAAW,mBAAmB,QAAQ;AAAA,YAAA;AAAA,UAC1C;AAAA,QAAA;AAAA,4BAEH,SAAA,EAAO,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,CAMZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './backgrounds/index'
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty,r=(r,e,t)=>((r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t)(r,"symbol"!=typeof e?e+"":e,t);const e=require("./ticker-DVYSZRUG.cjs"),t=new class{constructor(){r(this,"readCallbacks",new Set),r(this,"writeCallbacks",new Set),r(this,"isProcessing",!1),this.process=this.process.bind(this),e.ticker.add(this.process)}read(s){this.readCallbacks.add(s)}write(s){this.writeCallbacks.add(s)}process(){this.isProcessing||0===this.readCallbacks.size&&0===this.writeCallbacks.size||(this.isProcessing=!0,this.readCallbacks.forEach(s=>{try{s()}catch(r){console.error("Batcher Read Error:",r)}}),this.readCallbacks.clear(),this.writeCallbacks.forEach(s=>{try{s()}catch(r){console.error("Batcher Write Error:",r)}}),this.writeCallbacks.clear(),this.isProcessing=!1)}};exports.batcher=t;
|
|
2
|
+
//# sourceMappingURL=batching-BN2ZpDzo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batching-BN2ZpDzo.cjs","sources":["../src/core/batching.ts"],"names":["batcher","constructor","__publicField","this","Set","process","bind","ticker","add","read","cb","readCallbacks","write","writeCallbacks","isProcessing","size","forEach","e","console","error","clear"],"mappings":"gNAuDaA,EAAU,IA/CvB,MAKI,WAAAC,GAJQC,EAAAC,KAAA,oBAAqCC,KACrCF,EAAAC,KAAA,qBAAsCC,KACtCF,EAAAC,KAAA,gBAAwB,GAG5BA,KAAKE,QAAUF,KAAKE,QAAQC,KAAKH,MAEjCI,SAAOC,IAAIL,KAAKE,QACpB,CAKO,IAAAI,CAAKC,GACRP,KAAKQ,cAAcH,IAAIE,EAC3B,CAKO,KAAAE,CAAMF,GACTP,KAAKU,eAAeL,IAAIE,EAC5B,CAEQ,OAAAL,GACAF,KAAKW,cACuB,IAA5BX,KAAKQ,cAAcI,MAA2C,IAA7BZ,KAAKU,eAAeE,OAEzDZ,KAAKW,cAAe,EAGpBX,KAAKQ,cAAcK,QAASN,IACxB,IAAMA,GAAM,OAASO,GAAKC,QAAQC,MAAM,sBAAuBF,EAAI,IAEvEd,KAAKQ,cAAcS,QAGnBjB,KAAKU,eAAeG,QAASN,IACzB,IAAMA,GAAM,OAASO,GAAKC,QAAQC,MAAM,uBAAwBF,EAAI,IAExEd,KAAKU,eAAeO,QAEpBjB,KAAKW,cAAe,EACxB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { t as ticker } from "./ticker-ztuWKiDZ.js";
|
|
5
|
+
class Batcher {
|
|
6
|
+
constructor() {
|
|
7
|
+
__publicField(this, "readCallbacks", /* @__PURE__ */ new Set());
|
|
8
|
+
__publicField(this, "writeCallbacks", /* @__PURE__ */ new Set());
|
|
9
|
+
__publicField(this, "isProcessing", false);
|
|
10
|
+
this.process = this.process.bind(this);
|
|
11
|
+
ticker.add(this.process);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Schedule a DOM "read" operation (measurements).
|
|
15
|
+
*/
|
|
16
|
+
read(cb) {
|
|
17
|
+
this.readCallbacks.add(cb);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Schedule a DOM "write" operation (mutations).
|
|
21
|
+
*/
|
|
22
|
+
write(cb) {
|
|
23
|
+
this.writeCallbacks.add(cb);
|
|
24
|
+
}
|
|
25
|
+
process() {
|
|
26
|
+
if (this.isProcessing) return;
|
|
27
|
+
if (this.readCallbacks.size === 0 && this.writeCallbacks.size === 0) return;
|
|
28
|
+
this.isProcessing = true;
|
|
29
|
+
this.readCallbacks.forEach((cb) => {
|
|
30
|
+
try {
|
|
31
|
+
cb();
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error("Batcher Read Error:", e);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.readCallbacks.clear();
|
|
37
|
+
this.writeCallbacks.forEach((cb) => {
|
|
38
|
+
try {
|
|
39
|
+
cb();
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error("Batcher Write Error:", e);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.writeCallbacks.clear();
|
|
45
|
+
this.isProcessing = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const batcher = new Batcher();
|
|
49
|
+
export {
|
|
50
|
+
batcher as b
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=batching-vPvT9JKb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batching-vPvT9JKb.js","sources":["../src/core/batching.ts"],"names":[],"mappings":";;;;AAQA,MAAM,QAAQ;AAAA,EAKV,cAAc;AAJN,6DAAqC,IAAA;AACrC,8DAAsC,IAAA;AACtC,wCAAwB;AAG5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAErC,WAAO,IAAI,KAAK,OAAO;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKO,KAAK,IAAgB;AACxB,SAAK,cAAc,IAAI,EAAE;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKO,MAAM,IAAgB;AACzB,SAAK,eAAe,IAAI,EAAE;AAAA,EAC9B;AAAA,EAEQ,UAAU;AACd,QAAI,KAAK,aAAc;AACvB,QAAI,KAAK,cAAc,SAAS,KAAK,KAAK,eAAe,SAAS,EAAG;AAErE,SAAK,eAAe;AAGpB,SAAK,cAAc,QAAQ,CAAC,OAAO;AAC/B,UAAI;AAAE,WAAA;AAAA,MAAM,SAAS,GAAG;AAAE,gBAAQ,MAAM,uBAAuB,CAAC;AAAA,MAAG;AAAA,IACvE,CAAC;AACD,SAAK,cAAc,MAAA;AAGnB,SAAK,eAAe,QAAQ,CAAC,OAAO;AAChC,UAAI;AAAE,WAAA;AAAA,MAAM,SAAS,GAAG;AAAE,gBAAQ,MAAM,wBAAwB,CAAC;AAAA,MAAG;AAAA,IACxE,CAAC;AACD,SAAK,eAAe,MAAA;AAEpB,SAAK,eAAe;AAAA,EACxB;AACJ;AAEO,MAAM,UAAU,IAAI,QAAA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseAnimationProps } from '../hooks/useAetherisProps';
|
|
3
|
+
|
|
4
|
+
export interface ParticleBurstButtonProps extends BaseAnimationProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
particleColor?: string;
|
|
7
|
+
particleCount?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ParticleBurstButton
|
|
11
|
+
* A button that triggers a physics-based particle explosion on click.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ParticleBurstButton: React.FC<ParticleBurstButtonProps>;
|
|
14
|
+
//# sourceMappingURL=ParticleBurstButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticleBurstButton.d.ts","sourceRoot":"","sources":["../../src/buttons/ParticleBurstButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGjF,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAWD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA8FlE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseAnimationProps } from '../hooks/useAetherisProps';
|
|
3
|
+
|
|
4
|
+
export interface SpringPressButtonProps extends BaseAnimationProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* SpringPressButton
|
|
9
|
+
* A button with physics-based press and release dynamics.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SpringPressButton: React.FC<SpringPressButtonProps>;
|
|
12
|
+
//# sourceMappingURL=SpringPressButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpringPressButton.d.ts","sourceRoot":"","sources":["../../src/buttons/SpringPressButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAKjF,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAC9D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA0C9D,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("../useAetherisProps-DCvwpEOc.cjs"),n=require("../useAnimationFrame-CTzG2uLX.cjs"),i=require("../interpolation-C3PO0EIn.cjs"),s=require("../batching-BN2ZpDzo.cjs");exports.ParticleBurstButton=i=>{const{children:s,particleColor:o="#ffffff",particleCount:u=20,intensity:a=1,className:c=""}=t.useAetherisProps(i),l=r.useRef(null),f=r.useRef([]),[h,d]=r.useState(!1);return n.useAnimationFrame(()=>{const e=l.current;if(!e||0===f.current.length)return;const r=e.getContext("2d");r&&(r.clearRect(0,0,e.width,e.height),f.current=f.current.filter(e=>e.life>0),f.current.forEach(e=>{e.x+=e.vx,e.y+=e.vy,e.vy+=.1,e.life-=.02,r.globalAlpha=e.life,r.fillStyle=o,r.beginPath(),r.arc(e.x,e.y,e.size,0,2*Math.PI),r.fill()}),0===f.current.length&&d(!1))}),e.jsxs("button",{onClick:e=>{const r=l.current;if(!r)return;const t=e.currentTarget.getBoundingClientRect();r.width=2*t.width,r.height=2*t.height;const n=e.clientX-t.left,i=e.clientY-t.top;d(!0);for(let s=0;s<u*a;s++)f.current.push({x:n,y:i,vx:10*(Math.random()-.5),vy:10*(Math.random()-.5),life:1,size:3*Math.random()+1})},className:`aetheris-particle-button ${c}`,style:{position:"relative",padding:"1rem 2rem",background:"#000",color:"#fff",border:"none",borderRadius:"0.5rem",cursor:"pointer",overflow:"visible"},children:[e.jsx("canvas",{ref:l,style:{position:"absolute",top:"-50%",left:"-50%",width:"200%",height:"200%",pointerEvents:"none",zIndex:1}}),e.jsx("span",{style:{position:"relative",zIndex:2},children:s})]})},exports.SpringPressButton=o=>{const{children:u,intensity:a=1,className:c=""}=t.useAetherisProps(o),[l,f]=r.useState(1),h=r.useRef(1),d=r.useRef(null);return n.useAnimationFrame((e,r)=>{h.current=i.damp(h.current,l,15,r),s.batcher.write(()=>{d.current&&(d.current.style.transform=`scale(${h.current})`)})}),e.jsx("button",{ref:d,onMouseDown:()=>f(.9*a),onMouseUp:()=>f(1),onMouseLeave:()=>f(1),className:`aetheris-spring-button ${c}`,style:{padding:"1rem 2rem",background:"#fff",color:"#000",border:"none",borderRadius:"0.5rem",cursor:"pointer",fontWeight:"bold",willChange:"transform"},children:u})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/buttons/ParticleBurstButton.tsx","../../src/buttons/SpringPressButton.tsx"],"names":["props","children","particleColor","particleCount","intensity","className","useAetherisProps","canvasRef","useRef","particles","isActive","setIsActive","useState","useAnimationFrame","canvas","current","length","ctx","getContext","clearRect","width","height","filter","p","life","forEach","x","vx","y","vy","globalAlpha","fillStyle","beginPath","arc","size","Math","PI","fill","jsxs","onClick","e","rect","currentTarget","getBoundingClientRect","clientX","left","clientY","top","i","push","random","style","position","padding","background","color","border","borderRadius","cursor","overflow","jsx","ref","pointerEvents","zIndex","targetScale","setTargetScale","currentScale","buttonRef","_","delta","damp","batcher","write","transform","onMouseDown","onMouseUp","onMouseLeave","fontWeight","willChange"],"mappings":"kVAuBwEA,IACpE,MAAMC,SACFA,EAAAC,cACAA,EAAgB,UAAAC,cAChBA,EAAgB,GAAAC,UAChBA,EAAY,EAAAC,UACZA,EAAY,IACZC,EAAAA,iBAAiBN,GAEfO,EAAYC,EAAAA,OAA0B,MACtCC,EAAYD,EAAAA,OAAmB,KAC9BE,EAAUC,GAAeC,EAAAA,UAAS,GAqDzC,OAnDAC,EAAAA,kBAAkB,KACd,MAAMC,EAASP,EAAUQ,QACzB,IAAKD,GAAuC,IAA7BL,EAAUM,QAAQC,OAAc,OAC/C,MAAMC,EAAMH,EAAOI,WAAW,MACzBD,IAELA,EAAIE,UAAU,EAAG,EAAGL,EAAOM,MAAON,EA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