fix: first animation & transition
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -9,6 +9,7 @@ import { animDuration } from 'utils/store'
|
||||
export const animateIn = () => {
|
||||
const tl = anime.timeline({
|
||||
duration: 1800,
|
||||
delay: 1800,
|
||||
easing: 'easeOutQuart'
|
||||
})
|
||||
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
|
||||
// Variables
|
||||
let scope
|
||||
let mounted = false
|
||||
|
||||
|
||||
/*
|
||||
** Run code on component mount
|
||||
*/
|
||||
onMount(() => {
|
||||
// Entering transition
|
||||
mounted = true
|
||||
animateIn(scope)
|
||||
})
|
||||
</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 class="anim-mask">
|
||||
{@html charsToSpan('Houses')}
|
||||
|
||||
@@ -62,9 +62,7 @@
|
||||
}, animDurationLong * 0.75 + 400)
|
||||
|
||||
// 4. Run the page's transition in, but a little bit before the end of the loader
|
||||
setTimeout(() => {
|
||||
pageTransition.onAnimationEnd()
|
||||
}, animDurationLong * 0.75 + 400) // + 200
|
||||
pageTransition.onAnimationEnd()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user