Carousel: Fix reveal animation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,9 +10,18 @@ export const animateIn = scope => {
|
|||||||
const tl = anime.timeline({
|
const tl = anime.timeline({
|
||||||
easing: 'easeOutQuart',
|
easing: 'easeOutQuart',
|
||||||
duration: animDuration,
|
duration: animDuration,
|
||||||
|
delay: animDelay,
|
||||||
autoplay: false
|
autoplay: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Carousel
|
||||||
|
tl.add({
|
||||||
|
targets: scope,
|
||||||
|
translateY: [32, 0],
|
||||||
|
opacity: [0, 1],
|
||||||
|
complete: event => event.animatables[0].target.removeAttribute('style')
|
||||||
|
})
|
||||||
|
|
||||||
// Photo: Active
|
// Photo: Active
|
||||||
tl.add({
|
tl.add({
|
||||||
targets: scope.querySelector('.is-active picture'),
|
targets: scope.querySelector('.is-active picture'),
|
||||||
@@ -24,7 +33,7 @@ export const animateIn = scope => {
|
|||||||
targets: scope.querySelector('.is-prev picture'),
|
targets: scope.querySelector('.is-prev picture'),
|
||||||
translateY: [8, 0],
|
translateY: [8, 0],
|
||||||
translateX: [64, 0],
|
translateX: [64, 0],
|
||||||
rotate: [-2, 0]
|
rotate: window.innerWidth >= 768 ? [-2, 0] : [0, 0]
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
// Photo: Next
|
// Photo: Next
|
||||||
@@ -32,7 +41,7 @@ export const animateIn = scope => {
|
|||||||
targets: scope.querySelector('.is-next picture'),
|
targets: scope.querySelector('.is-next picture'),
|
||||||
translateY: [8, 0],
|
translateY: [8, 0],
|
||||||
translateX: [-48, 0],
|
translateX: [-48, 0],
|
||||||
rotate: [2, 0]
|
rotate: window.innerWidth >= 768 ? [2, 0] : [0, 0]
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
// Reveal on scroll
|
// Reveal on scroll
|
||||||
|
|||||||
@@ -17,17 +17,6 @@ export const animateIn = () => {
|
|||||||
easing: 'easeOutQuart'
|
easing: 'easeOutQuart'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Carousel
|
|
||||||
const carousel = anime({
|
|
||||||
targets: document.querySelector('.intro .carousel'),
|
|
||||||
translateY: [32, 0],
|
|
||||||
opacity: [0, 1],
|
|
||||||
easing: 'easeOutQuart',
|
|
||||||
duration: animDuration,
|
|
||||||
delay: animDelay,
|
|
||||||
complete: event => event.animatables[0].target.removeAttribute('style')
|
|
||||||
})
|
|
||||||
|
|
||||||
// Parallax on scroll
|
// Parallax on scroll
|
||||||
const translate = anime({
|
const translate = anime({
|
||||||
targets: '#title-houses',
|
targets: '#title-houses',
|
||||||
|
|||||||
Reference in New Issue
Block a user