Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for all easing types with WAAPI (#1830)
* Adding support for back/circ easings to WAAPI * Updating * Updating changelog * Fixing logic * Updating test * Pregenerating keyframes for unsupported easing functions * Fixing test * Renaming supported easing * Adding comment
- Loading branch information
1 parent
721ec8e
commit 4fc0790
Showing
8 changed files
with
262 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
import { createBackIn } from "./back" | ||
import { EasingFunction } from "./types" | ||
import { backIn } from "./back" | ||
|
||
const createAnticipate = (power?: number): EasingFunction => { | ||
const backEasing = createBackIn(power) | ||
return (p) => | ||
(p *= 2) < 1 | ||
? 0.5 * backEasing(p) | ||
: 0.5 * (2 - Math.pow(2, -10 * (p - 1))) | ||
} | ||
|
||
export const anticipate = createAnticipate() | ||
export const anticipate = (p: number) => | ||
(p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import { cubicBezier } from "./cubic-bezier" | ||
import { mirrorEasing } from "./modifiers/mirror" | ||
import { reverseEasing } from "./modifiers/reverse" | ||
import { EasingFunction } from "./types" | ||
|
||
export const createBackIn = | ||
(power: number = 1.525): EasingFunction => | ||
(p) => | ||
p * p * ((power + 1) * p - power) | ||
|
||
export const backIn = createBackIn() | ||
export const backOut = reverseEasing(backIn) | ||
export const backOut = cubicBezier(0.33, 1.53, 0.69, 0.99) | ||
export const backIn = reverseEasing(backOut) | ||
export const backInOut = mirrorEasing(backIn) |
Oops, something went wrong.