Carousel: Fix reveal animation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-09 10:52:51 +02:00
parent dd727ec9f4
commit 08c541c37a
2 changed files with 11 additions and 13 deletions

View File

@@ -10,9 +10,18 @@ export const animateIn = scope => {
const tl = anime.timeline({
easing: 'easeOutQuart',
duration: animDuration,
delay: animDelay,
autoplay: false
})
// Carousel
tl.add({
targets: scope,
translateY: [32, 0],
opacity: [0, 1],
complete: event => event.animatables[0].target.removeAttribute('style')
})
// Photo: Active
tl.add({
targets: scope.querySelector('.is-active picture'),
@@ -24,7 +33,7 @@ export const animateIn = scope => {
targets: scope.querySelector('.is-prev picture'),
translateY: [8, 0],
translateX: [64, 0],
rotate: [-2, 0]
rotate: window.innerWidth >= 768 ? [-2, 0] : [0, 0]
}, 100)
// Photo: Next
@@ -32,7 +41,7 @@ export const animateIn = scope => {
targets: scope.querySelector('.is-next picture'),
translateY: [8, 0],
translateX: [-48, 0],
rotate: [2, 0]
rotate: window.innerWidth >= 768 ? [2, 0] : [0, 0]
}, 100)
// Reveal on scroll

View File

@@ -17,17 +17,6 @@ export const animateIn = () => {
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
const translate = anime({
targets: '#title-houses',