hyprland-website/src/routes/Hero.svelte

107 lines
3 KiB
Svelte
Raw Normal View History

2023-07-10 10:15:17 +02:00
<script>
2023-08-17 16:45:47 +02:00
import { getIsMobile } from '$lib/Helper.mjs'
2023-07-10 10:15:17 +02:00
import Button from '$lib/components/Button.svelte'
2023-08-17 16:45:47 +02:00
import Logo from '$lib/images/logos/hyprland-color.svg'
import { onMount } from 'svelte'
2023-09-03 18:00:52 +02:00
// import Firefly from './Firefly.svelte'
2023-07-10 10:15:17 +02:00
import { inview } from 'svelte-inview'
let isVisible = true
2023-08-17 16:45:47 +02:00
let isMobile = false
onMount(() => {
isMobile = getIsMobile()
})
2023-07-10 10:15:17 +02:00
</script>
<section
2023-09-03 18:00:52 +02:00
class="relative flex h-max min-h-[100svh] w-full flex-col items-center justify-center overflow-x-hidden"
2023-07-10 10:15:17 +02:00
use:inview
2023-07-22 20:44:24 +02:00
on:inview_change={({ detail: { inView } }) => {
2023-07-10 10:15:17 +02:00
isVisible = inView
}}
>
<!-- Hero text and logo -->
2023-09-03 18:00:52 +02:00
<div class="x z-10 flex h-screen min-h-max flex-col items-center justify-center">
<div class="-mt-20 mb-8 flex flex-col items-center gap-6 text-center">
<img src={Logo} alt="Hyprland Logo" class="ani-in mb-6 h-48 fill-mode-backwards" />
<div class="ani-in relative fill-mode-backwards [animation-delay:384ms]">
2023-08-05 20:33:07 +02:00
<h1
2023-09-03 18:00:52 +02:00
class="hyprgradient bg-clip-text p-2 font-london text-6xl font-bold tracking-wider text-transparent md:text-7xl md:tracking-widest"
2023-08-05 20:33:07 +02:00
>
Hyprland
</h1>
2023-07-10 10:15:17 +02:00
</div>
</div>
<h2
2023-09-03 18:00:52 +02:00
class="ani-in mb-10 text-center text-2xl font-medium leading-9 text-blue-200/80 fill-mode-backwards [animation-delay:944ms]"
2023-07-10 10:15:17 +02:00
>
2023-09-03 18:00:52 +02:00
Dynamic tiling Wayland compositor<br />with the looks
2023-07-10 10:15:17 +02:00
</h2>
<div
2023-09-03 18:00:52 +02:00
class="flex items-center gap-6 duration-500 animate-in fade-in-0 slide-in-from-bottom-4 fill-mode-backwards [animation-delay:1390ms]"
2023-07-10 10:15:17 +02:00
>
<a href="https://wiki.hyprland.org/Getting-Started/Installation/">
<Button size="lg">Install</Button>
</a>
2023-08-17 16:45:47 +02:00
<a href="https://wiki.hyprland.org/Getting-Started/">
<Button type="fancyOutline" size="lg">Wiki</Button>
</a>
2023-07-10 10:15:17 +02:00
</div>
</div>
<!-- Fireflies -->
2023-09-03 18:00:52 +02:00
<!-- {#if isVisible}
2023-07-10 10:15:17 +02:00
<div
2023-09-03 18:00:52 +02:00
class="max-w-screen pointer-events-none absolute inset-0 -z-10 overflow-hidden animate-in fade-in-0 fill-mode-backwards [animation-delay:900ms] [animation-duration:4500ms]"
2023-07-10 10:15:17 +02:00
>
2023-09-03 18:00:52 +02:00
<div class="absolute bottom-0 z-10 h-52 w-full bg-gradient-to-t from-black" />
2023-07-10 10:15:17 +02:00
2023-08-17 16:45:47 +02:00
{#each { length: 40 } as _}
<Firefly />
{/each}
2023-07-10 10:15:17 +02:00
</div>
2023-09-03 18:00:52 +02:00
{/if} -->
2023-07-10 10:15:17 +02:00
<!-- Gradient background -->
<div
2023-09-03 18:00:52 +02:00
class="max-w-screen absolute right-0 top-0 -z-50 h-full min-h-screen w-screen overflow-hidden"
2023-07-10 10:15:17 +02:00
>
2023-09-03 18:00:52 +02:00
<div class="absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2">
2023-07-10 10:15:17 +02:00
<div
2023-09-03 18:00:52 +02:00
class="bg bg-gradient-radial from-sky-400/20 via-emerald-300/0 to-emerald-200/0"
2023-07-10 10:15:17 +02:00
style="--seed: 20;"
/>
</div>
2023-09-03 18:00:52 +02:00
<div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2">
2023-07-10 10:15:17 +02:00
<div
2023-09-03 18:00:52 +02:00
class="bg bg-gradient-radial from-blue-500/10 to-cyan-400/0"
2023-07-10 10:15:17 +02:00
style="--offset: -3s; --seed: 4; --duration:102s"
/>
</div>
</div>
</section>
<style lang="postcss">
.bg {
width: calc(120vw + 500px);
height: calc(120vh + 500px);
}
@keyframes slidein {
from {
transform: translateX(0%);
}
to {
transform: translateX(100%);
}
}
.ani-in {
2023-09-03 18:00:52 +02:00
@apply ease-out animate-in fade-in-0 slide-in-from-bottom-6;
animation-duration: 1000ms;
2023-07-10 10:15:17 +02:00
}
</style>