hyprland-website/src/routes/Hero.svelte

104 lines
2.7 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
2023-09-13 14:27:13 +02:00
export let backgroundData
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-11-13 19:49:59 +01:00
class="relative flex h-[100svh] min-h-[52rem] 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
2023-11-13 19:49:59 +01:00
class="pointer-events-none z-10 flex h-full min-h-max flex-col items-center justify-center px-5"
2023-09-05 21:09:18 +02:00
>
2023-11-13 19:49:59 +01:00
<div class="-mt-10 mb-8 flex flex-col items-center gap-6 text-center sm:-mt-20">
2023-09-13 14:27:13 +02:00
<img
src={Logo}
alt="Hyprland Logo"
class="ani-in mb-6 h-40 w-48 object-contain fill-mode-backwards sm:h-48 sm:w-56"
loading="eager"
decoding="async"
2023-11-14 14:36:42 +01:00
fetchpriority="high"
2023-09-13 14:27:13 +02:00
/>
2023-07-10 10:15:17 +02:00
</div>
2023-11-08 14:52:12 +01:00
<h1
2023-11-13 19:49:59 +01:00
class="ani-in title pointer-events-auto mb-4 max-w-[20ch] text-center !leading-[1.25] fill-mode-backwards [animation-delay:384ms]"
2023-07-10 10:15:17 +02:00
>
2023-11-08 14:52:12 +01:00
Tiling compositor <br /><span class="hyprgradient title-gradient">with the looks</span>
</h1>
<p
2023-11-13 19:49:59 +01:00
class="ani-in mb-8 text-center text-xl font-medium text-slate-300 fill-mode-backwards [animation-delay:794ms] sm:max-w-lg sm:px-0 md:max-w-lg"
2023-11-08 14:52:12 +01:00
>
Hyprland provides the latest Wayland features, dynamic tiling, all the eyecandy, powerful
2023-11-13 19:49:59 +01:00
plugins and much more.
2023-11-08 14:52:12 +01:00
</p>
2023-07-10 10:15:17 +02:00
<div
2023-09-10 08:09:06 +02:00
class="pointer-events-auto flex items-center gap-7 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-09-10 08:09:06 +02:00
<a href="https://wiki.hyprland.org/">
2023-08-17 16:45:47 +02:00
<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">
2023-09-13 14:27:13 +02:00
<HeroBackground {backgroundData} />
2023-09-04 20:54:16 +02:00
</div>
2023-07-10 10:15:17 +02:00
</section>
<style lang="postcss">
2023-09-13 14:27:13 +02:00
.title {
padding: 0.5rem;
pointer-events: auto;
2023-11-08 14:52:12 +01:00
color: transparent;
background: linear-gradient(
to bottom right,
theme(colors.white) 40%,
theme(colors.cyan.500 / 0%)
);
background-clip: text;
2023-11-13 19:49:59 +01:00
@apply text-4xl font-bold sm:text-5xl md:text-7xl;
2023-11-08 14:52:12 +01:00
}
.title-gradient {
background-clip: text;
@apply text-transparent;
2023-09-13 14:27:13 +02:00
}
2023-07-10 10:15:17 +02:00
@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>