modernize
- replace vite with tsdown - update registry - update deps
This commit is contained in:
22
dist/easings/easings.d.ts
vendored
22
dist/easings/easings.d.ts
vendored
@@ -1,10 +1,18 @@
|
||||
//#region src/easings/easings.d.ts
|
||||
type CubicBezierEase = [number, number, number, number];
|
||||
type TransitionConfig = {
|
||||
type: string;
|
||||
duration: number;
|
||||
ease: CubicBezierEase;
|
||||
delay?: number;
|
||||
};
|
||||
type EasingCollection = {
|
||||
out: any;
|
||||
in: any;
|
||||
inOut: any;
|
||||
out: TransitionConfig;
|
||||
in: TransitionConfig;
|
||||
inOut: TransitionConfig;
|
||||
};
|
||||
type EasingFunction = (duration: number, delay?: number) => EasingCollection;
|
||||
declare const Easings: {
|
||||
[key: string]: EasingFunction;
|
||||
};
|
||||
export default Easings;
|
||||
type EasingName = "sine" | "quad" | "cubic" | "quart" | "quint" | "expo" | "circ" | "back" | "elastic" | "bounce";
|
||||
declare const Easings: Record<EasingName, EasingFunction>;
|
||||
//#endregion
|
||||
export { Easings as default };
|
||||
195
dist/easings/easings.js
vendored
Normal file
195
dist/easings/easings.js
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
//#region src/easings/easings.ts
|
||||
const Easings = {
|
||||
sine: (duration, delay) => easing([
|
||||
.47,
|
||||
0,
|
||||
.745,
|
||||
.715
|
||||
], [
|
||||
.39,
|
||||
.575,
|
||||
.565,
|
||||
1
|
||||
], [
|
||||
.445,
|
||||
.05,
|
||||
.55,
|
||||
.95
|
||||
], duration, delay),
|
||||
quad: (duration, delay) => easing([
|
||||
.55,
|
||||
.085,
|
||||
.68,
|
||||
.19
|
||||
], [
|
||||
.25,
|
||||
.46,
|
||||
.45,
|
||||
1
|
||||
], [
|
||||
.455,
|
||||
.03,
|
||||
.515,
|
||||
.955
|
||||
], duration, delay),
|
||||
cubic: (duration, delay) => easing([
|
||||
.55,
|
||||
.055,
|
||||
.675,
|
||||
.19
|
||||
], [
|
||||
.215,
|
||||
.61,
|
||||
.355,
|
||||
1
|
||||
], [
|
||||
.645,
|
||||
.045,
|
||||
.355,
|
||||
1
|
||||
], duration, delay),
|
||||
quart: (duration, delay) => easing([
|
||||
.895,
|
||||
.03,
|
||||
.685,
|
||||
.22
|
||||
], [
|
||||
.165,
|
||||
.84,
|
||||
.44,
|
||||
1
|
||||
], [
|
||||
.77,
|
||||
0,
|
||||
.175,
|
||||
1
|
||||
], duration, delay),
|
||||
quint: (duration, delay) => easing([
|
||||
.755,
|
||||
.05,
|
||||
.855,
|
||||
.06
|
||||
], [
|
||||
.23,
|
||||
1,
|
||||
.32,
|
||||
1
|
||||
], [
|
||||
.86,
|
||||
0,
|
||||
.07,
|
||||
1
|
||||
], duration, delay),
|
||||
expo: (duration, delay) => easing([
|
||||
.95,
|
||||
.05,
|
||||
.795,
|
||||
.035
|
||||
], [
|
||||
.19,
|
||||
1,
|
||||
.22,
|
||||
1
|
||||
], [
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
], duration, delay),
|
||||
circ: (duration, delay) => easing([
|
||||
.6,
|
||||
.04,
|
||||
.98,
|
||||
.335
|
||||
], [
|
||||
.075,
|
||||
.82,
|
||||
.165,
|
||||
1
|
||||
], [
|
||||
.785,
|
||||
.135,
|
||||
.15,
|
||||
.86
|
||||
], duration, delay),
|
||||
back: (duration, delay) => easing([
|
||||
.55,
|
||||
.055,
|
||||
.675,
|
||||
.19
|
||||
], [
|
||||
.175,
|
||||
.885,
|
||||
.32,
|
||||
1.275
|
||||
], [
|
||||
.68,
|
||||
-.55,
|
||||
.265,
|
||||
1.585
|
||||
], duration, delay),
|
||||
elastic: (duration, delay) => easing([
|
||||
.95,
|
||||
0,
|
||||
.7,
|
||||
.01
|
||||
], [
|
||||
.37,
|
||||
0,
|
||||
.63,
|
||||
1
|
||||
], [
|
||||
.37,
|
||||
0,
|
||||
.63,
|
||||
1
|
||||
], duration, delay),
|
||||
bounce: (duration, delay) => easing([
|
||||
.55,
|
||||
.06,
|
||||
.67,
|
||||
.19
|
||||
], [
|
||||
.215,
|
||||
.61,
|
||||
.355,
|
||||
1
|
||||
], [
|
||||
.215,
|
||||
.61,
|
||||
.355,
|
||||
1
|
||||
], duration, delay)
|
||||
};
|
||||
const defaultCubicTransition = {
|
||||
type: "tween",
|
||||
duration: .7
|
||||
};
|
||||
const easing = (easeIn, easeOut, easeInOut, duration, delay) => {
|
||||
const durationObj = duration ? { duration } : {};
|
||||
const delayObj = delay ? { delay } : {};
|
||||
return {
|
||||
in: {
|
||||
...defaultCubicTransition,
|
||||
ease: easeIn,
|
||||
...durationObj,
|
||||
...delayObj
|
||||
},
|
||||
out: {
|
||||
...defaultCubicTransition,
|
||||
ease: easeOut,
|
||||
...durationObj,
|
||||
...delayObj
|
||||
},
|
||||
inOut: {
|
||||
...defaultCubicTransition,
|
||||
ease: easeInOut,
|
||||
...durationObj,
|
||||
...delayObj
|
||||
}
|
||||
};
|
||||
};
|
||||
var easings_default = Easings;
|
||||
|
||||
//#endregion
|
||||
export { easings_default as default };
|
||||
Reference in New Issue
Block a user