@proyecto26/animatable-component
Version:
Animate once, use Everywhere! 💫
53 lines (52 loc) • 3.02 kB
JavaScript
import { ANIMATIONS } from './common';
const SLIDE_BCK_DEFAULT = {
easing: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)',
fillMode: 'both'
};
const SLIDE_BCK_CENTER = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px)' })
];
const SLIDE_BCK_TOP = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(-200px)' })
];
const SLIDE_BCK_TR = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(-200px) translateX(200px)' })
];
const SLIDE_BCK_RIGHT = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateX(200px)' })
];
const SLIDE_BCK_BR = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(200px) translateX(200px)' })
];
const SLIDE_BCK_BOTTOM = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(200px)' })
];
const SLIDE_BCK_BL = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(200px) translateX(-200px)' })
];
const SLIDE_BCK_LEFT = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateX(-200px)' })
];
const SLIDE_BCK_TL = [
Object.assign(Object.assign({ offset: 0 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(0) translateY(0) translateX(0)' }),
Object.assign(Object.assign({ offset: 1 }, SLIDE_BCK_DEFAULT), { transform: 'translateZ(-400px) translateY(-200px) translateX(-200px)' })
];
export default {
[ANIMATIONS.SLIDE_BCK_CENTER]: SLIDE_BCK_CENTER,
[ANIMATIONS.SLIDE_BCK_TOP]: SLIDE_BCK_TOP,
[ANIMATIONS.SLIDE_BCK_TR]: SLIDE_BCK_TR,
[ANIMATIONS.SLIDE_BCK_RIGHT]: SLIDE_BCK_RIGHT,
[ANIMATIONS.SLIDE_BCK_BR]: SLIDE_BCK_BR,
[ANIMATIONS.SLIDE_BCK_BOTTOM]: SLIDE_BCK_BOTTOM,
[ANIMATIONS.SLIDE_BCK_BL]: SLIDE_BCK_BL,
[ANIMATIONS.SLIDE_BCK_LEFT]: SLIDE_BCK_LEFT,
[ANIMATIONS.SLIDE_BCK_TL]: SLIDE_BCK_TL
};