Carousel: Fix reveal again?

This commit is contained in:
2020-04-21 19:52:20 +02:00
parent 40c57fee13
commit b8b4d55409

View File

@@ -16,7 +16,7 @@ export const animateIn = scope => {
// Carousel
tl.add({
targets: scope,
translateY: [32, 0],
translateY: [window.innerWidth <= 768 ? 16 : 32, 0],
translateZ: [0, 0],
opacity: [0, 1],
complete: event => event.animatables[0].target.removeAttribute('style')
@@ -52,7 +52,6 @@ export const animateIn = scope => {
// Reveal on scroll
let visible = false
requestAnimationFrame(() => {
const carouselReveal = ScrollOut({
once: true,
targets: scope,
@@ -64,7 +63,6 @@ export const animateIn = scope => {
})
},
onShown: (el, ctx) => {
requestAnimationFrame(() => {
// If revealed on scroll, no delay
if (visible) {
tl.restart()
@@ -73,8 +71,6 @@ export const animateIn = scope => {
else {
setTimeout(() => tl.restart(), animDelay * 2)
}
})
}
})
})
}