Skip to content

Commit

Permalink
fix: link, add uses, add active link, remove fb ico
Browse files Browse the repository at this point in the history
  • Loading branch information
baumannzone committed Jun 5, 2024
1 parent a7882b2 commit ef01754
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/components/ArticleCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (!images[`/src/assets/authors/${authorParsed}.avif`])
/>
</div>
<h2 class='mt-2 text-lg font-semibold text-gray-900 group-hover:text-gray-600'>
<a href={`/blog/${post.slug}/`}>
<a href={`/blog/${post.slug}`}>
<span class='absolute inset-0' />
{post.data.title}
</a>
Expand All @@ -63,7 +63,7 @@ if (!images[`/src/assets/authors/${authorParsed}.avif`])
{post.data.author}
</a> */}
<a
href='`{/blog/${post.slug}/`}'
href={`/blog/${post.slug}`}
class='text-sm font-semibold leading-6 text-violet-700 hover:text-violet-600'
>
Ver más &rarr;
Expand Down
10 changes: 6 additions & 4 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ const today = new Date();
></path></g
></svg
></a
><a
>
<!-- <a
href='https://www.facebook.com/Baumannzone-Desarrollo-Full-Stack-Javascript-110550534472293'
target='_blank'
rel=' noopener noreferrer'
Expand All @@ -296,9 +297,10 @@ const today = new Date();
><path
d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'
></path></g
></svg
></a
><a
>
</svg>
</a> -->
<a
href='https://codepen.com/baumannzone'
target='_blank'
rel=' noopener noreferrer'
Expand Down
37 changes: 17 additions & 20 deletions src/components/NavBar.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
const currentPath = Astro.url.pathname;
console.log('🚀 ~ currentPath:', currentPath);
const links = [
{ href: '/', text: 'Inicio' },
Expand Down Expand Up @@ -37,17 +36,12 @@ const links = [
>
</div>

<div class='hidden sm:ml-6 sm:flex sm:space-x-8'>
<!-- Current: "border-violet-500 text-gray-900", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" -->
<div class='hidden sm:ml-6 sm:flex sm:space-x-8' id='desktop-menu'>
{
links.map((link) => (
<a
href={link.href}
class={`relative inline-flex items-center border-b-4 px-1 pt-1 text-sm font-medium ${
currentPath === link.href
? 'border-violet-500 text-gray-900'
: 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'
}`}
class='relative inline-flex items-center border-b-4 px-1 pt-1 text-sm font-medium border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'
>
{link.text}
{/* {link.showDot && (
Expand All @@ -70,11 +64,6 @@ const links = [
>
<span class='absolute -inset-0.5'></span>
<span class='sr-only'>Open main menu</span>
<!--
Icon when menu is closed.
Menu open: "hidden", Menu closed: "block"
-->
<svg
class='block h-6 w-6'
fill='none'
Expand Down Expand Up @@ -111,19 +100,13 @@ const links = [
</div>
</div>

<!-- Mobile menu, show/hide based on menu state. -->
<div class='hidden sm:hidden' id='mobile-menu'>
<div class='space-y-1 pb-3 pt-2'>
<!-- Current: "bg-violet-50 border-violet-500 text-violet-700", Default: "border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700" -->
{
links.map((link) => (
<a
href={link.href}
class={`block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium ${
currentPath === link.href
? 'border-violet-500 bg-violet-50 text-violet-700'
: 'text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700'
}`}
class='block border-l-4 border-transparent py-2 pl-3 pr-4 text-base font-medium text-gray-500 hover:border-gray-300 hover:bg-gray-50 hover:text-gray-700'
>
{link.text}
</a>
Expand All @@ -134,10 +117,24 @@ const links = [
</nav>

<script>
// Toggle mobile menu
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');

mobileMenuButton?.addEventListener('click', () => {
mobileMenu?.classList.toggle('hidden');
});

// Add active class to current link
const navLinks = document.querySelectorAll('nav a');
const currentURL = window.location.href;
navLinks.forEach((link) => {
if ((link as HTMLAnchorElement).href === currentURL) {
if (link.parentElement?.id === 'desktop-menu') {
link.classList.add('active-link');
} else {
link.classList.add('active-link-mobile');
}
}
});
</script>
6 changes: 4 additions & 2 deletions src/components/UsesPage/uses.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ Con **Oh My Zsh** puedes cambiar fácilmente de temas y elegir el que más te gu

## Gadgets & Tools

- [DJI OM 5](https://amzn.to/2XF7UGz) - Estabilizador para móviles DJI OM 5 de 3 ejes. Color _athen gray_.
- [DJI OM 5](https://amzn.to/2XF7UGz) - Estabilizador para móviles DJI OM 5 de 3 ejes. Color _athen gray_. Si te mola grabar vídeos con el móvil, este es tu gadget.
- [Mini Dron Tello](https://amzn.to/3ldFr4l) - Un mini dron de DJI. Se puede programar con `JavaScript`.
- [Fidget Cube](https://www.kickstarter.com/projects/antsylabs/fidget-cube-a-vinyl-desk-toy)
- [Fidget Cube](https://amzn.to/3RgkwwV) - Cubo antiestrés. Un vicio. Tiene botones, ruedas, interruptores y bolitas para jugar.
- [iPhone 12 Mini Púrpura](https://www.apple.com/es/iphone-12/key-features/) - Mi primer móvil de Apple. Me encanta que sea tan pequeño. Más portable y manejable.
- [Amazon Kindle eBook](https://amzn.to/3xkVSys)
- [Power Ball](https://amzn.to/4bYITH4) - Bola Giratoria para mover un poco las muñecas.
- [DYMO Label Maker](https://amzn.to/4dX1OUB) - Impresora de etiquetas para tener todo bien organizado.
- [Raspberry Pi 3 B](https://amzn.to/3x4XkL6) - La uso para hacer pruebas y experimentos. Es un mini ordenador que actualmente tiene instalado [Retropie](https://retropie.org.uk/).
- [Mandos Super Nintendo USB](https://amzn.to/3x28pg0) - Versión no original de los mandos de la Super Nintendo. Los uso con la Raspberry Pi para jugar a los juegos de mi infancia.

---

Expand Down
11 changes: 10 additions & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@
@apply sm:px-6;
@apply lg:px-8;
}
}

.active-link {
@apply border-violet-500 text-gray-900 !important;
}

.active-link-mobile {
@apply border-violet-500 bg-violet-50 text-violet-700 !important;
}
}

0 comments on commit ef01754

Please sign in to comment.