element-plus/packages/utils/easings.ts
赵添 25bebce59d
feat(components): anchor component (#15670)
* feat(components): anchor component

* fix(components): [anchor] marker opacity style

* test(components): [anchor] update snapshots

* fix(components): [anchor] style change and add version tag

* docs(components): [anchor] affix mode demo add affix offset

* fix(components): [anchor] change api

* fix: slot name change

* fix: scrollTo method change

* fix: delete getCurrentAnchor api

* style: text overflow

* docs: change toc to anchor

* refactor: useEventListener

* fix: update

* fix: update
2024-02-27 14:22:26 +08:00

9 lines
213 B
TypeScript

export function easeInOutCubic(t: number, b: number, c: number, d: number) {
const cc = c - b
t /= d / 2
if (t < 1) {
return (cc / 2) * t * t * t + b
}
return (cc / 2) * ((t -= 2) * t * t + 2) + b
}