WIP Animations all over site
- Run a transition In for each page - Involve a "loader" panel on page change - TODO: tweak the animations and finish the concept
This commit is contained in:
56
src/animations/Carousel.js
Normal file
56
src/animations/Carousel.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import anime from 'animejs'
|
||||
import ScrollOut from 'scroll-out'
|
||||
import { animDuration } from '../utils/store'
|
||||
|
||||
|
||||
/*
|
||||
** Transition In
|
||||
*/
|
||||
export const animateIn = () => {
|
||||
// Card: Active
|
||||
const cardActive = ScrollOut({
|
||||
once: true,
|
||||
targets: '.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: '.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: '.gallery__photo--next',
|
||||
onShown (el) {
|
||||
anime({
|
||||
targets: el,
|
||||
top: [5, 0],
|
||||
left: [48, 0],
|
||||
duration: 1200,
|
||||
delay: 710,
|
||||
easing: 'easeOutQuart'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user