UNPKG

react-native-ui-blueprint

Version:
37 lines 1.23 kB
import { Animated, Easing } from "react-native"; export const tiny = 6; export const small = 12; export const base = 18; export const large = 36; export const extra = 48; /** * Efeito de animação genérica usada nos componentes * * https://easings.net/#easeOutQuint * https://developers.google.com/web/fundamentals/design-and-ux/animations/choosing-the-right-easing * https://codepen.io/radialglo/post/understanding-the-intuition-of-easing */ export const QuinticEaseOut = Easing.bezier(0.23, 1, 0.32, 1); /** * Animação genérica usada nos componentes * * @param value * @param toValue * @param callback */ export function animateGeneric(value, toValue, callback, native, start, duration) { const animation = Animated.timing(value, { toValue: toValue, duration: duration || 250, easing: QuinticEaseOut, useNativeDriver: !!native }); if (start === undefined || start === true) { animation.start(callback); } return animation; } export function animateGenericNative(value, toValue, callback, start, duration) { return animateGeneric(value, toValue, callback, true, start, duration); } //# sourceMappingURL=Utils.js.map