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 = () => {
|
export const animateIn = () => {
|
||||||
const tl = anime.timeline({
|
const tl = anime.timeline({
|
||||||
duration: 1800,
|
duration: 1800,
|
||||||
|
delay: 1800,
|
||||||
easing: 'easeOutQuart'
|
easing: 'easeOutQuart'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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')}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user