-
Notifications
You must be signed in to change notification settings - Fork 323
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
12 changed files
with
256 additions
and
204 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
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.
58 changes: 58 additions & 0 deletions
58
src/layouts/components/Topbar/Toolbar/Breadcrumb/index.vue
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,58 @@ | ||
<script setup lang="ts"> | ||
import { compile } from 'path-to-regexp' | ||
import Breadcrumb from '../../../Breadcrumb/index.vue' | ||
import BreadcrumbItem from '../../../Breadcrumb/item.vue' | ||
import useSettingsStore from '@/store/modules/settings' | ||
const route = useRoute() | ||
const settingsStore = useSettingsStore() | ||
const breadcrumbList = computed(() => { | ||
const breadcrumbList = [] | ||
if (settingsStore.settings.home.enable) { | ||
breadcrumbList.push({ | ||
path: settingsStore.settings.home.fullPath, | ||
title: settingsStore.settings.home.title, | ||
}) | ||
} | ||
if (route.meta.breadcrumbNeste) { | ||
route.meta.breadcrumbNeste.forEach((item) => { | ||
if (item.hide === false) { | ||
breadcrumbList.push({ | ||
path: item.path, | ||
title: item.title, | ||
}) | ||
} | ||
}) | ||
} | ||
return breadcrumbList | ||
}) | ||
function pathCompile(path: string) { | ||
const toPath = compile(path) | ||
return toPath(route.params) | ||
} | ||
</script> | ||
|
||
<template> | ||
<Breadcrumb v-if="settingsStore.mode === 'pc' && settingsStore.settings.app.routeBaseOn !== 'filesystem'" class="breadcrumb whitespace-nowrap px-2"> | ||
<TransitionGroup name="breadcrumb"> | ||
<BreadcrumbItem v-for="(item, index) in breadcrumbList" :key="`${index}_${item.path}_${item.title}`" :to="index < breadcrumbList.length - 1 && item.path !== '' ? pathCompile(item.path) : ''"> | ||
{{ item.title }} | ||
</BreadcrumbItem> | ||
</TransitionGroup> | ||
</Breadcrumb> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
// 面包屑动画 | ||
.breadcrumb-enter-active { | ||
transition: transform 0.3s, opacity 0.3s; | ||
} | ||
.breadcrumb-enter-from { | ||
opacity: 0; | ||
transform: translateX(30px) skewX(-50deg); | ||
} | ||
</style> |
43 changes: 43 additions & 0 deletions
43
src/layouts/components/Topbar/Toolbar/ColorScheme/index.vue
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,43 @@ | ||
<script setup lang="ts"> | ||
import useSettingsStore from '@/store/modules/settings' | ||
defineOptions({ | ||
name: 'ColorScheme', | ||
}) | ||
const settingsStore = useSettingsStore() | ||
function toggleColorScheme(event: MouseEvent) { | ||
const { startViewTransition } = useViewTransition(() => { | ||
settingsStore.setColorScheme(settingsStore.settings.app.colorScheme === 'dark' ? 'light' : 'dark') | ||
}) | ||
startViewTransition()?.ready.then(() => { | ||
const x = event.clientX | ||
const y = event.clientY | ||
const endRadius = Math.hypot( | ||
Math.max(x, innerWidth - x), | ||
Math.max(y, innerHeight - y), | ||
) | ||
const clipPath = [ | ||
`circle(0px at ${x}px ${y}px)`, | ||
`circle(${endRadius}px at ${x}px ${y}px)`, | ||
] | ||
document.documentElement.animate( | ||
{ | ||
clipPath: settingsStore.settings.app.colorScheme !== 'dark' ? clipPath : clipPath.reverse(), | ||
}, | ||
{ | ||
duration: 300, | ||
easing: 'ease-out', | ||
pseudoElement: settingsStore.settings.app.colorScheme !== 'dark' ? '::view-transition-new(root)' : '::view-transition-old(root)', | ||
}, | ||
) | ||
}) | ||
} | ||
</script> | ||
|
||
<template> | ||
<span class="flex-center cursor-pointer px-2 py-1" @click="toggleColorScheme"> | ||
<SvgIcon :name="settingsStore.settings.app.colorScheme === 'light' ? 'ri:sun-line' : 'ri:moon-line'" /> | ||
</span> | ||
</template> |
18 changes: 18 additions & 0 deletions
18
src/layouts/components/Topbar/Toolbar/Fullscreen/index.vue
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 @@ | ||
<script setup lang="ts"> | ||
import { useFullscreen } from '@vueuse/core' | ||
import useSettingsStore from '@/store/modules/settings' | ||
defineOptions({ | ||
name: 'Fullscreen', | ||
}) | ||
const settingsStore = useSettingsStore() | ||
const { isFullscreen, toggle } = useFullscreen() | ||
</script> | ||
|
||
<template> | ||
<span v-if="settingsStore.mode === 'pc'" class="flex-center cursor-pointer px-2 py-1" @click="toggle"> | ||
<SvgIcon :name="isFullscreen ? 'ri:fullscreen-exit-line' : 'ri:fullscreen-line'" /> | ||
</span> | ||
</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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script setup lang="ts"> | ||
import eventBus from '@/utils/eventBus' | ||
import useSettingsStore from '@/store/modules/settings' | ||
defineOptions({ | ||
name: 'ToolbarRightSide', | ||
}) | ||
const settingsStore = useSettingsStore() | ||
</script> | ||
|
||
<template> | ||
<span class="flex-center cursor-pointer px-2 py-1" @click="eventBus.emit('global-search-toggle')"> | ||
<SvgIcon v-if="settingsStore.mode === 'mobile'" name="ri:search-line" /> | ||
<span v-else class="group inline-flex cursor-pointer items-center gap-1 whitespace-nowrap rounded-2 bg-stone-1 px-2 py-1.5 text-dark ring-stone-3 ring-inset transition dark:bg-stone-9 dark:text-white hover:ring-1 dark:ring-stone-7"> | ||
<SvgIcon name="ri:search-line" /> | ||
<span class="text-sm text-stone-5 transition group-hover:text-dark dark:group-hover:text-white">搜索</span> | ||
<HKbd v-if="settingsStore.settings.navSearch.enableHotkeys" class="ml-2">{{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} S</HKbd> | ||
</span> | ||
</span> | ||
</template> |
13 changes: 13 additions & 0 deletions
13
src/layouts/components/Topbar/Toolbar/PageReload/index.vue
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,13 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'PageReload', | ||
}) | ||
const mainPage = useMainPage() | ||
</script> | ||
|
||
<template> | ||
<span class="flex-center cursor-pointer px-2 py-1" @click="mainPage.reload()"> | ||
<SvgIcon name="iconoir:refresh-double" /> | ||
</span> | ||
</template> |
Oops, something went wrong.