fix: first animation & transition
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-01 21:28:17 +02:00
parent 1cc823e9d1
commit 6f409c5331
3 changed files with 5 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import { animDuration } from 'utils/store'
export const animateIn = () => { export const animateIn = () => {
const tl = anime.timeline({ const tl = anime.timeline({
duration: 1800, duration: 1800,
delay: 1800,
easing: 'easeOutQuart' easing: 'easeOutQuart'
}) })

View File

@@ -7,18 +7,19 @@
// Variables // Variables
let scope let scope
let mounted = false
/* /*
** Run code on component mount ** Run code on component mount
*/ */
onMount(() => { onMount(() => {
// Entering transition mounted = true
animateIn(scope) animateIn(scope)
}) })
</script> </script>
<div class="title-location title-location--inline" bind:this={scope}> <div class="title-location title-location--inline" bind:this={scope} style="opacity: {mounted ? 1 : 0}">
<div role="heading" aria-level="1" aria-label="Houses"> <div role="heading" aria-level="1" aria-label="Houses">
<div class="anim-mask"> <div class="anim-mask">
{@html charsToSpan('Houses')} {@html charsToSpan('Houses')}

View File

@@ -62,9 +62,7 @@
}, animDurationLong * 0.75 + 400) }, animDurationLong * 0.75 + 400)
// 4. Run the page's transition in, but a little bit before the end of the loader // 4. Run the page's transition in, but a little bit before the end of the loader
setTimeout(() => { pageTransition.onAnimationEnd()
pageTransition.onAnimationEnd()
}, animDurationLong * 0.75 + 400) // + 200
} }
}) })
</script> </script>