hyprland-website/src/routes/Hero.svelte

92 lines
2.5 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'
2023-09-04 20:54:16 +02:00
import HeroBackground from './HeroBackground.svelte'
2023-07-10 10:15:17 +02:00
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-05 21:09:18 +02:00
<div
class="pointer-events-none z-10 flex h-screen min-h-max flex-col items-center justify-center"
>
2023-09-03 18:00:52 +02:00
<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-05 21:09:18 +02:00
class="hyprgradient pointer-events-auto 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-05 21:09:18 +02:00
class="ani-in pointer-events-auto 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-05 21:09:18 +02:00
class="pointer-events-auto 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>
2023-09-04 20:54:16 +02:00
<div class="absolute inset-0">
<HeroBackground />
</div>
2023-07-10 10:15:17 +02:00
<!-- 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
</section>
<style lang="postcss">
@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>