Files
housesof/src/animations/Carousel.js
Félix Péault 2dc51a167a
All checks were successful
continuous-integration/drone/push Build is passing
⚠️ Use alias Rollup plugin to omit full imports
- Define entries (utils, animations, etc) in the Rollup config in order to omit the whole back path (../../) when importing a file
- Global revoleExtensions in the config (to avoid duplicates)
2020-03-30 23:53:01 +02:00

56 lines
1.3 KiB
JavaScript

import anime from 'animejs'
import ScrollOut from 'scroll-out'
import { animDuration } from 'utils/store'
/*
** Transition In
*/
export const animateIn = scope => {
// Card: Active
const cardActive = ScrollOut({
once: true,
targets: scope.querySelector('.gallery__photo--active'),
onShown (el) {
anime({
targets: el,
top: [32, 0],
duration: 1200,
delay: 650,
easing: 'easeOutQuart'
})
}
})
// Card: Prev
const cardPrev = ScrollOut({
once: true,
targets: scope.querySelector('.gallery__photo--prev'),
onShown (el) {
anime({
targets: el,
top: [5, 0],
left: [-64, 0],
duration: 1200,
delay: 690,
easing: 'easeOutQuart'
})
}
})
// Card: Prev
const cardNext = ScrollOut({
once: true,
targets: scope.querySelector('.gallery__photo--next'),
onShown (el) {
anime({
targets: el,
top: [5, 0],
left: [48, 0],
duration: 1200,
delay: 710,
easing: 'easeOutQuart'
})
}
})
}