|
12 | 12 | import { news } from "$lib/news/news.json"; |
13 | 13 | import type { Entries } from "$lib/types"; |
14 | 14 | import { cn } from "$lib/utils"; |
15 | | - import { Button, buttonVariants } from "$lib/components/ui/button"; |
| 15 | + import { buttonVariants } from "$lib/components/ui/button"; |
16 | 16 | import * as DropdownMenu from "$lib/components/ui/dropdown-menu"; |
17 | 17 | import { Toaster } from "$lib/components/ui/sonner"; |
| 18 | + import AnimatedButton from "$lib/components/AnimatedButton.svelte"; |
18 | 19 | import MarkdownRenderer from "$lib/components/MarkdownRenderer.svelte"; |
19 | 20 | import ScreenSize from "$lib/components/ScreenSize.svelte"; |
20 | 21 |
|
|
146 | 147 | {#each [{ link: resolve("/packages"), title: "Packages" }, { link: resolve("/tracker"), title: "Tracker" }, { link: resolve("/devlog"), title: "Devlog" }] as { link, title } (link)} |
147 | 148 | {@const disabled = page.url.pathname.startsWith(link)} |
148 | 149 | <li> |
149 | | - <Button |
| 150 | + <AnimatedButton |
150 | 151 | href={disabled ? undefined : link} |
151 | 152 | variant="ghost" |
152 | 153 | class="hover:bg-accent/75" |
153 | 154 | {disabled} |
154 | 155 | > |
155 | 156 | {title} |
156 | | - </Button> |
| 157 | + </AnimatedButton> |
157 | 158 | </li> |
158 | 159 | {/each} |
159 | 160 | </ul> |
|
162 | 163 | <!-- Right part --> |
163 | 164 | <div class="flex flex-1 items-center justify-end space-x-2 sm:space-x-4"> |
164 | 165 | <nav class="flex items-center space-x-1"> |
165 | | - <Button |
| 166 | + <AnimatedButton |
166 | 167 | href="https://github.com/WarningImHack3r/svelte-changelog" |
167 | 168 | target="_blank" |
168 | 169 | variant="ghost" |
169 | 170 | size="icon" |
170 | 171 | > |
171 | 172 | <img src="/github.svg" alt="GitHub" class="size-5 dark:invert" /> |
172 | 173 | <span class="sr-only">Visit the repository</span> |
173 | | - </Button> |
| 174 | + </AnimatedButton> |
174 | 175 | <DropdownMenu.Root bind:open={themeSwitcherOpen}> |
175 | 176 | <DropdownMenu.Trigger> |
176 | 177 | {#snippet child({ props })} |
177 | | - <Button {...props} variant="ghost" size="icon" class="w-14 gap-1"> |
| 178 | + <AnimatedButton {...props} variant="ghost" size="icon" class="w-14 gap-1"> |
178 | 179 | <div class="flex items-center"> |
179 | 180 | <Sun |
180 | 181 | class="!size-5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" |
|
189 | 190 | : ''}" |
190 | 191 | /> |
191 | 192 | <span class="sr-only">Change theme</span> |
192 | | - </Button> |
| 193 | + </AnimatedButton> |
193 | 194 | {/snippet} |
194 | 195 | </DropdownMenu.Trigger> |
195 | 196 | <DropdownMenu.Content> |
|
235 | 236 | inline |
236 | 237 | class="mx-auto my-1 px-4 text-center text-foreground prose-a:font-semibold prose-a:text-foreground prose-a:underline" |
237 | 238 | /> |
238 | | - <Button |
| 239 | + <AnimatedButton |
239 | 240 | variant="ghost" |
240 | 241 | class="mr-4 h-auto rounded-none px-3 py-2 transition-transform hover:scale-110 hover:rotate-90 hover:bg-background/0" |
241 | 242 | onclick={markCurrentNewsAsRead} |
242 | 243 | > |
243 | 244 | <X class="size-4" /> |
244 | | - </Button> |
| 245 | + </AnimatedButton> |
245 | 246 | </div> |
246 | 247 | {/if} |
247 | 248 | </header> |
|
0 commit comments