mirror of
https://github.com/keven1024/015.git
synced 2026-06-05 03:49:36 +00:00
feat(front): update Navbar component with motion effects and add new dependencies
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
<template>
|
||||
<div class="flex flex-row bg-white/10 backdrop-blur-xl p-2 rounded-full">
|
||||
<div v-for="item in routes" :key="item.key"
|
||||
:class="cx('flex flex-row text-sm px-4 py-2 font-bold rounded-full cursor-pointer',
|
||||
item?.key === type && 'bg-black/10'
|
||||
)"
|
||||
class="flex flex-row text-sm px-4 py-2 font-bold rounded-full cursor-pointer relative"
|
||||
@click="()=>{
|
||||
router.push({
|
||||
query: {
|
||||
@@ -13,6 +11,7 @@
|
||||
})
|
||||
}"
|
||||
>
|
||||
<motion.div v-if="item?.key === type" layoutId="navbar-active" class="absolute inset-0 rounded-full w-full h-full bg-black/10"/>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,6 +19,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { cx } from 'class-variance-authority'
|
||||
import { motion } from "motion-v"
|
||||
const routes = [
|
||||
{ name: '文件', key: 'file' },
|
||||
{ name: '文本', key: 'text' }
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"lucide-vue-next": "^0.487.0",
|
||||
"motion-v": "1.0.0-beta.2",
|
||||
"nuxt": "^3.16.0",
|
||||
"vue": "latest",
|
||||
"vue-router": "latest"
|
||||
|
||||
Reference in New Issue
Block a user