From f5471364d84833fb1c7ef4c3116273b51ce5dbf8 Mon Sep 17 00:00:00 2001 From: Gina Lee Date: Thu, 14 Nov 2024 01:58:33 +0800 Subject: [PATCH] Add constants/animations.js --- src/constants/animations.js | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/constants/animations.js diff --git a/src/constants/animations.js b/src/constants/animations.js new file mode 100644 index 000000000..d3e9b1bbc --- /dev/null +++ b/src/constants/animations.js @@ -0,0 +1,50 @@ +export const animations = { + fadeScaleSlideIn: { + opacity: 1, + y: 0, + scale: 1, + }, + fadeScaleSlideOut: { + opacity: 0, + y: 25, + scale: 0.98, + }, + fadeScaleSlideInFromRight: { + opacity: 1, + x: 0, + scale: 1, + }, + fadeScaleSlideOutFromRight: { + opacity: 0, + x: 25, + scale: 0.98, + }, + fadeScaleSlideInFromLeft: { + opacity: 1, + x: 0, + scale: 1, + }, + fadeScaleSlideOutFromLeft: { + opacity: 0, + x: -25, + scale: 0.98, + }, +}; + +// https://easings.net/ +export const easeFunctions = { + easeInQuart: [0.25, 1, 0.5, 1], + easeOutQuad: [0.5, 1, 0.89, 1], + standard: [0.25, 1, 0.5, 1], +}; + +export const durations = { + instant: 0.05, + shortest: 0.15, + shorter: 0.2, + short: 0.25, + standard: 0.4, + slow: 0.5, + slower: 0.75, + slowest: 0.85, +};