feat: some shit

This commit is contained in:
2024-04-03 14:27:48 +02:00
parent fa5d08e549
commit 195d7dab5d
67 changed files with 2400 additions and 582 deletions

View File

@@ -0,0 +1,44 @@
<script lang="ts">
import { onMount } from "svelte";
import { createLeaves, setRotation } from "./leaves";
let canvas: HTMLCanvasElement;
let loaded = false;
function handleScroll() {
setRotation(window.scrollY / window.innerHeight);
}
onMount(() => {
createLeaves({ canvas, num: 20, minZ: 0, maxZ: 1 });
setTimeout(() => {
loaded = true;
}, 100);
});
</script>
<svelte:window on:scroll={handleScroll} />
<canvas bind:this={canvas} class:loaded />
<style>
:global(body) {
z-index: 1;
}
canvas {
width: 100vw !important;
height: 100vh !important;
position: fixed;
top: 0px;
left: 0px;
z-index: -1;
pointer-events: none;
opacity: 0;
transition: opacity 2s;
}
.loaded {
opacity: 0.2;
}
</style>