feat: add resume.pdf button

This commit is contained in:
2024-04-08 14:22:36 +02:00
parent fbcd643223
commit cc6ea4ed22
12 changed files with 107 additions and 40 deletions

View File

@@ -3,6 +3,7 @@
import { createLeaves, setRotation } from "./leaves";
import { Color } from "ogl";
import { rgbToHex } from "@helpers/colors";
import { colors } from "@helpers/colors";
let canvas: HTMLCanvasElement;
@@ -14,17 +15,17 @@
const color = new Color("#000000");
const updateBackgroundColor = () => {
const background = window.getComputedStyle(document.body);
const d = new Color(rgbToHex(background.backgroundColor));
function updateColor(c: string) {
const d = new Color(rgbToHex(c));
color.set(d.r, d.g, d.b);
};
}
$: if ($colors.background) {
updateColor($colors.background);
}
onMount(() => {
updateBackgroundColor();
createLeaves({ canvas, num: 20, minZ: 0, maxZ: 1, color });
// @ts-ignore
window["updateBackgroundColor"] = updateBackgroundColor;
createLeaves({ canvas, num: 40, minZ: 0, maxZ: 1, color });
setTimeout(() => {
loaded = true;
}, 100);
@@ -48,10 +49,10 @@
z-index: -1;
pointer-events: none;
opacity: 0;
transition: opacity 2s;
transition: opacity 4s;
}
.loaded {
opacity: 0.2;
opacity: 0.6;
}
</style>