UNPKG

create-expo-cljs-app

Version:

Create a react native application with Expo and Shadow-CLJS!

118 lines (105 loc) 2.96 kB
import { IEntryExitAnimationBuilder, EntryExitAnimationFunction, } from '../animationBuilder/commonTypes'; import { ComplexAnimationBuilder } from '../animationBuilder'; export class StretchInX extends ComplexAnimationBuilder implements IEntryExitAnimationBuilder { static createInstance(): StretchInX { return new StretchInX(); } build = (): EntryExitAnimationFunction => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; return () => { 'worklet'; return { animations: { transform: [{ scaleX: delayFunction(delay, animation(1, config)) }], }, initialValues: { transform: [{ scaleX: 0 }], }, callback: callback, }; }; }; } export class StretchInY extends ComplexAnimationBuilder implements IEntryExitAnimationBuilder { static createInstance(): StretchInY { return new StretchInY(); } build = (): EntryExitAnimationFunction => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; return () => { 'worklet'; return { animations: { transform: [{ scaleY: delayFunction(delay, animation(1, config)) }], }, initialValues: { transform: [{ scaleY: 0 }], }, callback: callback, }; }; }; } export class StretchOutX extends ComplexAnimationBuilder implements IEntryExitAnimationBuilder { static createInstance(): StretchOutX { return new StretchOutX(); } build = (): EntryExitAnimationFunction => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; return () => { 'worklet'; return { animations: { transform: [{ scaleX: delayFunction(delay, animation(0, config)) }], }, initialValues: { transform: [{ scaleX: 1 }], }, callback: callback, }; }; }; } export class StretchOutY extends ComplexAnimationBuilder implements IEntryExitAnimationBuilder { static createInstance(): StretchOutY { return new StretchOutY(); } build = (): EntryExitAnimationFunction => { const delayFunction = this.getDelayFunction(); const [animation, config] = this.getAnimationAndConfig(); const delay = this.getDelay(); const callback = this.callbackV; return () => { 'worklet'; return { animations: { transform: [{ scaleY: delayFunction(delay, animation(0, config)) }], }, initialValues: { transform: [{ scaleY: 1 }], }, callback: callback, }; }; }; }