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.
Files changed (161) hide show
  1. package/README.md +107 -0
  2. package/dist/Body-P2dJJsnJ.js +120 -0
  3. package/dist/Body-P2dJJsnJ.js.map +1 -0
  4. package/dist/Body-ebC4lyJ7.cjs +2 -0
  5. package/dist/Body-ebC4lyJ7.cjs.map +1 -0
  6. package/dist/MotionProvider-CEWupIo9.cjs +2 -0
  7. package/dist/MotionProvider-CEWupIo9.cjs.map +1 -0
  8. package/dist/MotionProvider-iE1UXJc6.js +27 -0
  9. package/dist/MotionProvider-iE1UXJc6.js.map +1 -0
  10. package/dist/backgrounds/AuroraBackground.d.ts +12 -0
  11. package/dist/backgrounds/AuroraBackground.d.ts.map +1 -0
  12. package/dist/backgrounds/GradientMeshBackground.d.ts +13 -0
  13. package/dist/backgrounds/GradientMeshBackground.d.ts.map +1 -0
  14. package/dist/backgrounds/index.cjs +2 -0
  15. package/dist/backgrounds/index.cjs.map +1 -0
  16. package/dist/backgrounds/index.d.ts +3 -0
  17. package/dist/backgrounds/index.d.ts.map +1 -0
  18. package/dist/backgrounds/index.js +118 -0
  19. package/dist/backgrounds/index.js.map +1 -0
  20. package/dist/backgrounds.d.ts +1 -0
  21. package/dist/batching-BN2ZpDzo.cjs +2 -0
  22. package/dist/batching-BN2ZpDzo.cjs.map +1 -0
  23. package/dist/batching-vPvT9JKb.js +52 -0
  24. package/dist/batching-vPvT9JKb.js.map +1 -0
  25. package/dist/buttons/ParticleBurstButton.d.ts +14 -0
  26. package/dist/buttons/ParticleBurstButton.d.ts.map +1 -0
  27. package/dist/buttons/SpringPressButton.d.ts +12 -0
  28. package/dist/buttons/SpringPressButton.d.ts.map +1 -0
  29. package/dist/buttons/index.cjs +2 -0
  30. package/dist/buttons/index.cjs.map +1 -0
  31. package/dist/buttons/index.d.ts +3 -0
  32. package/dist/buttons/index.d.ts.map +1 -0
  33. package/dist/buttons/index.js +137 -0
  34. package/dist/buttons/index.js.map +1 -0
  35. package/dist/buttons.d.ts +1 -0
  36. package/dist/cards/DepthCardPro.d.ts +13 -0
  37. package/dist/cards/DepthCardPro.d.ts.map +1 -0
  38. package/dist/cards/index.cjs +2 -0
  39. package/dist/cards/index.cjs.map +1 -0
  40. package/dist/cards/index.d.ts +2 -0
  41. package/dist/cards/index.d.ts.map +1 -0
  42. package/dist/cards/index.js +59 -0
  43. package/dist/cards/index.js.map +1 -0
  44. package/dist/cards.d.ts +1 -0
  45. package/dist/core/Body.d.ts +16 -0
  46. package/dist/core/Body.d.ts.map +1 -0
  47. package/dist/core/ForceField.d.ts +15 -0
  48. package/dist/core/ForceField.d.ts.map +1 -0
  49. package/dist/core/MotionOverlay.d.ts +8 -0
  50. package/dist/core/MotionOverlay.d.ts.map +1 -0
  51. package/dist/core/MotionProvider.d.ts +14 -0
  52. package/dist/core/MotionProvider.d.ts.map +1 -0
  53. package/dist/core/batching.d.ts +23 -0
  54. package/dist/core/batching.d.ts.map +1 -0
  55. package/dist/core/easing.d.ts +31 -0
  56. package/dist/core/easing.d.ts.map +1 -0
  57. package/dist/core/index.cjs +2 -0
  58. package/dist/core/index.cjs.map +1 -0
  59. package/dist/core/index.d.ts +13 -0
  60. package/dist/core/index.d.ts.map +1 -0
  61. package/dist/core/index.js +223 -0
  62. package/dist/core/index.js.map +1 -0
  63. package/dist/core/interpolation.d.ts +25 -0
  64. package/dist/core/interpolation.d.ts.map +1 -0
  65. package/dist/core/motionValue.d.ts +38 -0
  66. package/dist/core/motionValue.d.ts.map +1 -0
  67. package/dist/core/physics.d.ts +22 -0
  68. package/dist/core/physics.d.ts.map +1 -0
  69. package/dist/core/physicsWorld.d.ts +39 -0
  70. package/dist/core/physicsWorld.d.ts.map +1 -0
  71. package/dist/core/presets.d.ts +27 -0
  72. package/dist/core/presets.d.ts.map +1 -0
  73. package/dist/core/ticker.d.ts +21 -0
  74. package/dist/core/ticker.d.ts.map +1 -0
  75. package/dist/core/timeline.d.ts +34 -0
  76. package/dist/core/timeline.d.ts.map +1 -0
  77. package/dist/core.d.ts +1 -0
  78. package/dist/cursor/InertiaCursor.d.ts +9 -0
  79. package/dist/cursor/InertiaCursor.d.ts.map +1 -0
  80. package/dist/cursor/index.cjs +2 -0
  81. package/dist/cursor/index.cjs.map +1 -0
  82. package/dist/cursor/index.d.ts +2 -0
  83. package/dist/cursor/index.d.ts.map +1 -0
  84. package/dist/cursor/index.js +52 -0
  85. package/dist/cursor/index.js.map +1 -0
  86. package/dist/cursor.d.ts +1 -0
  87. package/dist/hooks/index.cjs +2 -0
  88. package/dist/hooks/index.cjs.map +1 -0
  89. package/dist/hooks/index.d.ts +5 -0
  90. package/dist/hooks/index.d.ts.map +1 -0
  91. package/dist/hooks/index.js +21 -0
  92. package/dist/hooks/index.js.map +1 -0
  93. package/dist/hooks/useAetherisProps.d.ts +19 -0
  94. package/dist/hooks/useAetherisProps.d.ts.map +1 -0
  95. package/dist/hooks/useAnimationFrame.d.ts +6 -0
  96. package/dist/hooks/useAnimationFrame.d.ts.map +1 -0
  97. package/dist/hooks/useMousePosition.d.ts +10 -0
  98. package/dist/hooks/useMousePosition.d.ts.map +1 -0
  99. package/dist/hooks/useReducedMotion.d.ts +7 -0
  100. package/dist/hooks/useReducedMotion.d.ts.map +1 -0
  101. package/dist/hooks.d.ts +1 -0
  102. package/dist/hover/GlowBorder.d.ts +14 -0
  103. package/dist/hover/GlowBorder.d.ts.map +1 -0
  104. package/dist/hover/MagneticCard.d.ts +14 -0
  105. package/dist/hover/MagneticCard.d.ts.map +1 -0
  106. package/dist/hover/index.cjs +2 -0
  107. package/dist/hover/index.cjs.map +1 -0
  108. package/dist/hover/index.d.ts +3 -0
  109. package/dist/hover/index.d.ts.map +1 -0
  110. package/dist/hover/index.js +115 -0
  111. package/dist/hover/index.js.map +1 -0
  112. package/dist/hover.d.ts +1 -0
  113. package/dist/index.cjs +2 -0
  114. package/dist/index.cjs.map +1 -0
  115. package/dist/index.d.ts +10 -0
  116. package/dist/index.d.ts.map +1 -0
  117. package/dist/index.js +56 -0
  118. package/dist/index.js.map +1 -0
  119. package/dist/interpolation-C3PO0EIn.cjs +2 -0
  120. package/dist/interpolation-C3PO0EIn.cjs.map +1 -0
  121. package/dist/interpolation-DI9if1ma.js +17 -0
  122. package/dist/interpolation-DI9if1ma.js.map +1 -0
  123. package/dist/motionValue-BGCWkNUM.cjs +2 -0
  124. package/dist/motionValue-BGCWkNUM.cjs.map +1 -0
  125. package/dist/motionValue-C6kWEIe3.js +63 -0
  126. package/dist/motionValue-C6kWEIe3.js.map +1 -0
  127. package/dist/scroll/VelocityReveal.d.ts +12 -0
  128. package/dist/scroll/VelocityReveal.d.ts.map +1 -0
  129. package/dist/scroll/index.cjs +2 -0
  130. package/dist/scroll/index.cjs.map +1 -0
  131. package/dist/scroll/index.d.ts +2 -0
  132. package/dist/scroll/index.d.ts.map +1 -0
  133. package/dist/scroll/index.js +38 -0
  134. package/dist/scroll/index.js.map +1 -0
  135. package/dist/scroll.d.ts +1 -0
  136. package/dist/text/PhysicsSplitText.d.ts +12 -0
  137. package/dist/text/PhysicsSplitText.d.ts.map +1 -0
  138. package/dist/text/ScrambleText.d.ts +14 -0
  139. package/dist/text/ScrambleText.d.ts.map +1 -0
  140. package/dist/text/SplitTextReveal.d.ts +16 -0
  141. package/dist/text/SplitTextReveal.d.ts.map +1 -0
  142. package/dist/text/index.cjs +2 -0
  143. package/dist/text/index.cjs.map +1 -0
  144. package/dist/text/index.d.ts +4 -0
  145. package/dist/text/index.d.ts.map +1 -0
  146. package/dist/text/index.js +135 -0
  147. package/dist/text/index.js.map +1 -0
  148. package/dist/text.d.ts +1 -0
  149. package/dist/ticker-DVYSZRUG.cjs +2 -0
  150. package/dist/ticker-DVYSZRUG.cjs.map +1 -0
  151. package/dist/ticker-ztuWKiDZ.js +49 -0
  152. package/dist/ticker-ztuWKiDZ.js.map +1 -0
  153. package/dist/useAetherisProps-DCvwpEOc.cjs +2 -0
  154. package/dist/useAetherisProps-DCvwpEOc.cjs.map +1 -0
  155. package/dist/useAetherisProps-Df5HX2Nd.js +35 -0
  156. package/dist/useAetherisProps-Df5HX2Nd.js.map +1 -0
  157. package/dist/useAnimationFrame-CTzG2uLX.cjs +2 -0
  158. package/dist/useAnimationFrame-CTzG2uLX.cjs.map +1 -0
  159. package/dist/useAnimationFrame-D_Zb5j5z.js +13 -0
  160. package/dist/useAnimationFrame-D_Zb5j5z.js.map +1 -0
  161. package/package.json +110 -0
@@ -0,0 +1,137 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useRef, useState } from "react";
3
+ import { u as useAetherisProps } from "../useAetherisProps-Df5HX2Nd.js";
4
+ import { u as useAnimationFrame } from "../useAnimationFrame-D_Zb5j5z.js";
5
+ import { d as damp } from "../interpolation-DI9if1ma.js";
6
+ import { b as batcher } from "../batching-vPvT9JKb.js";
7
+ const ParticleBurstButton = (props) => {
8
+ const {
9
+ children,
10
+ particleColor = "#ffffff",
11
+ particleCount = 20,
12
+ intensity = 1,
13
+ className = ""
14
+ } = useAetherisProps(props);
15
+ const canvasRef = useRef(null);
16
+ const particles = useRef([]);
17
+ const [isActive, setIsActive] = useState(false);
18
+ useAnimationFrame(() => {
19
+ const canvas = canvasRef.current;
20
+ if (!canvas || particles.current.length === 0) return;
21
+ const ctx = canvas.getContext("2d");
22
+ if (!ctx) return;
23
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
24
+ particles.current = particles.current.filter((p) => p.life > 0);
25
+ particles.current.forEach((p) => {
26
+ p.x += p.vx;
27
+ p.y += p.vy;
28
+ p.vy += 0.1;
29
+ p.life -= 0.02;
30
+ ctx.globalAlpha = p.life;
31
+ ctx.fillStyle = particleColor;
32
+ ctx.beginPath();
33
+ ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
34
+ ctx.fill();
35
+ });
36
+ if (particles.current.length === 0) setIsActive(false);
37
+ });
38
+ const handleClick = (e) => {
39
+ const canvas = canvasRef.current;
40
+ if (!canvas) return;
41
+ const rect = e.currentTarget.getBoundingClientRect();
42
+ canvas.width = rect.width * 2;
43
+ canvas.height = rect.height * 2;
44
+ const x = e.clientX - rect.left;
45
+ const y = e.clientY - rect.top;
46
+ setIsActive(true);
47
+ for (let i = 0; i < particleCount * intensity; i++) {
48
+ particles.current.push({
49
+ x,
50
+ y,
51
+ vx: (Math.random() - 0.5) * 10,
52
+ vy: (Math.random() - 0.5) * 10,
53
+ life: 1,
54
+ size: Math.random() * 3 + 1
55
+ });
56
+ }
57
+ };
58
+ return /* @__PURE__ */ jsxs(
59
+ "button",
60
+ {
61
+ onClick: handleClick,
62
+ className: `aetheris-particle-button ${className}`,
63
+ style: {
64
+ position: "relative",
65
+ padding: "1rem 2rem",
66
+ background: "#000",
67
+ color: "#fff",
68
+ border: "none",
69
+ borderRadius: "0.5rem",
70
+ cursor: "pointer",
71
+ overflow: "visible"
72
+ },
73
+ children: [
74
+ /* @__PURE__ */ jsx(
75
+ "canvas",
76
+ {
77
+ ref: canvasRef,
78
+ style: {
79
+ position: "absolute",
80
+ top: "-50%",
81
+ left: "-50%",
82
+ width: "200%",
83
+ height: "200%",
84
+ pointerEvents: "none",
85
+ zIndex: 1
86
+ }
87
+ }
88
+ ),
89
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 2 }, children })
90
+ ]
91
+ }
92
+ );
93
+ };
94
+ const SpringPressButton = (props) => {
95
+ const {
96
+ children,
97
+ intensity = 1,
98
+ className = ""
99
+ } = useAetherisProps(props);
100
+ const [targetScale, setTargetScale] = useState(1);
101
+ const currentScale = useRef(1);
102
+ const buttonRef = useRef(null);
103
+ useAnimationFrame((_, delta) => {
104
+ currentScale.current = damp(currentScale.current, targetScale, 15, delta);
105
+ batcher.write(() => {
106
+ if (buttonRef.current) {
107
+ buttonRef.current.style.transform = `scale(${currentScale.current})`;
108
+ }
109
+ });
110
+ });
111
+ return /* @__PURE__ */ jsx(
112
+ "button",
113
+ {
114
+ ref: buttonRef,
115
+ onMouseDown: () => setTargetScale(0.9 * intensity),
116
+ onMouseUp: () => setTargetScale(1),
117
+ onMouseLeave: () => setTargetScale(1),
118
+ className: `aetheris-spring-button ${className}`,
119
+ style: {
120
+ padding: "1rem 2rem",
121
+ background: "#fff",
122
+ color: "#000",
123
+ border: "none",
124
+ borderRadius: "0.5rem",
125
+ cursor: "pointer",
126
+ fontWeight: "bold",
127
+ willChange: "transform"
128
+ },
129
+ children
130
+ }
131
+ );
132
+ };
133
+ export {
134
+ ParticleBurstButton,
135
+ SpringPressButton
136
+ };
137
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/buttons/ParticleBurstButton.tsx","../../src/buttons/SpringPressButton.tsx"],"names":[],"mappings":";;;;;;AAuBO,MAAM,sBAA0D,CAAC,UAAU;AAC9E,QAAM;AAAA,IACF;AAAA,IACA,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,IACZ,iBAAiB,KAAK;AAE1B,QAAM,YAAY,OAA0B,IAAI;AAChD,QAAM,YAAY,OAAmB,EAAE;AACvC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,oBAAkB,MAAM;AACpB,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC,UAAU,UAAU,QAAQ,WAAW,EAAG;AAC/C,UAAM,MAAM,OAAO,WAAW,IAAI;AAClC,QAAI,CAAC,IAAK;AAEV,QAAI,UAAU,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM;AAE/C,cAAU,UAAU,UAAU,QAAQ,OAAO,CAAA,MAAK,EAAE,OAAO,CAAC;AAE5D,cAAU,QAAQ,QAAQ,CAAA,MAAK;AAC3B,QAAE,KAAK,EAAE;AACT,QAAE,KAAK,EAAE;AACT,QAAE,MAAM;AACR,QAAE,QAAQ;AAEV,UAAI,cAAc,EAAE;AACpB,UAAI,YAAY;AAChB,UAAI,U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,QAAA;AAAA,QAEJ,oBAAC,UAAK,OAAO,EAAE,UAAU,YAAY,QAAQ,EAAA,GAAM,SAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxE;ACvGO,MAAM,oBAAsD,CAAC,UAAU;AAC1E,QAAM;AAAA,IACF;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,IACZ,iBAAiB,KAAK;AAE1B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAChD,QAAM,eAAe,OAAO,CAAC;AAC7B,QAAM,YAAY,OAA0B,IAAI;AAEhD,oBAAkB,CAAC,GAAG,UAAU;AAC5B,iBAAa,UAAU,KAAK,aAAa,SAAS,aAAa,IAAI,KAAK;AAExE,YAAQ,MAAM,MAAM;AAChB,UAAI,UAAU,SAAS;AACnB,kBAAU,QAAQ,MAAM,YAAY,SAAS,aAAa,OAAO;AAAA,MACrE;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;AAED,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAK;AAAA,MACL,aAAa,MAAM,eAAe,MAAM,SAAS;AAAA,MACjD,WAAW,MAAM,eAAe,CAAC;AAAA,MACjC,cAAc,MAAM,eAAe,CAAC;AAAA,MACpC,WAAW,0BAA0B,SAAS;AAAA,MAC9C,OAAO;AAAA,QACH,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,YAAY;AAAA,MAAA;AAAA,MAGf;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -0,0 +1 @@
1
+ export * from './buttons/index'
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { BaseAnimationProps } from '../hooks/useAetherisProps';
3
+
4
+ export interface DepthCardProProps extends BaseAnimationProps {
5
+ children: React.ReactNode;
6
+ layers?: number;
7
+ }
8
+ /**
9
+ * DepthCardPro
10
+ * A high-end parallax card with physics-based inertia and multi-layer depth.
11
+ */
12
+ export declare const DepthCardPro: React.FC<DepthCardProProps>;
13
+ //# sourceMappingURL=DepthCardPro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DepthCardPro.d.ts","sourceRoot":"","sources":["../../src/cards/DepthCardPro.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMjF,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0DpD,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"),s=require("../motionValue-BGCWkNUM.cjs"),n=require("../interpolation-C3PO0EIn.cjs"),i=require("../useAnimationFrame-CTzG2uLX.cjs"),o=require("../batching-BN2ZpDzo.cjs");exports.DepthCardPro=a=>{const{children:u,intensity:c=1,className:l=""}=t.useAetherisProps(a),m=r.useRef(null),d=r.useRef({x:0,y:0}).current,p=r.useRef({x:s.motionValue(0),y:s.motionValue(0)}).current;return i.useAnimationFrame((e,r)=>{const t=n.damp(p.x.get(),d.x,10,r),s=n.damp(p.y.get(),d.y,10,r);p.x.set(t),p.y.set(s),o.batcher.write(()=>{m.current&&(m.current.style.transform=`perspective(1000px) rotateX(${t}deg) rotateY(${s}deg)`)})}),e.jsx("div",{ref:m,onMouseMove:e=>{if(!m.current)return;const r=m.current.getBoundingClientRect(),t=(e.clientX-r.left)/r.width-.5;d.x=20*-((e.clientY-r.top)/r.height-.5)*c,d.y=20*t*c},onMouseLeave:()=>{d.x=0,d.y=0},className:`aetheris-depth-card-pro ${l}`,style:{transition:"transform 0.1s linear",transformStyle:"preserve-3d",willChange:"transform"},children:e.jsx("div",{style:{transform:"translateZ(50px)",transformStyle:"preserve-3d"},children:u})})};
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/cards/DepthCardPro.tsx"],"names":["props","children","intensity","className","useAetherisProps","containerRef","useRef","targetRotation","x","y","current","currentRotation","motionValue","useAnimationFrame","_","delta","rx","damp","get","ry","set","batcher","write","style","transform","jsx","ref","onMouseMove","e","rect","getBoundingClientRect","clientX","left","width","clientY","top","height","onMouseLeave","transition","transformStyle","willChange"],"mappings":"oXAgB0DA,IACtD,MAAMC,SACFA,EAAAC,UACAA,EAAY,EAAAC,UACZA,EAAY,IACZC,EAAAA,iBAAiBJ,GAEfK,EAAeC,EAAAA,OAAuB,MACtCC,EAAiBD,EAAAA,OAAO,CAAEE,EAAG,EAAGC,EAAG,IAAKC,QACxCC,EAAkBL,EAAAA,OAAO,CAAEE,EAAGI,EAAAA,YAAY,GAAIH,EAAGG,EAAAA,YAAY,KAAMF,QAgCzE,OA9BAG,oBAAkB,CAACC,EAAGC,KAElB,MAAMC,EAAKC,OAAKN,EAAgBH,EAAEU,MAAOX,EAAeC,EAAG,GAAIO,GACzDI,EAAKF,OAAKN,EAAgBF,EAAES,MAAOX,EAAeE,EAAG,GAAIM,GAE/DJ,EAAgBH,EAAEY,IAAIJ,GACtBL,EAAgBF,EAAEW,IAAID,GAEtBE,EAAAA,QAAQC,MAAM,KACNjB,EAAaK,UACbL,EAAaK,QAAQa,MAAMC,UAAY,+BAA+BR,iBAAkBG,aAqBhGM,EAAAA,IAAC,MAAA,CACGC,IAAKrB,EACLsB,YAlBiBC,IACrB,IAAKvB,EAAaK,QAAS,OAC3B,MAAMmB,EAAOxB,EAAaK,QAAQoB,wBAC5BtB,GAAKoB,EAAEG,QAAUF,EAAKG,MAAQH,EAAKI,MAAQ,GAGjD1B,EAAeC,EAAS,MAFboB,EAAEM,QAAUL,EAAKM,KAAON,EAAKO,OAAS,IAEpBlC,EAC7BK,EAAeE,EAAQ,GAAJD,EAASN,GAYxBmC,aATiB,KACrB9B,EAAeC,EAAI,EACnBD,EAAeE,EAAI,GAQfN,UAAW,2BAA2BA,IACtCoB,MAAO,CACHe,WAAY,wBACZC,eAAgB,cAChBC,WAAY,aAGhBvC,SAAAwB,EAAAA,IAAC,OAAIF,MAAO,CAAEC,UAAW,mBAAoBe,eAAgB,eACxDtC"}
@@ -0,0 +1,2 @@
1
+ export * from './DepthCardPro';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cards/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { u as useAetherisProps } from "../useAetherisProps-Df5HX2Nd.js";
4
+ import { m as motionValue } from "../motionValue-C6kWEIe3.js";
5
+ import { d as damp } from "../interpolation-DI9if1ma.js";
6
+ import { u as useAnimationFrame } from "../useAnimationFrame-D_Zb5j5z.js";
7
+ import { b as batcher } from "../batching-vPvT9JKb.js";
8
+ const DepthCardPro = (props) => {
9
+ const {
10
+ children,
11
+ intensity = 1,
12
+ className = ""
13
+ } = useAetherisProps(props);
14
+ const containerRef = useRef(null);
15
+ const targetRotation = useRef({ x: 0, y: 0 }).current;
16
+ const currentRotation = useRef({ x: motionValue(0), y: motionValue(0) }).current;
17
+ useAnimationFrame((_, delta) => {
18
+ const rx = damp(currentRotation.x.get(), targetRotation.x, 10, delta);
19
+ const ry = damp(currentRotation.y.get(), targetRotation.y, 10, delta);
20
+ currentRotation.x.set(rx);
21
+ currentRotation.y.set(ry);
22
+ batcher.write(() => {
23
+ if (containerRef.current) {
24
+ containerRef.current.style.transform = `perspective(1000px) rotateX(${rx}deg) rotateY(${ry}deg)`;
25
+ }
26
+ });
27
+ });
28
+ const handleMouseMove = (e) => {
29
+ if (!containerRef.current) return;
30
+ const rect = containerRef.current.getBoundingClientRect();
31
+ const x = (e.clientX - rect.left) / rect.width - 0.5;
32
+ const y = (e.clientY - rect.top) / rect.height - 0.5;
33
+ targetRotation.x = -y * 20 * intensity;
34
+ targetRotation.y = x * 20 * intensity;
35
+ };
36
+ const handleMouseLeave = () => {
37
+ targetRotation.x = 0;
38
+ targetRotation.y = 0;
39
+ };
40
+ return /* @__PURE__ */ jsx(
41
+ "div",
42
+ {
43
+ ref: containerRef,
44
+ onMouseMove: handleMouseMove,
45
+ onMouseLeave: handleMouseLeave,
46
+ className: `aetheris-depth-card-pro ${className}`,
47
+ style: {
48
+ transition: "transform 0.1s linear",
49
+ transformStyle: "preserve-3d",
50
+ willChange: "transform"
51
+ },
52
+ children: /* @__PURE__ */ jsx("div", { style: { transform: "translateZ(50px)", transformStyle: "preserve-3d" }, children })
53
+ }
54
+ );
55
+ };
56
+ export {
57
+ DepthCardPro
58
+ };
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/cards/DepthCardPro.tsx"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,eAA4C,CAAC,UAAU;AAChE,QAAM;AAAA,IACF;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,IACZ,iBAAiB,KAAK;AAE1B,QAAM,eAAe,OAAuB,IAAI;AAChD,QAAM,iBAAiB,OAAO,EAAE,GAAG,GAAG,GAAG,EAAA,CAAG,EAAE;AAC9C,QAAM,kBAAkB,OAAO,EAAE,GAAG,YAAY,CAAC,GAAG,GAAG,YAAY,CAAC,EAAA,CAAG,EAAE;AAEzE,oBAAkB,CAAC,GAAG,UAAU;AAE5B,UAAM,KAAK,KAAK,gBAAgB,EAAE,OAAO,eAAe,GAAG,IAAI,KAAK;AACpE,UAAM,KAAK,KAAK,gBAAgB,EAAE,OAAO,eAAe,GAAG,IAAI,KAAK;AAEpE,oBAAgB,EAAE,IAAI,EAAE;AACxB,oBAAgB,EAAE,IAAI,EAAE;AAExB,YAAQ,MAAM,MAAM;AAChB,UAAI,aAAa,SAAS;AACtB,qBAAa,QAAQ,MAAM,YAAY,+BAA+B,EAAE,gBAAgB,EAAE;AAAA,MAC9F;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;AAED,QAAM,kBAAkB,CAAC,MAAwB;AAC7C,QAAI,CAAC,aAAa,QAAS;AAC3B,UAAM,OAAO,aAAa,QAAQ,sBAAA;AAClC,UAAM,KAAK,EAAE,UAAU,KAAK,QAAQ,KAAK,QAAQ;AACjD,UAAM,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,SAAS;AAEjD,mBAAe,IAAI,CAAC,IAAI,KAAK;AAC7B,mBAAe,IAAI,IAAI,KAAK;AAAA,EAChC;AAEA,QAAM,mBAAmB,MAAM;AAC3B,mBAAe,IAAI;AACnB,mBAAe,IAAI;AAAA,EACvB;AAEA,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAK;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,WAAW,2BAA2B,SAAS;AAAA,MAC/C,OAAO;AAAA,QACH,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,YAAY;AAAA,MAAA;AAAA,MAGhB,UAAA,oBAAC,SAAI,OAAO,EAAE,WAAW,oBAAoB,gBAAgB,cAAA,GACxD,SAAA,CACL;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
@@ -0,0 +1 @@
1
+ export * from './cards/index'
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface BodyProps {
4
+ children: React.ReactElement;
5
+ mass?: number;
6
+ drag?: number;
7
+ restitution?: number;
8
+ initialX?: number;
9
+ initialY?: number;
10
+ }
11
+ /**
12
+ * Body
13
+ * A wrapper that attaches physics properties to a DOM element.
14
+ */
15
+ export declare const Body: React.FC<BodyProps>;
16
+ //# sourceMappingURL=Body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../src/core/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,MAAM,WAAW,SAAS;IACtB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA8DpC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface ForceFieldProps {
4
+ type: 'repulsion' | 'attraction' | 'gravity';
5
+ x: number;
6
+ y: number;
7
+ strength: number;
8
+ radius?: number;
9
+ }
10
+ /**
11
+ * ForceField
12
+ * Applies a constant or radial force within the PhysicsWorld.
13
+ */
14
+ export declare const ForceField: React.FC<ForceFieldProps>;
15
+ //# sourceMappingURL=ForceField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForceField.d.ts","sourceRoot":"","sources":["../../src/core/ForceField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqBhD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+
3
+ /**
4
+ * MotionOverlay
5
+ * A developer HUD for monitoring engine performance and debug states.
6
+ */
7
+ export declare const MotionOverlay: React.FC;
8
+ //# sourceMappingURL=MotionOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MotionOverlay.d.ts","sourceRoot":"","sources":["../../src/core/MotionOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EA0CjC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface MotionConfig {
4
+ debug?: boolean;
5
+ reducedMotion?: 'auto' | 'always' | 'never';
6
+ theme?: 'light' | 'dark' | 'auto';
7
+ intensityMultiplier?: number;
8
+ }
9
+ export declare const MotionProvider: React.FC<{
10
+ config?: MotionConfig;
11
+ children: React.ReactNode;
12
+ }>;
13
+ export declare const useMotionConfig: () => MotionConfig;
14
+ //# sourceMappingURL=MotionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MotionProvider.d.ts","sourceRoot":"","sources":["../../src/core/MotionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,YAAY;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AASD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAazF,CAAC;AAEF,eAAO,MAAM,eAAe,oBAAkC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Batcher
3
+ * A centralized DOM write-batching system to prevent layout thrashing.
4
+ * Groups all DOM updates into a single "write" phase of the animation frame.
5
+ */
6
+ declare class Batcher {
7
+ private readCallbacks;
8
+ private writeCallbacks;
9
+ private isProcessing;
10
+ constructor();
11
+ /**
12
+ * Schedule a DOM "read" operation (measurements).
13
+ */
14
+ read(cb: () => void): void;
15
+ /**
16
+ * Schedule a DOM "write" operation (mutations).
17
+ */
18
+ write(cb: () => void): void;
19
+ private process;
20
+ }
21
+ export declare const batcher: Batcher;
22
+ export {};
23
+ //# sourceMappingURL=batching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batching.d.ts","sourceRoot":"","sources":["../../src/core/batching.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,OAAO;IACT,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,YAAY,CAAkB;;IAQtC;;OAEG;IACI,IAAI,CAAC,EAAE,EAAE,MAAM,IAAI;IAI1B;;OAEG;IACI,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI;IAI3B,OAAO,CAAC,OAAO;CAoBlB;AAED,eAAO,MAAM,OAAO,SAAgB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared Easing Functions
3
+ * Standard easing curves for smooth animations.
4
+ */
5
+ export type EasingFunction = (t: number) => number;
6
+ export declare const ease: {
7
+ linear: (t: number) => number;
8
+ inQuad: (t: number) => number;
9
+ outQuad: (t: number) => number;
10
+ inOutQuad: (t: number) => number;
11
+ inCubic: (t: number) => number;
12
+ outCubic: (t: number) => number;
13
+ inOutCubic: (t: number) => number;
14
+ inQuart: (t: number) => number;
15
+ outQuart: (t: number) => number;
16
+ inOutQuart: (t: number) => number;
17
+ inQuint: (t: number) => number;
18
+ outQuint: (t: number) => number;
19
+ inExpo: (t: number) => number;
20
+ outExpo: (t: number) => number;
21
+ elasticOut: (t: number) => number;
22
+ };
23
+ /**
24
+ * Lerp (Linear Interpolation)
25
+ */
26
+ export declare const lerp: (start: number, end: number, amt: number) => number;
27
+ /**
28
+ * Clamp value between min and max
29
+ */
30
+ export declare const clamp: (val: number, min: number, max: number) => number;
31
+ //# sourceMappingURL=easing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../src/core/easing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEnD,eAAO,MAAM,IAAI;gBACD,MAAM;gBACN,MAAM;iBACL,MAAM;mBACJ,MAAM;iBACR,MAAM;kBACL,MAAM;oBACJ,MAAM;iBAET,MAAM;kBACL,MAAM;oBACJ,MAAM;iBAET,MAAM;kBACL,MAAM;gBACR,MAAM;iBACL,MAAM;oBACH,MAAM;CAKzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WAC3B,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty,e=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../ticker-DVYSZRUG.cjs"),s=require("../MotionProvider-CEWupIo9.cjs"),r=require("../motionValue-BGCWkNUM.cjs"),o=require("../interpolation-C3PO0EIn.cjs"),n=require("../batching-BN2ZpDzo.cjs"),a=require("../Body-ebC4lyJ7.cjs"),u=require("react"),c=require("react/jsx-runtime"),h=require("../useAnimationFrame-CTzG2uLX.cjs"),l={soft:{stiffness:100,damping:10,mass:1},stiff:{stiffness:200,damping:20,mass:1},bouncy:{stiffness:200,damping:10,mass:1}};class d{constructor(){e(this,"entries",[]),e(this,"currentTime",0),e(this,"isPlaying",!1),e(this,"onComplete"),e(this,"totalDuration",0),e(this,"update",(t,e)=>{var i;this.isPlaying&&(this.currentTime+=e/1e3,this.entries.forEach(t=>{if(this.currentTime<t.startTime)return;if(this.currentTime>t.endTime)return void t.value.set(t.target);const e=t.easing((this.currentTime-t.startTime)/t.duration),i=t._startValue??t.value.get();void 0===t._startValue&&(t._startValue=i);const s=o.lerp(i,t.target,e);t.value.set(s)}),this.currentTime>=this.totalDuration&&(this.stop(),null==(i=this.onComplete)||i.call(this)))})}to(t,e,i={}){const{duration:s=.5,delay:r=0,easing:o=t=>t}=i,n=this.totalDuration+r,a={value:t,target:e,duration:s,delay:r,startTime:n,endTime:n+s,easing:o};return this.entries.push(a),this.totalDuration=Math.max(this.totalDuration,a.endTime),this}wait(t){return this.totalDuration+=t,this}play(){this.isPlaying||(this.isPlaying=!0,this.currentTime=0,i.ticker.add(this.update))}stop(){this.isPlaying=!1,i.ticker.remove(this.update)}onFinish(t){return this.onComplete=t,this}}exports.ticker=i.ticker,exports.MotionProvider=s.MotionProvider,exports.useMotionConfig=s.useMotionConfig,exports.MotionValue=r.MotionValue,exports.motionValue=r.motionValue,exports.clamp=o.clamp,exports.damp=o.damp,exports.isNear=o.isNear,exports.lerp=o.lerp,exports.mapRange=o.mapRange,exports.batcher=n.batcher,exports.Body=a.Body,exports.PhysicsWorld=a.PhysicsWorld,exports.usePhysics=a.usePhysics,exports.ForceField=({type:t,x:e,y:i,strength:s,radius:r=500})=>(a.usePhysics(),u.useEffect(()=>{},[e,i,s,r,t]),null),exports.MotionOverlay=()=>{const{debug:t}=s.useMotionConfig(),[e,i]=u.useState(0),r=u.useRef(0),o=u.useRef(performance.now());return h.useAnimationFrame(t=>{r.current++,t-o.current>1e3&&(i(Math.round(1e3*r.current/(t-o.current))),r.current=0,o.current=t)},!!t),t?c.jsxs("div",{style:{position:"fixed",bottom:"1rem",right:"1rem",background:"rgba(0,0,0,0.85)",color:"#00ff00",padding:"0.75rem 1rem",borderRadius:"0.5rem",fontSize:"0.75rem",fontFamily:"monospace",pointerEvents:"none",zIndex:1e4,border:"1px solid rgba(0,255,0,0.3)",boxShadow:"0 4px 12px rgba(0,0,0,0.5)"},children:[c.jsx("div",{style:{fontWeight:"bold",marginBottom:"0.25rem",borderBottom:"1px solid rgba(0,255,0,0.2)"},children:"AETHERIS ENGINE HUD"}),c.jsxs("div",{children:["FPS: ",e]}),c.jsx("div",{children:"CORE: Active"}),c.jsx("div",{children:"BATCHER: Enabled"}),c.jsx("div",{children:"PHYSICS: Optimized"})]}):null},exports.PRESETS=l,exports.Spring=class{constructor(t,i=l.soft){e(this,"pos"),e(this,"target"),e(this,"vel",0),e(this,"config"),this.pos=t,this.target=t,this.config=i}setTarget(t){this.target=t}update(t){const e=t/1e3;return this.vel+=(-this.config.stiffness*(this.pos-this.target)+-this.config.damping*this.vel)/this.config.mass*e,this.pos+=this.vel*e,this.pos}getPosition(){return this.pos}isResting(t=.001){return Math.abs(this.vel)<t&&Math.abs(this.pos-this.target)<t}},exports.createTimeline=()=>new d,exports.motionPresets={soft:{duration:.8,easing:"outQuart",intensity:1},dramatic:{duration:1.2,easing:"outExpo",intensity:1.5},elastic:{duration:.6,easing:"elasticOut",intensity:1.2},cinematic:{duration:2,easing:"inOutCubic",intensity:.8}};
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/core/physics.ts","../../src/core/timeline.ts","../../src/core/ForceField.tsx","../../src/core/MotionOverlay.tsx","../../src/core/presets.ts"],"names":["PRESETS","soft","stiffness","damping","mass","stiff","bouncy","Timeline","constructor","__publicField","this","_","delta","isPlaying","currentTime","entries","forEach","entry","startTime","endTime","value","set","target","easedProgress","easing","duration","startValue","_startValue","get","nextValue","lerp","totalDuration","stop","_a","onComplete","call","to","options","delay","t","startOffset","push","Math","max","wait","play","ticker","add","update","remove","onFinish","cb","type","x","y","strength","radius","usePhysics","useEffect","debug","useMotionConfig","fps","setFps","useState","frameCount","useRef","lastTime","performance","now","useAnimationFrame","current","round","jsxs","style","position","bottom","right","background","color","padding","borderRadius","fontSize","fontFamily","pointerEvents","zIndex","border","boxShadow","children","jsx","fontWeight","marginBottom","borderBottom","initial","config","pos","setTarget","v","dt","vel","getPosition","isResting","threshold","abs","intensity","dramatic","elastic","cinematic"],"mappings":"6jBAWaA,EAAwC,CACjDC,KAAM,CAAEC,UAAW,IAAKC,QAAS,GAAIC,KAAM,GAC3CC,MAAO,CAAEH,UAAW,IAAKC,QAAS,GAAIC,KAAM,GAC5CE,OAAQ,CAAEJ,UAAW,IAAKC,QAAS,GAAIC,KAAM,ICKjD,MAAMG,EAAN,WAAAC,GACYC,EAAAC,KAAA,UAA2B,IAC3BD,EAAAC,KAAA,cAAsB,GACtBD,EAAAC,KAAA,aAAqB,GACrBD,EAAAC,KAAA,cACAD,EAAAC,KAAA,gBAAwB,GAwDxBD,EAAAC,KAAA,SAAS,CAACC,EAAWC,WACpBF,KAAKG,YAEVH,KAAKI,aAAeF,EAAQ,IAE5BF,KAAKK,QAAQC,QAASC,IAClB,GAAIP,KAAKI,YAAcG,EAAMC,UAAW,OACxC,GAAIR,KAAKI,YAAcG,EAAME,QAEzB,YADAF,EAAMG,MAAMC,IAAIJ,EAAMK,QAI1B,MACMC,EAAgBN,EAAMO,QADVd,KAAKI,YAAcG,EAAMC,WAAaD,EAAMQ,UAGxDC,EAAcT,EAAcU,aAAeV,EAAMG,MAAMQ,WAC1B,IAA9BX,EAAcU,cAA4BV,EAAcU,YAAcD,GAE3E,MAAMG,EAAYC,EAAAA,KAAKJ,EAAYT,EAAMK,OAAQC,GACjDN,EAAMG,MAAMC,IAAIQ,KAGhBnB,KAAKI,aAAeJ,KAAKqB,gBACzBrB,KAAKsB,OACL,OAAAC,EAAAvB,KAAKwB,aAALD,E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OAAQ,aACR+E,UAAW,KAEfG,UAAW,CACPjF,SAAU,EACVD,OAAQ,aACR+E,UAAW"}
@@ -0,0 +1,13 @@
1
+ export * from './ticker';
2
+ export * from './physics';
3
+ export * from './presets';
4
+ export * from './MotionProvider';
5
+ export * from './motionValue';
6
+ export * from './interpolation';
7
+ export * from './batching';
8
+ export * from './timeline';
9
+ export * from './physicsWorld';
10
+ export * from './Body';
11
+ export * from './ForceField';
12
+ export * from './MotionOverlay';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,223 @@
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
+ import { u as useMotionConfig } from "../MotionProvider-iE1UXJc6.js";
6
+ import { M } from "../MotionProvider-iE1UXJc6.js";
7
+ import { M as M2, m } from "../motionValue-C6kWEIe3.js";
8
+ import { l as lerp } from "../interpolation-DI9if1ma.js";
9
+ import { c, d, i, m as m2 } from "../interpolation-DI9if1ma.js";
10
+ import { b } from "../batching-vPvT9JKb.js";
11
+ import { u as usePhysics } from "../Body-P2dJJsnJ.js";
12
+ import { B, P } from "../Body-P2dJJsnJ.js";
13
+ import { useEffect, useState, useRef } from "react";
14
+ import { jsxs, jsx } from "react/jsx-runtime";
15
+ import { u as useAnimationFrame } from "../useAnimationFrame-D_Zb5j5z.js";
16
+ const PRESETS = {
17
+ soft: { stiffness: 100, damping: 10, mass: 1 },
18
+ stiff: { stiffness: 200, damping: 20, mass: 1 },
19
+ bouncy: { stiffness: 200, damping: 10, mass: 1 }
20
+ };
21
+ class Spring {
22
+ constructor(initial, config = PRESETS.soft) {
23
+ __publicField(this, "pos");
24
+ __publicField(this, "target");
25
+ __publicField(this, "vel", 0);
26
+ __publicField(this, "config");
27
+ this.pos = initial;
28
+ this.target = initial;
29
+ this.config = config;
30
+ }
31
+ setTarget(v) {
32
+ this.target = v;
33
+ }
34
+ update(delta) {
35
+ const dt = delta / 1e3;
36
+ const force = -this.config.stiffness * (this.pos - this.target);
37
+ const damping = -this.config.damping * this.vel;
38
+ const acceleration = (force + damping) / this.config.mass;
39
+ this.vel += acceleration * dt;
40
+ this.pos += this.vel * dt;
41
+ return this.pos;
42
+ }
43
+ getPosition() {
44
+ return this.pos;
45
+ }
46
+ isResting(threshold = 1e-3) {
47
+ return Math.abs(this.vel) < threshold && Math.abs(this.pos - this.target) < threshold;
48
+ }
49
+ }
50
+ const motionPresets = {
51
+ soft: {
52
+ duration: 0.8,
53
+ easing: "outQuart",
54
+ intensity: 1
55
+ },
56
+ dramatic: {
57
+ duration: 1.2,
58
+ easing: "outExpo",
59
+ intensity: 1.5
60
+ },
61
+ elastic: {
62
+ duration: 0.6,
63
+ easing: "elasticOut",
64
+ intensity: 1.2
65
+ },
66
+ cinematic: {
67
+ duration: 2,
68
+ easing: "inOutCubic",
69
+ intensity: 0.8
70
+ }
71
+ };
72
+ class Timeline {
73
+ constructor() {
74
+ __publicField(this, "entries", []);
75
+ __publicField(this, "currentTime", 0);
76
+ __publicField(this, "isPlaying", false);
77
+ __publicField(this, "onComplete");
78
+ __publicField(this, "totalDuration", 0);
79
+ __publicField(this, "update", (_, delta) => {
80
+ var _a;
81
+ if (!this.isPlaying) return;
82
+ this.currentTime += delta / 1e3;
83
+ this.entries.forEach((entry) => {
84
+ if (this.currentTime < entry.startTime) return;
85
+ if (this.currentTime > entry.endTime) {
86
+ entry.value.set(entry.target);
87
+ return;
88
+ }
89
+ const progress = (this.currentTime - entry.startTime) / entry.duration;
90
+ const easedProgress = entry.easing(progress);
91
+ const startValue = entry._startValue ?? entry.value.get();
92
+ if (entry._startValue === void 0) entry._startValue = startValue;
93
+ const nextValue = lerp(startValue, entry.target, easedProgress);
94
+ entry.value.set(nextValue);
95
+ });
96
+ if (this.currentTime >= this.totalDuration) {
97
+ this.stop();
98
+ (_a = this.onComplete) == null ? void 0 : _a.call(this);
99
+ }
100
+ });
101
+ }
102
+ /**
103
+ * Add a property animation to the timeline.
104
+ */
105
+ to(value, target, options = {}) {
106
+ const { duration = 0.5, delay = 0, easing = (t) => t } = options;
107
+ const startOffset = this.totalDuration + delay;
108
+ const entry = {
109
+ value,
110
+ target,
111
+ duration,
112
+ delay,
113
+ startTime: startOffset,
114
+ endTime: startOffset + duration,
115
+ easing
116
+ };
117
+ this.entries.push(entry);
118
+ this.totalDuration = Math.max(this.totalDuration, entry.endTime);
119
+ return this;
120
+ }
121
+ /**
122
+ * Add a explicit pause/wait to the timeline.
123
+ */
124
+ wait(duration) {
125
+ this.totalDuration += duration;
126
+ return this;
127
+ }
128
+ /**
129
+ * Start playing the timeline.
130
+ */
131
+ play() {
132
+ if (this.isPlaying) return;
133
+ this.isPlaying = true;
134
+ this.currentTime = 0;
135
+ ticker.add(this.update);
136
+ }
137
+ /**
138
+ * Stop/Reset the timeline.
139
+ */
140
+ stop() {
141
+ this.isPlaying = false;
142
+ ticker.remove(this.update);
143
+ }
144
+ onFinish(cb) {
145
+ this.onComplete = cb;
146
+ return this;
147
+ }
148
+ }
149
+ const createTimeline = () => new Timeline();
150
+ const ForceField = ({
151
+ type,
152
+ x,
153
+ y,
154
+ strength,
155
+ radius = 500
156
+ }) => {
157
+ usePhysics();
158
+ useEffect(() => {
159
+ }, [x, y, strength, radius, type]);
160
+ return null;
161
+ };
162
+ const MotionOverlay = () => {
163
+ const { debug } = useMotionConfig();
164
+ const [fps, setFps] = useState(0);
165
+ const frameCount = useRef(0);
166
+ const lastTime = useRef(performance.now());
167
+ useAnimationFrame((now) => {
168
+ frameCount.current++;
169
+ if (now - lastTime.current > 1e3) {
170
+ setFps(Math.round(frameCount.current * 1e3 / (now - lastTime.current)));
171
+ frameCount.current = 0;
172
+ lastTime.current = now;
173
+ }
174
+ }, !!debug);
175
+ if (!debug) return null;
176
+ return /* @__PURE__ */ jsxs("div", { style: {
177
+ position: "fixed",
178
+ bottom: "1rem",
179
+ right: "1rem",
180
+ background: "rgba(0,0,0,0.85)",
181
+ color: "#00ff00",
182
+ padding: "0.75rem 1rem",
183
+ borderRadius: "0.5rem",
184
+ fontSize: "0.75rem",
185
+ fontFamily: "monospace",
186
+ pointerEvents: "none",
187
+ zIndex: 1e4,
188
+ border: "1px solid rgba(0,255,0,0.3)",
189
+ boxShadow: "0 4px 12px rgba(0,0,0,0.5)"
190
+ }, children: [
191
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: "bold", marginBottom: "0.25rem", borderBottom: "1px solid rgba(0,255,0,0.2)" }, children: "AETHERIS ENGINE HUD" }),
192
+ /* @__PURE__ */ jsxs("div", { children: [
193
+ "FPS: ",
194
+ fps
195
+ ] }),
196
+ /* @__PURE__ */ jsx("div", { children: "CORE: Active" }),
197
+ /* @__PURE__ */ jsx("div", { children: "BATCHER: Enabled" }),
198
+ /* @__PURE__ */ jsx("div", { children: "PHYSICS: Optimized" })
199
+ ] });
200
+ };
201
+ export {
202
+ B as Body,
203
+ ForceField,
204
+ MotionOverlay,
205
+ M as MotionProvider,
206
+ M2 as MotionValue,
207
+ PRESETS,
208
+ P as PhysicsWorld,
209
+ Spring,
210
+ b as batcher,
211
+ c as clamp,
212
+ createTimeline,
213
+ d as damp,
214
+ i as isNear,
215
+ lerp,
216
+ m2 as mapRange,
217
+ motionPresets,
218
+ m as motionValue,
219
+ ticker,
220
+ useMotionConfig,
221
+ usePhysics
222
+ };
223
+ //# sourceMappingURL=index.js.map