|
1 | 1 | <script lang="ts"> |
2 | 2 | import MainBird from "./lib/components/MainBird.svelte"; |
3 | 3 | import Clock from "./lib/components/Clock.svelte"; |
| 4 | +
|
| 5 | + import { theme } from "./lib/state/theme.svelte"; |
| 6 | + import { onMount } from "svelte"; |
| 7 | +
|
| 8 | + let scrollIndicator: SVGElement; |
| 9 | +
|
| 10 | + let textColour = $derived( |
| 11 | + theme.isDark |
| 12 | + ? "oklch(0.9644 0.0282 74.31)" |
| 13 | + : "oklch(0.2316 0.0373 288.04)", |
| 14 | + ); |
| 15 | +
|
| 16 | + function removeScrollIndicator() { |
| 17 | + scrollIndicator.classList.remove("animate-bounce"); |
| 18 | + scrollIndicator.classList.add("slide-down") |
| 19 | + window.removeEventListener("scroll", removeScrollIndicator); |
| 20 | + } |
| 21 | +
|
| 22 | + onMount(() => { |
| 23 | + window.addEventListener("scroll", removeScrollIndicator); |
| 24 | + }); |
4 | 25 | </script> |
5 | 26 |
|
6 | 27 | <header class="fixed flex flex-row bg-transparent"></header> |
7 | 28 | <main class="flex flex-col justify-center items-center"> |
8 | 29 | <Clock /> |
9 | 30 | <MainBird /> |
10 | | - <h1 class="text-4xl text-center mt-5">hi there</h1> |
| 31 | + <h1 class="text-4xl text-center mt-5"> |
| 32 | + hi, i'm jackson,<br />a software developer |
| 33 | + </h1> |
| 34 | + |
| 35 | + <div class="h-500">content</div> |
11 | 36 | </main> |
| 37 | +<div class="fixed bottom-0 w-full flex justify-center pb-1"> |
| 38 | + <svg |
| 39 | + bind:this={scrollIndicator} |
| 40 | + width="60" |
| 41 | + height="60" |
| 42 | + class="animate-bounce" |
| 43 | + > |
| 44 | + <path |
| 45 | + d="M15 15 L30 30 L45 15" |
| 46 | + stroke={textColour} |
| 47 | + stroke-width="2" |
| 48 | + fill="none" |
| 49 | + /> |
| 50 | + </svg> |
| 51 | +</div> |
| 52 | + |
| 53 | +<style> |
| 54 | + :global { |
| 55 | + .slide-down { |
| 56 | + animation-duration: 250ms; |
| 57 | + animation-timing-function: ease-in-out; |
| 58 | + animation-fill-mode: forwards; |
| 59 | + animation-name: slide-down; |
| 60 | + } |
| 61 | +
|
| 62 | + @keyframes slide-down { |
| 63 | + from { |
| 64 | + transform: translateY(0); |
| 65 | + } |
| 66 | + to { |
| 67 | + transform: translateY(50px); |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | +</style> |
0 commit comments