UNPKG

react-native-reanimated

Version:

More powerful alternative to Animated library for React Native.

693 lines (594 loc) • 17.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ZoomOutUp = exports.ZoomOutRotate = exports.ZoomOutRight = exports.ZoomOutLeft = exports.ZoomOutEasyUp = exports.ZoomOutEasyDown = exports.ZoomOutDown = exports.ZoomOut = exports.ZoomInUp = exports.ZoomInRotate = exports.ZoomInRight = exports.ZoomInLeft = exports.ZoomInEasyUp = exports.ZoomInEasyDown = exports.ZoomInDown = exports.ZoomIn = void 0; var _animationBuilder = require("../animationBuilder"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } class ZoomIn extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return () => { 'worklet'; return { animations: { transform: [{ scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomIn(); } } exports.ZoomIn = ZoomIn; class ZoomInRotate extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const rotate = this.rotateV ? this.rotateV : '0.3'; const callback = this.callbackV; const initialValues = this.initialValues; return () => { 'worklet'; return { animations: { transform: [{ scale: delayFunction(delay, animation(1, config)) }, { rotate: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ scale: 0 }, { rotate: rotate }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInRotate(); } } exports.ZoomInRotate = ZoomInRotate; class ZoomInLeft extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateX: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateX: -values.windowWidth }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInLeft(); } } exports.ZoomInLeft = ZoomInLeft; class ZoomInRight extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateX: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateX: values.windowWidth }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInRight(); } } exports.ZoomInRight = ZoomInRight; class ZoomInUp extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateY: -values.windowHeight }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInUp(); } } exports.ZoomInUp = ZoomInUp; class ZoomInDown extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateY: values.windowHeight }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInDown(); } } exports.ZoomInDown = ZoomInDown; class ZoomInEasyUp extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateY: -values.targetHeight }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInEasyUp(); } } exports.ZoomInEasyUp = ZoomInEasyUp; class ZoomInEasyDown extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(0, config)) }, { scale: delayFunction(delay, animation(1, config)) }] }, initialValues: { transform: [{ translateY: values.targetHeight }, { scale: 0 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomInEasyDown(); } } exports.ZoomInEasyDown = ZoomInEasyDown; class ZoomOut extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return () => { 'worklet'; return { animations: { transform: [{ scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOut(); } } exports.ZoomOut = ZoomOut; class ZoomOutRotate extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const rotate = this.rotateV ? this.rotateV : '0.3'; const callback = this.callbackV; const initialValues = this.initialValues; return () => { 'worklet'; return { animations: { transform: [{ scale: delayFunction(delay, animation(0, config)) }, { rotate: delayFunction(delay, animation(rotate, config)) }] }, initialValues: { transform: [{ scale: 1 }, { rotate: '0' }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutRotate(); } } exports.ZoomOutRotate = ZoomOutRotate; class ZoomOutLeft extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateX: delayFunction(delay, animation(-values.windowWidth, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateX: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutLeft(); } } exports.ZoomOutLeft = ZoomOutLeft; class ZoomOutRight extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateX: delayFunction(delay, animation(values.windowWidth, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateX: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutRight(); } } exports.ZoomOutRight = ZoomOutRight; class ZoomOutUp extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(-values.windowHeight, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateY: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutUp(); } } exports.ZoomOutUp = ZoomOutUp; class ZoomOutDown extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(values.windowHeight, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateY: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutDown(); } } exports.ZoomOutDown = ZoomOutDown; class ZoomOutEasyUp extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(-values.currentHeight, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateY: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutEasyUp(); } } exports.ZoomOutEasyUp = ZoomOutEasyUp; class ZoomOutEasyDown extends _animationBuilder.ComplexAnimationBuilder { constructor() { super(...arguments); _defineProperty(this, "build", () => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; const initialValues = this.initialValues; return values => { 'worklet'; return { animations: { transform: [{ translateY: delayFunction(delay, animation(values.currentHeight, config)) }, { scale: delayFunction(delay, animation(0, config)) }] }, initialValues: { transform: [{ translateY: 0 }, { scale: 1 }], ...initialValues }, callback: callback }; }; }); } static createInstance() { return new ZoomOutEasyDown(); } } exports.ZoomOutEasyDown = ZoomOutEasyDown; //# sourceMappingURL=Zoom.js.map