react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
559 lines (484 loc) • 14.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FlipOutYRight = exports.FlipOutYLeft = exports.FlipOutXUp = exports.FlipOutXDown = exports.FlipOutEasyY = exports.FlipOutEasyX = exports.FlipInYRight = exports.FlipInYLeft = exports.FlipInXUp = exports.FlipInXDown = exports.FlipInEasyY = exports.FlipInEasyX = 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 FlipInXUp 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '90deg'
}, {
translateY: -targetValues.targetHeight
}],
...initialValues
},
animations: {
transform: [{
perspective: 500
}, {
rotateX: delayFunction(delay, animation('0deg', config))
}, {
translateY: delayFunction(delay, animation(0, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInXUp();
}
}
exports.FlipInXUp = FlipInXUp;
class FlipInYLeft 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '-90deg'
}, {
translateX: -targetValues.targetWidth
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('0deg', config))
}, {
translateX: delayFunction(delay, animation(0, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInYLeft();
}
}
exports.FlipInYLeft = FlipInYLeft;
class FlipInXDown 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '-90deg'
}, {
translateY: targetValues.targetHeight
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateX: delayFunction(delay, animation('0deg', config))
}, {
translateY: delayFunction(delay, animation(0, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInXDown();
}
}
exports.FlipInXDown = FlipInXDown;
class FlipInYRight 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '90deg'
}, {
translateX: targetValues.targetWidth
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('0deg', config))
}, {
translateX: delayFunction(delay, animation(0, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInYRight();
}
}
exports.FlipInYRight = FlipInYRight;
class FlipInEasyX 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 {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '90deg'
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateX: delayFunction(delay, animation('0deg', config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInEasyX();
}
}
exports.FlipInEasyX = FlipInEasyX;
class FlipInEasyY 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 {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '90deg'
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('0deg', config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipInEasyY();
}
}
exports.FlipInEasyY = FlipInEasyY;
class FlipOutXUp 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '0deg'
}, {
translateY: 0
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateX: delayFunction(delay, animation('90deg', config))
}, {
translateY: delayFunction(delay, animation(-targetValues.currentHeight, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutXUp();
}
}
exports.FlipOutXUp = FlipOutXUp;
class FlipOutYLeft 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '0deg'
}, {
translateX: 0
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('-90deg', config))
}, {
translateX: delayFunction(delay, animation(-targetValues.currentWidth, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutYLeft();
}
}
exports.FlipOutYLeft = FlipOutYLeft;
class FlipOutXDown 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '0deg'
}, {
translateY: 0
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateX: delayFunction(delay, animation('-90deg', config))
}, {
translateY: delayFunction(delay, animation(targetValues.currentHeight, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutXDown();
}
}
exports.FlipOutXDown = FlipOutXDown;
class FlipOutYRight 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 targetValues => {
'worklet';
return {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '0deg'
}, {
translateX: 0
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('90deg', config))
}, {
translateX: delayFunction(delay, animation(targetValues.currentWidth, config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutYRight();
}
}
exports.FlipOutYRight = FlipOutYRight;
class FlipOutEasyX 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 {
initialValues: {
transform: [{
perspective: 500
}, {
rotateX: '0deg'
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateX: delayFunction(delay, animation('90deg', config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutEasyX();
}
}
exports.FlipOutEasyX = FlipOutEasyX;
class FlipOutEasyY 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 {
initialValues: {
transform: [{
perspective: 500
}, {
rotateY: '0deg'
}],
...initialValues
},
animations: {
transform: [{
perspective: delayFunction(delay, animation(500, config))
}, {
rotateY: delayFunction(delay, animation('90deg', config))
}]
},
callback: callback
};
};
});
}
static createInstance() {
return new FlipOutEasyY();
}
}
exports.FlipOutEasyY = FlipOutEasyY;
//# sourceMappingURL=Flip.js.map