@@ -4,18 +4,23 @@ const { posts } = Astro.props;
44---
55
66<nav class =" nav" >
7- <a href =" /astro-proyect/" ><img src =" /astro-proyect/images/logo_TB_horiz_negativo-01.png" alt =" The_bridge" class =" logo" ></a >
7+ <a href =" /astro-proyect/" class =" logo-link" >
8+ <img src =" /astro-proyect/images/logo_TB_horiz_negativo-01.png" alt =" The_bridge" class =" logo" >
9+ </a >
810
9- <div class =" search-container" >
10- <input
11- type =" text"
12- id =" search-input"
13- placeholder =" Buscar..."
14- aria-label =" Buscar"
15- class =" search-input"
16- style =" padding: 0.5rem; border-radius: 0.25rem; border: 1px solid #ccc;"
17- />
18- <ul id =" search-results" class =" search-dropdown" ></ul >
11+ <div class =" top-bar" >
12+ <div class =" search-container" >
13+ <input
14+ type =" text"
15+ id =" search-input"
16+ placeholder =" Buscar..."
17+ aria-label =" Buscar"
18+ class =" search-input"
19+ style =" padding: 0.5rem; border-radius: 0.25rem; border: 1px solid #ccc;"
20+ />
21+ <ul id =" search-results" class =" search-dropdown" ></ul >
22+ </div >
23+ <button class =" hamburger" aria-label =" Toggle menu" >☰ </button >
1924 </div >
2025
2126 <ul class =" navList" >
@@ -24,7 +29,6 @@ const { posts } = Astro.props;
2429 <li class =" navItem" ><a href =" /astro-proyect/frontend/" >FrontEnd</a ></li >
2530 </ul >
2631
27- <button class =" hamburger" aria-label =" Toggle menu" >☰ </button >
2832</nav >
2933
3034<script type =" module" >
@@ -51,7 +55,7 @@ const { posts } = Astro.props;
5155
5256 const contentPosts = data.map(post => ({
5357 title: post.title,
54- description: post.description ,
58+ description: '' ,
5559 url: `/astro-proyect/${post.slug}`
5660 }));
5761
@@ -68,8 +72,7 @@ const { posts } = Astro.props;
6872 }
6973
7074 const results = posts.filter(post =>
71- post.title.toLowerCase().includes(input) ||
72- post.description.toLowerCase().includes(input)
75+ post.title.toLowerCase().includes(input)
7376 );
7477
7578 if (results.length === 0) {
@@ -81,6 +84,7 @@ const { posts } = Astro.props;
8184 <li class="search-result-item">
8285 <a href="${post.url}">
8386 <strong>${post.title}</strong><br>
87+ <span>${post.description}</span>
8488 </a>
8589 </li>
8690 `).join('');
@@ -116,5 +120,14 @@ const { posts } = Astro.props;
116120 initSearch();
117121 })
118122 });
123+
124+ document.addEventListener("DOMContentLoaded", function () {
125+ const nav = document.querySelector(".nav");
126+ const hamburger = document.querySelector(".hamburger");
127+
128+ hamburger.addEventListener("click", function () {
129+ nav.classList.toggle("active");
130+ });
131+ });
119132</script >
120133
0 commit comments