Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsiveness for navbar controls and sidebar #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ html.dark {

.editor-sidebar {
@apply h-screen sticky top-0 border-l w-80 bg-gray-50 dark:bg-gray-900 dark:border-gray-700 overflow-y-auto flex-shrink-0;
@media (max-width: 1024px) {
@apply w-60;
}
}
.toasted.toasted-primary {
@apply rounded-lg font-medium text-slate-800 dark:text-slate-100 bg-slate-100 dark:bg-slate-800 !important;
Expand All @@ -151,8 +154,32 @@ html.dark {
.sponsor-btn {
@apply border dark:border-gray-700 rounded-lg px-6 py-3 hover:bg-gray-100 dark:hover:bg-gray-700 text-sm focus:outline-none;
}

.navbar-container {
@apply border-t border-b sticky top-0 z-50 py-2.5 dark:border-gray-700 flex items-center px-8 navbar-frosted;
}

.navbar-heading {
position: absolute;
left: 2rem;
top: 1.4rem;
z-index: 0;
}

.nav-heading-spacer {
@apply w-48 h-10;
}

.navbar-controls {
@apply flex w-full justify-end z-10 flex-wrap;
}

.navbar-search-input {
@apply relative flex my-1.5 items-center overflow-hidden rounded-full bg-gray-50 dark:bg-gray-700 focus-within:bg-gray-100 dark:focus-within:bg-gray-800;
}

.navbar-btn {
@apply h-10 px-4 rounded-full flex items-center justify-center space-x-3 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200;
@apply h-10 px-4 ml-4 my-1.5 rounded-full flex items-center justify-center space-x-3 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 whitespace-nowrap;
}

.expand-enter-active,
Expand Down
92 changes: 42 additions & 50 deletions components/Base/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,48 @@
<template>
<div
class="h-[75px] border-t border-b sticky top-0 z-50 dark:border-gray-700 flex items-center justify-between px-8 flex-wrap navbar-frosted"
>
<p>
<span class="text-lg font-medium">{{ page.title }} Icons</span>
<span class="text-gray-600" v-if="page.subtitle"
>({{ page.subtitle }})</span
>
</p>
<div class="flex-space-x-4">
<div
class="relative flex items-center overflow-hidden rounded-full bg-gray-50 dark:bg-gray-700 focus-within:bg-gray-100 dark:focus-within:bg-gray-800"
>
<input
type="text"
class="focus:outline-none bg-transparent z-10 h-full rounded-l-full px-6 text-sm"
placeholder="Search (Press / to focus)"
ref="search"
@input="search"
autocomplete="new-password"
/>
<button
class="h-10 w-10 flex-center bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 z-20 focus:outline-none focus:bg-gray-200"
@click="$refs.search.focus()"
aria-label="Search"
>
<FluentIconFilledSearch class="text-gray-500 h-5 w-5" />
<div class="navbar-container">
<p class="navbar-heading">
<span class="text-lg font-medium">{{ page.title }} Icons</span>
<span class="text-gray-600" v-if="page.subtitle">({{ page.subtitle }})</span>
</p>
<div class="navbar-controls">
<div class="nav-heading-spacer"></div>
<div class="navbar-search-input">
<input
type="text"
class="focus:outline-none bg-transparent z-10 h-full rounded-l-full px-6 text-sm"
placeholder="Search (Press / to focus)"
ref="search"
@input="search"
autocomplete="new-password"/>
<button
class="h-10 w-10 flex-center bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 z-20 focus:outline-none focus:bg-gray-200"
@click="$refs.search.focus()"
aria-label="Search">
<FluentIconFilledSearch class="text-gray-500 h-5 w-5" />
</button>
</div>
<nuxt-link
:to="altIcons.path"
class="navbar-btn"
:aria-label="`${altIcons.name} Icons`">
<FluentIconFilledPositionBackward class="h-5 w-5" />
<p class="text-sm">{{ altIcons.name }} Icons</p>
</nuxt-link>
<button @click="toggleDarkMode" class="navbar-btn" aria-label="Dark Mode">
<FluentIconOutlinedWeatherSunny
v-if="$colorMode.value === 'dark'"
class="h-5 w-5"
/>
<FluentIconOutlinedWeatherMoon v-else class="h-5 w-5" />
<p class="text-sm">
{{ $colorMode.value === "dark" ? "Light" : "Dark" }} Mode
</p>
</button>
<nuxt-link to="/favorites" class="navbar-btn" aria-label="Favorites">
<FluentIconOutlinedHeart class="h-5 w-5" />
<p class="text-sm">Favorites</p>
</nuxt-link>
</div>
<nuxt-link
:to="altIcons.path"
class="navbar-btn"
:aria-label="`${altIcons.name} Icons`"
>
<FluentIconFilledPositionBackward class="h-5 w-5" />
<p class="text-sm">{{ altIcons.name }} Icons</p>
</nuxt-link>
<button @click="toggleDarkMode" class="navbar-btn" aria-label="Dark Mode">
<FluentIconOutlinedWeatherSunny
v-if="$colorMode.value === 'dark'"
class="h-5 w-5"
/>
<FluentIconOutlinedWeatherMoon v-else class="h-5 w-5" />
<p class="text-sm">
{{ $colorMode.value === "dark" ? "Light" : "Dark" }} Mode
</p>
</button>
<nuxt-link to="/favorites" class="navbar-btn" aria-label="Favorites">
<FluentIconOutlinedHeart class="h-5 w-5" />
<p class="text-sm">Favorites</p>
</nuxt-link>
</div>
<base-search-focus @keyup="focusSearch" />
</div>
</template>
Expand Down