Reveal inline SiteTitle

This commit is contained in:
2021-11-21 13:40:13 +01:00
parent 0148236b36
commit 68236bf39e
2 changed files with 30 additions and 10 deletions

View File

@@ -1,13 +1,34 @@
<script lang="ts"> <script lang="ts">
import SplitText from '$components/SplitText.svelte'
import { reveal, fly } from '$animations/index'
export let variant: string = 'lines' export let variant: string = 'lines'
export let tag: string = 'h1' export let tag: string = 'h1'
</script> </script>
{#if tag === 'h1'} {#if tag === 'h1'}
<h1 class="site-title site-title--{variant}"> <h1 class="site-title site-title--{variant}"
<strong>Houses</strong> use:reveal={{
<span>Of The</span> animation: fly,
<strong>World</strong> options: {
children: '.char',
stagger: 40,
duration: 1000,
from: '110%',
opacity: false,
},
threshold: 0,
}}
>
<strong class="mask">
<SplitText text="Houses" mode="chars" />
</strong>
<span class="mask">
<SplitText text="Of The" mode="chars" />
</span>
<strong class="mask">
<SplitText text="World" mode="chars" />
</strong>
</h1> </h1>
{:else} {:else}
<div class="site-title site-title--{variant}"> <div class="site-title site-title--{variant}">

View File

@@ -1,10 +1,10 @@
.site-title { .site-title {
font-family: $font-serif; font-family: $font-serif;
strong { & > strong {
font-weight: 300; font-weight: 300;
} }
span { & > span {
position: relative; position: relative;
top: -4px; top: -4px;
font-weight: 600; font-weight: 600;
@@ -63,12 +63,11 @@
font-size: rem(96px); font-size: rem(96px);
} }
strong { & > strong {
color: $color-secondary; color: $color-secondary;
} }
& > span {
span { // display: block;
display: block;
top: 0; top: 0;
margin: 10px 0; margin: 10px 0;
font-size: 0.3125em; font-size: 0.3125em;