-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: Improve Navbar to use new Nuxt UI Component (#262)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ee2ad40
commit 8a08891
Showing
7 changed files
with
83 additions
and
66 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "🌈 Enhancement request" | ||
description: Suggest an idea or enhancement for the project. | ||
labels: ["enhancement"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Before requesting an enhancement, please make sure that you have read through our [documentation](https://shelve.hrcd.fr) and existing [issues](https://github.com/HugoRCD/shelve/issues) to see if the feature has already been requested or implemented. If it has, please add your reaction to the existing issue instead of creating a new one. | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: A clear and concise description of what you think would be an helpful addition to the project, including the possible use cases and alternatives you have considered. | ||
- type: textarea | ||
id: additional | ||
attributes: | ||
label: Additional context | ||
description: If applicable, add any other context or screenshots here. |
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 was deleted.
Oops, something went wrong.
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,44 +1,61 @@ | ||
<script lang="ts" setup> | ||
const navigation = getNavigation('home') | ||
const items = navigation.map((item) => ({ | ||
...item, | ||
to: item.path, | ||
label: item.title, | ||
slot: item.name.toLowerCase(), | ||
})) | ||
const githubStars = ref('0') | ||
async function fetchRepo() { | ||
try { | ||
const res = await $fetch('https://ungh.cc/repos/hugorcd/shelve') as { repo: RepoType } | ||
githubStars.value = res.repo.stars.toString() | ||
} catch (e) { /* empty */ } | ||
} | ||
await fetchRepo() | ||
const githubItem = { | ||
label: 'GitHub', | ||
icon: 'i-simple-icons-github', | ||
badge: githubStars.value, | ||
to: 'https://github.com/HugoRCD/shelve', | ||
target: '_blank' | ||
} | ||
items.push(githubItem) | ||
</script> | ||
|
||
<template> | ||
<div class="z-[99]"> | ||
<nav class="fixed top-0 flex w-full"> | ||
<div class="backdrop" /> | ||
<div class="z-50 flex w-full items-center justify-around p-4 sm:px-5 sm:py-2"> | ||
<div class="flex gap-2"> | ||
<div class="z-[99] relative"> | ||
<div class="fixed top-0 flex w-full"> | ||
<div class="fixed w-full top-0 z-40 h-40 bg-gradient-to-b from-neutral-950 to-transparent" /> | ||
<div class="z-50 flex w-full items-center justify-between sm:justify-around p-4 sm:px-5 sm:py-2"> | ||
<div class="flex items-center gap-4"> | ||
<NuxtLink to="/" class="font-newsreader text-2xl font-light italic"> | ||
Shelve | ||
</NuxtLink> | ||
<UDivider orientation="vertical" class="mx-2" /> | ||
<div class="flex items-center gap-3"> | ||
<NuxtLink | ||
v-for="item in navigation" | ||
:key="item.name" | ||
class="font-geist-mono text-sm text-neutral-200 hover:text-neutral-400" | ||
:to="item.path" | ||
> | ||
{{ item.name }} | ||
</NuxtLink> | ||
</div> | ||
<UNavigationMenu :items color="neutral" class="hidden sm:flex" :ui="{ link: 'text-white' }"> | ||
<template #components-trailing> | ||
<UBadge label="44" variant="subtle" size="sm" /> | ||
</template> | ||
</UNavigationMenu> | ||
</div> | ||
<div class="flex items-center gap-5"> | ||
<LandingGithubStar class="hidden sm:flex" /> | ||
<div class="flex items-center gap-2"> | ||
<div class="flex sm:hidden"> | ||
<UDropdownMenu :items> | ||
<UButton color="neutral" variant="ghost" icon="lucide:menu" /> | ||
</UDropdownMenu> | ||
</div> | ||
<AuthState> | ||
<DropdownMenu /> | ||
</AuthState> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
@import "tailwindcss"; | ||
.backdrop { | ||
@apply absolute top-0 z-40 h-40; | ||
@apply bg-gradient-to-b from-neutral-900 to-transparent; | ||
} | ||
</style> |
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