diff --git a/src/routes/cv/+page.svelte b/src/routes/cv/+page.svelte index 44a0253..1c13f84 100644 --- a/src/routes/cv/+page.svelte +++ b/src/routes/cv/+page.svelte @@ -50,21 +50,27 @@ const params = new URLSearchParams(window.location.search); debug = params.has("debug"); + + loadMotivation(); }); - let moticationInput: HTMLInputElement; + let motivationInput: HTMLTextAreaElement; + let motivation: string | null = ""; function loadMotivation() { - const motivation = localStorage.getItem("motivation"); - if (!motivation) return; - - moticationInput.value = motivation; + const content = localStorage.getItem("motivation"); + if (content && motivationInput) { + motivationInput.value = content; + motivation = content; + } } + function submitMotivation() { - console.log(moticationInput.value); - if (!moticationInput.value) { + if (!motivationInput) return; + const content = motivationInput.value; + if (!content.trim()) { localStorage.removeItem("motivation"); } else { - localStorage.setItem("motivation", moticationInput.value); + localStorage.setItem("motivation", content); } window.location.reload(); } @@ -81,7 +87,8 @@
{$re?.name ?? "Alex"}'s {getLocale().toUpperCase()} CV {getFormattedDate()}{motivation ? "CUSTOM" : ""} + {$re?.name ?? "Alex"}'s {getLocale().toUpperCase()} CV {getFormattedDate()} -
+
@@ -125,12 +132,11 @@ }} class="join" > - + > @@ -297,7 +303,6 @@ } .cv-info-container { - height: 15mm; background-color: #2b2a2a; display: flex; justify-content: center;