-
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.
- Loading branch information
1 parent
81ff26b
commit 99694ef
Showing
3 changed files
with
86 additions
and
8 deletions.
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 |
---|---|---|
@@ -1,7 +1,85 @@ | ||
<nav> | ||
<a href="/">Inicio</a> | ||
<a href="/events">Eventos</a> | ||
<a href="/projects">Proyectos</a> | ||
<a href="/contact">Contacto</a> | ||
<a href="/member">Miembros</a> | ||
<script lang="ts"> | ||
import { page } from "$app/stores"; | ||
import { derived } from "svelte/store"; | ||
import logo from "$lib/assets/images/logo.png"; | ||
// Derivar la ruta actual desde el store de la página | ||
const path = derived(page, ($page) => $page.url.pathname); | ||
// Variable que mantiene el path actual | ||
let currentPath: string; | ||
// Suscribirse al store para obtener actualizaciones | ||
path.subscribe((value) => { | ||
currentPath = value; | ||
}); | ||
</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"> | ||
<!-- Enlace Inicio --> | ||
<a href="/" class="hover:underline"> | ||
{#if currentPath === "/"} | ||
<span class="font-bold text-green-400"> | ||
<span class="text-green-400">{"{"}</span> | ||
<span class="text-white">Inicio</span> | ||
<span class="text-green-400">{"}"}</span> | ||
</span> | ||
{:else} | ||
Inicio | ||
{/if} | ||
</a> | ||
<!-- Enlace Eventos --> | ||
<a href="/events" class="hover:underline"> | ||
{#if currentPath === "/events"} | ||
<span class="font-bold text-green-400"> | ||
<span class="text-green-400">{"{"}</span> | ||
<span class="text-white">Eventos</span> | ||
<span class="text-green-400">{"}"}</span> | ||
</span> | ||
{:else} | ||
Eventos | ||
{/if} | ||
</a> | ||
<!-- Enlace Proyectos --> | ||
<a href="/projects" class="hover:underline"> | ||
{#if currentPath === "/projects"} | ||
<span class="font-bold text-green-400"> | ||
<span class="text-green-400">{"{"}</span> | ||
<span class="text-white">Proyectos</span> | ||
<span class="text-green-400">{"}"}</span> | ||
</span> | ||
{:else} | ||
Proyectos | ||
{/if} | ||
</a> | ||
<!-- Enlace Contacto --> | ||
<a href="/contact" class="hover:underline"> | ||
{#if currentPath === "/contact"} | ||
<span class="font-bold text-green-400"> | ||
<span class="text-green-400">{"{"}</span> | ||
<span class="text-white">Contacto</span> | ||
<span class="text-green-400">{"}"}</span> | ||
</span> | ||
{:else} | ||
Contacto | ||
{/if} | ||
</a> | ||
<!-- Enlace Miembros --> | ||
<a href="/member" class="hover:underline"> | ||
{#if currentPath === "/member"} | ||
<span class="font-bold text-green-400"> | ||
<span class="text-green-400">{"{"}</span> | ||
<span class="text-white">Miembros</span> | ||
<span class="text-green-400">{"}"}</span> | ||
</span> | ||
{:else} | ||
Miembros | ||
{/if} | ||
</a> | ||
</div> | ||
<div class="absolute bottom-0 left-0 z-0 h-px w-full bg-green-500"></div> | ||
</nav> |