@ssgoi/core 2.5.4 → 2.5.6
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/dist/animator/animate/css-runner.d.ts +17 -0
- package/dist/animator/animate/css-runner.d.ts.map +1 -0
- package/dist/animator/animate/index.d.ts +42 -0
- package/dist/animator/animate/index.d.ts.map +1 -0
- package/dist/animator/animate/tick-runner.d.ts +16 -0
- package/dist/animator/animate/tick-runner.d.ts.map +1 -0
- package/dist/animator/animate/types.d.ts +31 -0
- package/dist/animator/animate/types.d.ts.map +1 -0
- package/dist/animator/animation-scheduler.d.ts +4 -17
- package/dist/animator/animation-scheduler.d.ts.map +1 -1
- package/dist/animator/index.d.ts +32 -32
- package/dist/animator/index.d.ts.map +1 -1
- package/dist/animator/spring-core.d.ts +63 -0
- package/dist/animator/spring-core.d.ts.map +1 -0
- package/dist/animator/ticker.d.ts +1 -0
- package/dist/animator/ticker.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +567 -608
- package/dist/jaemin-BG8HRXG1.cjs +1 -0
- package/dist/{jaemin-BAi8PTrj.js → jaemin-BWkrXq0V.js} +21 -20
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-swipe-detector.d.ts +1 -0
- package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -1
- package/dist/transition/create-transition-callback.d.ts +2 -2
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +16 -16
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transition/transition.d.ts +2 -18
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +74 -34
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +21 -6
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +7 -7
- package/dist/view-transitions/index.js +298 -284
- package/package.json +1 -1
- package/dist/animator/animate.d.ts +0 -35
- package/dist/animator/animate.d.ts.map +0 -1
- package/dist/jaemin-DL1-g_B5.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom spring animation implementation (replacing popmotion)
|
|
3
|
-
* Interface-compatible with popmotion's animate function
|
|
4
|
-
* Uses optimized semi-implicit Euler method (Allen Chou's approach)
|
|
5
|
-
*/
|
|
6
|
-
export interface AnimateOptions {
|
|
7
|
-
from: number;
|
|
8
|
-
to: number;
|
|
9
|
-
stiffness: number;
|
|
10
|
-
damping: number;
|
|
11
|
-
mass: number;
|
|
12
|
-
velocity?: number;
|
|
13
|
-
onUpdate: (value: number) => void;
|
|
14
|
-
onComplete: () => void;
|
|
15
|
-
}
|
|
16
|
-
export interface AnimationControls {
|
|
17
|
-
stop: () => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Spring-based animation using optimized semi-implicit Euler
|
|
21
|
-
* Based on Allen Chou's implementation for stability and performance
|
|
22
|
-
*
|
|
23
|
-
* Instead of computing F = -k(x-xt) - d*v, then a = F/m,
|
|
24
|
-
* we use angular frequency (omega) and damping ratio (zeta):
|
|
25
|
-
* - omega = sqrt(k/m) - angular frequency
|
|
26
|
-
* - zeta = d/(2*sqrt(k*m)) - damping ratio
|
|
27
|
-
*
|
|
28
|
-
* Semi-implicit Euler update:
|
|
29
|
-
* v += -2*h*zeta*omega*v + h*omega^2*(xt - x)
|
|
30
|
-
* x += h*v
|
|
31
|
-
*
|
|
32
|
-
* This formulation is more stable and efficient than the naive approach.
|
|
33
|
-
*/
|
|
34
|
-
export declare function animate(options: AnimateOptions): AnimationControls;
|
|
35
|
-
//# sourceMappingURL=animate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAgFlE"}
|
package/dist/jaemin-DL1-g_B5.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function b(i,a){function o(d){let l=0,y=0;const t=d.offsetWidth,g=d.offsetHeight;let s=d;for(;s;)l+=s.offsetTop,y+=s.offsetLeft,s=s.offsetParent;return l-=window.scrollY,y-=window.scrollX,{top:l,left:y,width:t,height:g}}const e=o(i),n=o(a);return new DOMRect(n.left-e.left,n.top-e.top,n.width,n.height)}const x=(i,a)=>{i.style.position="absolute",i.style.width="100%",i.style.top=`${-1*((a==null?void 0:a.scroll.y)??0)}px`,i.style.left="0"};function M(i,a="viewport"){if(a==="positioned-parent"){const o=i.positionedParent.getBoundingClientRect();return{top:o.top,left:o.left,width:o.width,height:o.height}}else{const o=b(document.body,i.positionedParent);return{top:i.scroll.y,left:0,width:o.width,height:window.innerHeight-o.top}}}const F=(i={})=>R(i),R=(i={})=>{var l,y;const a={stiffness:((l=i.spring)==null?void 0:l.stiffness)??50,damping:((y=i.spring)==null?void 0:y.damping)??30},o=i.initialRotation??45,e=i.initialScale??.01,n=i.rotationTriggerPoint??.8,d=i.containerMode??"viewport";return{out:async(t,g)=>{const s=t.style.opacity;return{spring:{stiffness:80,damping:25},from:1,to:0,prepare:()=>{x(t,g),t.style.opacity="1"},tick:w=>{t.style.opacity=String(w)},onEnd:()=>{t.style.opacity=s}}},in:async(t,g)=>{const s=M(g,d),w=t.style.transform,$=t.style.transformOrigin,O=t.style.position,v=t.style.zIndex;return{spring:a,from:0,to:1,prepare:()=>{const r=Math.min(s.width,s.height)*.4;if(t.style.setProperty("--max-border-radius",`${r}px`),t.style.setProperty("--border-radius-scale","1"),t.style.willChange="transform",t.style.backfaceVisibility="hidden",d==="positioned-parent")t.style.transformOrigin="50% 50%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=`${s.width}px`,t.style.height=`${s.height}px`;else{const p=s.left+s.width/2,h=s.top+s.height/2;t.style.transformOrigin=`${p}px ${h}px`,t.style.position="fixed",t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.width=`${s.width}px`,t.style.height=`${s.height}px`}t.style.zIndex="1000",t.style.overflow="hidden",t.style.transform=`rotate(${o}deg) scale(${e}) translateZ(0)`,t.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",t.style.opacity="1"},tick:r=>{let p;if(r<=.05)p=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);p=e+(.8-e)*u}else{const c=(r-n)/(1-n);p=.8+.2*(1-Math.pow(1-c,3))}let h;const f=.7;if(r<=f)h=o;else{const c=(r-f)/(1-f),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=f)P=1;else{const c=(r-f)/(1-f);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,t.style.setProperty("--border-radius-scale",P.toFixed(4))},onEnd:()=>{t.style.willChange="",t.style.backfaceVisibility="",t.style.removeProperty("--max-border-radius"),t.style.removeProperty("--border-radius-scale"),t.style.transform=w,t.style.transformOrigin=$,t.style.position=O,t.style.zIndex=v,t.style.top="",t.style.left="",t.style.width="",t.style.height="",t.style.overflow="",t.style.borderRadius=""}}}}};exports.getRect=b;exports.jaemin=F;exports.jaeminInternal=R;exports.prepareOutgoing=x;
|