-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create component nav * Components * Corrections about styles in nav * Refactor --------- Co-authored-by: Adrian Delgado <[email protected]>
- Loading branch information
1 parent
5c14cf3
commit ecffc6e
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
import logo from "$lib/assets/images/logo.png"; | ||
const current_path = $derived($page.url.pathname); | ||
const LINKS = [ | ||
{ text: "Inicio", href: "/" }, | ||
{ text: "Eventos", href: "/events" }, | ||
{ text: "Proyectos", href: "/projects" }, | ||
{ text: "Contacto", href: "/contact" }, | ||
{ text: "Miembros", href: "/members" }, | ||
]; | ||
</script> | ||
|
||
<nav class="relative flex items-center justify-between bg-black p-4"> | ||
<div class="flex items-center"> | ||
<img src={logo} alt="Logo" class="mr-4 h-10" /> | ||
</div> | ||
<div class="flex space-x-8 text-lg text-white"> | ||
{#each LINKS as { href, text }} | ||
<a {href} class="font-bold hover:underline"> | ||
{#if current_path === href} | ||
<span class="text-green-400">{"{"}</span> | ||
<span>{text}</span> | ||
<span class="text-green-400">{"}"}</span> | ||
{:else} | ||
<span>{text}</span> | ||
{/if} | ||
</a> | ||
{/each} | ||
</div> | ||
<div class="absolute bottom-0 left-0 z-0 h-px w-full bg-green-500"></div> | ||
</nav> |