-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
86 additions
and
78 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 |
---|---|---|
@@ -1,29 +1,21 @@ | ||
<script setup lang="ts"> | ||
import { useHead } from '@unhead/vue' | ||
import { isShowMenu } from './utils/store-data' | ||
import { isShowMenu } from './utils/menu' | ||
useHead({ | ||
titleTemplate: (title) => (title ? `${title} | 开源面对面` : '开源面对面'), | ||
}) | ||
</script> | ||
|
||
<template> | ||
<app-header /> | ||
<ai-assistant /> | ||
<router-view v-show="!isShowMenu" v-slot="{ Component }"> | ||
<Transition> | ||
<component :is="Component" /> | ||
</Transition> | ||
</router-view> | ||
<app-footer /> | ||
<div :class="{ 'overflow-hidden': isShowMenu }"> | ||
<app-header /> | ||
<ai-assistant /> | ||
<router-view v-slot="{ Component }"> | ||
<Transition> | ||
<component :is="Component" /> | ||
</Transition> | ||
</router-view> | ||
<app-footer /> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.v-enter-active { | ||
transition: opacity 0.3s ease-in; | ||
} | ||
.v-enter-from { | ||
opacity: 0; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,49 @@ | ||
<script setup lang="ts"> | ||
import { isShowMenu, menuList } from '../../utils/store-data' | ||
import { isShowMenu, menus } from '../../utils/menu' | ||
const router = useRouter() | ||
router.afterEach(() => { | ||
isShowMenu.value = false | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
ml-20px | ||
cursor-pointer | ||
text-2xl | ||
sm-hidden | ||
:i="isShowMenu ? 'carbon-close' : 'carbon-menu'" | ||
text=" 2xl" | ||
:class="isShowMenu ? 'i-carbon-close' : 'i-carbon-menu'" | ||
@click="isShowMenu = !isShowMenu" | ||
/> | ||
<div | ||
v-show="isShowMenu" | ||
style="background-color: var(--bg)" | ||
flex="~ col" | ||
fixed | ||
left-0 | ||
top-60px | ||
z-999 | ||
h-full | ||
w-full | ||
px-50px | ||
py-10px | ||
> | ||
<Transition> | ||
<div | ||
v-for="(item, key) in menuList" | ||
:key="key" | ||
style="border-bottom: 1px solid var(--border-color)" | ||
border-bottom="1px solid [var(--border-color)]" | ||
p-10px | ||
text-center | ||
v-show="isShowMenu" | ||
flex="~ col gap2" | ||
bg="[var(--bg)]" | ||
fixed | ||
left-0 | ||
top-60px | ||
z-999 | ||
h-full | ||
w-full | ||
px-50px | ||
py-10px | ||
duration="150!" | ||
> | ||
<a | ||
<router-link | ||
v-for="(item, key) in menus" | ||
:key="key" | ||
ml-20px | ||
style="color: var(--text-color)" | ||
:item="item" | ||
:href="item.href" | ||
border-b="1px solid [var(--border-color)]" | ||
class="text-[var(--text-color)]" | ||
flex="~ gap2" | ||
items-center | ||
justify-center | ||
p2 | ||
:to="item.href" | ||
> | ||
{{ item.name }} | ||
</a> | ||
<div :class="item.icon" text-xl /> | ||
{{ item.label }} | ||
</router-link> | ||
</div> | ||
</div> | ||
</Transition> | ||
</template> |
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,18 +1,21 @@ | ||
<script setup lang="ts"> | ||
import { menuList } from '../../utils/store-data' | ||
import { menus } from '../../utils/menu' | ||
</script> | ||
|
||
<template> | ||
<nav flex> | ||
<a | ||
v-for="(item, key) in menuList" | ||
<router-link | ||
v-for="(item, key) in menus" | ||
:key="key" | ||
:to="item.href" | ||
class="text-[var(--text-color)]" | ||
sm="flex flex-gap1" | ||
ml-20px | ||
style="color: var(--text-color)" | ||
:item="item" | ||
:href="item.href" | ||
hidden | ||
items-center | ||
> | ||
{{ item.name }} | ||
</a> | ||
<!-- TODO tooltip for label --> | ||
<div :title="item.label" :class="item.icon" class="text-2xl" /> | ||
</router-link> | ||
</nav> | ||
</template> |
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
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,16 @@ | ||
export interface MenuItem { | ||
label: string | ||
href: string | ||
icon: string | ||
} | ||
|
||
// @unocss-include | ||
export const menus: MenuItem[] = [ | ||
{ | ||
label: 'Sponsors', | ||
href: '/sponsors', | ||
icon: 'i-ri:heart-3-line text-pink', | ||
}, | ||
] | ||
|
||
export const isShowMenu = ref(false) |
This file was deleted.
Oops, something went wrong.