nicco.io/src/routes/index.svelte

101 lines
1.9 KiB
Svelte
Raw Normal View History

2021-08-02 09:53:08 +02:00
<script lang="ts" context="module">
2021-12-22 23:25:13 +01:00
import type { GQLBaseMediaItemFragment } from '$lib/gql/gen'
2021-08-02 09:53:08 +02:00
2021-12-24 23:22:39 +01:00
type Data = Record<'home', GQLBaseMediaItemFragment>
2021-08-21 11:12:25 +02:00
export const load: Load = async ({ fetch }) => {
2021-12-22 23:25:13 +01:00
const home: GQLBaseMediaItemFragment = await fetch('/api/media/home.json').then((r) => r.json())
2021-12-24 23:22:39 +01:00
return { props: { data: { home } } }
2021-08-02 09:53:08 +02:00
}
</script>
<script lang="ts">
import type { Load } from '@sveltejs/kit'
2021-12-24 23:22:39 +01:00
import SpacedLetters from '$lib/components/SpacedLetters.svelte'
import Signature from '$lib/svgs/Signature.svelte'
2021-08-02 09:53:08 +02:00
export let data: Data
2020-07-24 11:10:01 +02:00
</script>
2021-03-06 23:10:17 +01:00
<svelte:head>
2021-08-21 11:12:25 +02:00
<title>Niccolò Borgioli</title>
2021-03-06 23:10:17 +01:00
</svelte:head>
2021-08-02 09:53:08 +02:00
<div class="wrapper">
<div class="left" style="z-index: 3;">
<h1>
<SpacedLetters letters="Niccolò" even />
<SpacedLetters letters="Borgioli" even />
</h1>
2021-03-06 23:10:17 +01:00
2021-08-02 09:53:08 +02:00
<p>Design & Development</p>
</div>
2021-03-06 23:10:17 +01:00
2021-08-02 09:53:08 +02:00
<div class="right" style="z-index: 2;">
<img srcset={data.home.srcSet} alt="decoration" class="home" />
2021-12-24 23:22:39 +01:00
<Signature class="signature" />
2021-08-02 09:53:08 +02:00
</div>
</div>
2021-03-06 23:10:17 +01:00
2020-07-23 20:30:57 +02:00
<style>
2021-08-02 09:53:08 +02:00
.wrapper {
2020-07-24 11:10:01 +02:00
position: absolute;
top: 0;
left: 0;
height: 100%;
2021-08-02 09:53:08 +02:00
width: 100%;
2020-07-24 11:10:01 +02:00
display: flex;
2021-08-02 09:53:08 +02:00
align-items: center;
padding: 1rem;
}
.left {
flex: 1 0 auto;
max-width: 64vw;
2020-07-23 21:19:25 +02:00
}
2021-08-02 09:53:08 +02:00
.right {
position: relative;
top: 5vh;
2020-07-23 21:19:25 +02:00
}
2021-08-02 09:53:08 +02:00
p {
font-size: 4vw;
margin: 0;
2020-07-23 21:19:25 +02:00
}
2021-08-02 09:53:08 +02:00
img.home {
width: min(100%, 33vw);
2020-07-24 11:10:01 +02:00
object-fit: contain;
2021-08-02 09:53:08 +02:00
object-position: left;
max-height: 65vh;
}
2021-12-24 23:22:39 +01:00
.right :global(.signature) {
2021-08-02 09:53:08 +02:00
position: absolute;
width: 50%;
2021-12-24 23:22:39 +01:00
top: 0%;
left: -8.5%;
transform: rotate(-25deg);
2020-07-23 21:19:25 +02:00
}
2020-07-24 11:14:13 +02:00
@media (max-width: 50em) {
2021-08-02 09:53:08 +02:00
.wrapper {
flex-direction: column;
}
.left {
flex: initial;
}
.right {
left: 1rem;
2020-07-24 11:10:01 +02:00
}
2021-08-02 09:53:08 +02:00
img.home {
width: auto;
height: 100%;
max-height: calc(90vh - 35vw - 5vh);
max-width: 90%;
2020-07-23 21:19:25 +02:00
}
}
2020-07-23 20:30:57 +02:00
</style>