|
1 | 1 | <script> |
2 | | - import { t, language } from "$lib/stores/language.js"; |
3 | | - import { theme } from "$lib/stores/theme.js"; |
4 | | -
|
5 | | - function toggleTheme() { |
6 | | - theme.setTheme($theme === "light" ? "dark" : "light"); |
7 | | - } |
8 | | -
|
9 | | - function toggleLanguage() { |
10 | | - language.setLang($language === "en" ? "he" : "en"); |
11 | | - } |
| 2 | + import { t } from "$lib/stores/language.js"; |
| 3 | + import ToggleButtons from "./ToggleButtons.svelte"; |
| 4 | + import NavLinkCard from "./NavLinkCard.svelte"; |
12 | 5 | </script> |
13 | 6 |
|
14 | 7 | <header class="bg-ctp-base/80 sticky top-0 z-50 transition-colors duration-300 relative pt-0 h-fit overflow-hidden"> |
15 | 8 | <div class="container mx-auto px-4"> |
16 | 9 | <nav |
17 | 10 | class="flex justify-between items-baseline transform -translate-y-8" |
18 | 11 | > |
19 | | - <a href="#hero" class="text-xl font-bold text-ctp-text" |
| 12 | + <a href="#hero" class="text-xl md:text-2xl font-bold text-ctp-text inline-block" |
20 | 13 | >{$t("name")}</a |
21 | 14 | > |
22 | 15 | <ul |
23 | | - class="hidden md:flex items-center space-x-8 text-sm font-medium px-4" |
| 16 | + class="hidden md:flex items-center space-x-8 text-sm font-medium px-4 py-0 mt-[-24]" |
24 | 17 | > |
25 | 18 | <li> |
26 | | - <a |
27 | | - href="#about" |
28 | | - class="inline-flex flex-col items-center justify-end w-24 h-36 p-2 bg-ctp-surface0 rounded-lg shadow-md text-ctp-text hover:text-ctp-green transition-colors transform transition-all duration-200 ease-in-out hover:scale-105 active:scale-110 active:-translate-y-1 active:rotate-1 active:shadow-lg rotate-1" |
29 | | - >{$t("nav.about")}</a |
30 | | - > |
| 19 | + <NavLinkCard href="#about" text={$t("nav.about")} rotation={1} /> |
31 | 20 | </li> |
32 | 21 | <li> |
33 | | - <a |
34 | | - href="#skills" |
35 | | - class="inline-flex flex-col items-center justify-end w-24 h-36 p-2 bg-ctp-surface0 rounded-lg shadow-md text-ctp-text hover:text-ctp-green transition-colors transform transition-all duration-200 ease-in-out hover:scale-105 active:scale-110 active:-translate-y-1 active:rotate-1 active:shadow-lg rotate-[-1]" |
36 | | - >{$t("nav.skills")}</a |
37 | | - > |
| 22 | + <NavLinkCard href="#skills" text={$t("nav.skills")} rotation={-1} /> |
38 | 23 | </li> |
39 | 24 | <li> |
40 | | - <a |
41 | | - href="#experience" |
42 | | - class="inline-flex flex-col items-center justify-end w-24 h-36 p-2 bg-ctp-surface0 rounded-lg shadow-md text-ctp-text hover:text-ctp-green transition-colors transform transition-all duration-200 ease-in-out hover:scale-105 active:scale-110 active:-translate-y-1 active:rotate-1 active:shadow-lg rotate-2" |
43 | | - >{$t("nav.experience")}</a |
44 | | - > |
| 25 | + <NavLinkCard href="#experience" text={$t("nav.experience")} rotation={2} /> |
45 | 26 | </li> |
46 | 27 | <li> |
47 | | - <a |
48 | | - href="#projects" |
49 | | - class="inline-flex flex-col items-center justify-end w-24 h-36 p-2 bg-ctp-surface0 rounded-lg shadow-md text-ctp-text hover:text-ctp-green transition-colors transform transition-all duration-200 ease-in-out hover:scale-105 active:scale-110 active:-translate-y-1 active:rotate-1 active:shadow-lg rotate-[-2]" |
50 | | - >{$t("nav.projects")}</a |
51 | | - > |
| 28 | + <NavLinkCard href="#projects" text={$t("nav.projects")} rotation={-2} /> |
52 | 29 | </li> |
53 | 30 | <li> |
54 | | - <a |
55 | | - href="#education" |
56 | | - class="inline-flex flex-col items-center justify-end w-24 h-36 p-2 bg-ctp-surface0 rounded-lg shadow-md text-ctp-text hover:text-ctp-green transition-colors transform transition-all duration-200 ease-in-out hover:scale-105 active:scale-110 active:-translate-y-1 active:rotate-1 active:shadow-lg rotate-1" |
57 | | - >{$t("nav.education")}</a |
58 | | - > |
| 31 | + <NavLinkCard href="#education" text={$t("nav.education")} rotation={1} /> |
59 | 32 | </li> |
60 | 33 | </ul> |
61 | 34 | </nav> |
62 | 35 | </div> |
63 | | - <div class="absolute top-[-16] right-4 flex items-center gap-4" dir="ltr"> |
64 | | - <button |
65 | | - on:click={toggleLanguage} |
66 | | - class="text-sm font-bold text-ctp-subtext0 transform transition-transform duration-200 hover:scale-110 active:scale-95" |
67 | | - > |
68 | | - {$language === "en" ? "HE" : "EN"} |
69 | | - </button> |
70 | | - <button |
71 | | - on:click={toggleTheme} |
72 | | - class="text-ctp-subtext0 text-xl transform transition-transform duration-200 hover:scale-110 active:scale-95" |
73 | | - > |
74 | | - {#if $theme === "light"} |
75 | | - <span>☾</span> <!-- Moon --> |
76 | | - {:else} |
77 | | - <span>☀</span> <!-- Sun --> |
78 | | - {/if} |
79 | | - </button> |
80 | | - </div> |
| 36 | + <ToggleButtons /> |
81 | 37 | </header> |
0 commit comments