Files
housesof/src/atoms/TitleSite.svelte
Félix Péault 94fa63ef41 Fix pages and components animations
- Fix delays
- Add the init back for TitleSite as it needs a delay for the page instance vs. loader
2020-04-04 11:45:26 +02:00

44 lines
896 B
Svelte

<script>
import { onMount } from 'svelte'
import { charsToSpan } from 'utils/functions'
// Animations
import { animateIn } from 'animations/TitleSite'
// Props and variables
export let init = false
let mounted = false
let scope
/*
** Run code when mounted
*/
onMount(() => {
animateIn(scope, init)
mounted = true
})
</script>
<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')}
</div>
</div>
<em class="anim-mask">
<span>of</span>
<span>the</span>
</em>
<div aria-label="World">
<div class="anim-mask">
{@html charsToSpan('World')}
</div>
</div>
</div>