Refactor: Update Navbar and TopBar UI
This commit implements the following changes:
1. Removed the close button (✕) from within the NavBar component (`ui/src/components/ui/NavBar.vue`). The sidebar is now exclusively controlled by the hamburger icon in the TopBar.
2. Moved the hamburger menu button in the TopBar component (`ui/src/components/ui/TopBar.vue`) to the left side of the application title ("Núcleo").
3. Improved the visual styling of the hamburger button in `TopBar.vue` with increased padding, consistent border-radius, and clearer hover and focus states for better usability and accessibility.
These changes address the issue of redundant close buttons and aim to provide a cleaner and more intuitive navigation experience.
This commit is contained in:
@@ -80,10 +80,6 @@ const handleLinkClick = () => {
|
|||||||
<div class="flex items-center justify-between px-4 py-4 md:px-5 md:py-4 md:border-none"
|
<div class="flex items-center justify-between px-4 py-4 md:px-5 md:py-4 md:border-none"
|
||||||
style="border-bottom-color: var(--secondary-color); border-bottom-width: 1px;">
|
style="border-bottom-color: var(--secondary-color); border-bottom-width: 1px;">
|
||||||
<span class="text-lg font-semibold md:hidden" style="color: var(--primary-color);">Núcleo</span>
|
<span class="text-lg font-semibold md:hidden" style="color: var(--primary-color);">Núcleo</span>
|
||||||
<button class="close-btn h-8 w-8 flex items-center justify-center rounded-full border transition duration-200"
|
|
||||||
@click="ui.toggleSidebar">
|
|
||||||
✕
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- navegación -->
|
<!-- navegación -->
|
||||||
|
|||||||
@@ -7,26 +7,39 @@ const ui = useUi()
|
|||||||
<!-- barra superior fija -->
|
<!-- barra superior fija -->
|
||||||
<header class="fixed top-0 left-0 right-0 h-14 flex items-center justify-between px-4 md:px-6 z-50 shadow-sm"
|
<header class="fixed top-0 left-0 right-0 h-14 flex items-center justify-between px-4 md:px-6 z-50 shadow-sm"
|
||||||
:style="{ backgroundColor: 'var(--background-color)', borderBottom: '1px solid var(--secondary-color)' }">
|
:style="{ backgroundColor: 'var(--background-color)', borderBottom: '1px solid var(--secondary-color)' }">
|
||||||
<!-- título -->
|
|
||||||
<h1 class="text-lg font-semibold tracking-wide select-none" :style="{ color: 'var(--primary-color)' }">Núcleo</h1>
|
|
||||||
|
|
||||||
<!-- botón hamburguesa (visible solo en mobile) -->
|
<!-- botón hamburguesa (visible solo en mobile) -->
|
||||||
<button
|
<button
|
||||||
@click="ui.toggleSidebar"
|
@click="ui.toggleSidebar"
|
||||||
class="hamburger-button inline-flex items-center justify-center h-9 w-9 rounded-md text-white transition">
|
class="hamburger-button inline-flex items-center justify-center h-9 w-9 rounded-md text-white transition">
|
||||||
☰
|
☰
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!-- título -->
|
||||||
|
<h1 class="text-lg font-semibold tracking-wide select-none" :style="{ color: 'var(--primary-color)' }">Núcleo</h1>
|
||||||
</header>
|
</header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.hamburger-button {
|
.hamburger-button {
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
|
color: white; /* Assuming primary-color is dark enough for white text */
|
||||||
|
padding: 0.5rem; /* Increased padding */
|
||||||
|
border-radius: 0.375rem; /* Consistent border radius */
|
||||||
|
transition: background-color 0.2s ease-in-out, filter 0.2s ease-in-out;
|
||||||
|
line-height: 1; /* Ensure icon is centered if it's text-based */
|
||||||
}
|
}
|
||||||
|
|
||||||
.hamburger-button:hover {
|
.hamburger-button:hover {
|
||||||
filter: brightness(1.1); /* Slight lighten/darken based on primary color */
|
filter: brightness(1.15); /* Slightly more noticeable hover brightness */
|
||||||
|
}
|
||||||
|
|
||||||
|
.hamburger-button:focus {
|
||||||
|
outline: 2px solid var(--primary-color); /* Simple outline for focus */
|
||||||
|
outline-offset: 2px; /* Offset outline slightly */
|
||||||
|
}
|
||||||
|
|
||||||
|
.hamburger-button:focus-visible { /* More modern focus indication */
|
||||||
|
outline: 2px solid var(--primary-color);
|
||||||
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
/* Alternative hover if primary is very light or very dark, requiring specific color adjustment */
|
|
||||||
/* .hamburger-button:hover { background-color: var(--primary-color-hover); } */
|
|
||||||
/* Ensure --primary-color-hover is defined or calculated based on --primary-color if this approach is used */
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user