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