Viewer: Fix Carousel and error page
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-04-22 10:33:48 +02:00
parent 3a96b8e954
commit 74743fb037
2 changed files with 25 additions and 21 deletions

View File

@@ -52,25 +52,25 @@ export const animateIn = scope => {
// Reveal on scroll
let visible = false
const carouselReveal = ScrollOut({
once: true,
targets: scope,
onChange: (el, ctx) => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const carouselReveal = ScrollOut({
once: true,
targets: scope,
onChange: (el, ctx) => {
if (ctx.visible === 0) {
visible = true
}
})
},
onShown: (el, ctx) => {
// If revealed on scroll, no delay
if (visible) {
tl.restart()
},
onShown: (el, ctx) => {
// If revealed on scroll, no delay
if (visible) {
requestAnimationFrame(() => tl.restart())
}
// If revealed on load, add a delay
else {
setTimeout(() => tl.restart(), animDelay * 2)
}
}
// If revealed on load, add a delay
else {
setTimeout(() => tl.restart(), animDelay * 2)
}
}
})
})
}