|
@@ -1,240 +1,192 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <nav class="bg-white border-2 border-[#0A0910] max-w-7xl mx-auto rounded-lg mb-4 shadow-lg">
|
|
|
|
|
- <div class="px-4 py-6 md:px-6">
|
|
|
|
|
- <!-- 桌面端导航 -->
|
|
|
|
|
- <div class="hidden md:flex items-center justify-between">
|
|
|
|
|
- <!-- Logo区域 -->
|
|
|
|
|
- <router-link to="/" class="flex items-center gap-3 transition-transform duration-200" @click="rotateLogo">
|
|
|
|
|
- <div
|
|
|
|
|
- class="w-12 h-12 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-lg flex items-center justify-center border-2 border-[#0A0910]"
|
|
|
|
|
- :class="{ 'rotate-logo': isLogoRotating }"
|
|
|
|
|
- >
|
|
|
|
|
- <span class="text-white text-xl font-bold">饭</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="text-2xl font-black text-dark-800 tracking-wider">
|
|
|
|
|
- {{ pageTitle }}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="text-xs text-gray-600 font-medium">{{ pageSubtitle }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </router-link>
|
|
|
|
|
|
|
+ <nav class="bg-white border-2 border-[#0A0910] max-w-7xl mx-auto rounded-lg mb-4 shadow-lg">
|
|
|
|
|
+ <div class="px-4 py-6 md:px-6">
|
|
|
|
|
+ <!-- 桌面端导航 -->
|
|
|
|
|
+ <div class="hidden md:flex items-center justify-between">
|
|
|
|
|
+ <!-- Logo区域 -->
|
|
|
|
|
+ <router-link to="/" class="flex items-center gap-3 transition-transform duration-200" @click="rotateLogo">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="w-12 h-12 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-lg flex items-center justify-center border-2 border-[#0A0910]"
|
|
|
|
|
+ :class="{ 'rotate-logo': isLogoRotating }">
|
|
|
|
|
+ <span class="text-white text-xl font-bold">饭</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="text-2xl font-black text-dark-800 tracking-wider">
|
|
|
|
|
+ {{ pageTitle }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="text-xs text-gray-600 font-medium">{{ pageSubtitle }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 导航菜单 -->
|
|
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
|
|
+ <LoginButton />
|
|
|
|
|
+ <!-- 设置按钮 -->
|
|
|
|
|
+ <!-- <SettingsButton /> -->
|
|
|
|
|
+ <!-- 主要功能 -->
|
|
|
|
|
|
|
|
- <!-- 导航菜单 -->
|
|
|
|
|
- <div class="flex items-center gap-2">
|
|
|
|
|
- <LoginButton />
|
|
|
|
|
- <!-- 设置按钮 -->
|
|
|
|
|
- <!-- <SettingsButton /> -->
|
|
|
|
|
- <!-- 主要功能 -->
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/"
|
|
|
|
|
- class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
- :class="$route.path === '/' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🏠</span>
|
|
|
|
|
- <span>{{ t('navigation.home') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/today-eat"
|
|
|
|
|
- class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
- :class="$route.path === '/today-eat' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🎲</span>
|
|
|
|
|
- <span>{{ t('navigation.todayEat') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/table-design"
|
|
|
|
|
- class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
- :class="$route.path === '/table-design' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🍽️</span>
|
|
|
|
|
- <span>{{ t('navigation.tableDesign') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/fortune-cooking"
|
|
|
|
|
- class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
- :class="$route.path === '/fortune-cooking' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🔮</span>
|
|
|
|
|
- <span>{{ t('navigation.fortuneCooking') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/sauce-design"
|
|
|
|
|
- class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
- :class="$route.path === '/sauce-design' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🥄</span>
|
|
|
|
|
- <span>{{ t('navigation.sauceDesign') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
|
|
+ <template v-if="false">
|
|
|
|
|
+ <router-link to="/"
|
|
|
|
|
+ class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
+ :class="$route.path === '/' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'">
|
|
|
|
|
+ <span>🏠</span>
|
|
|
|
|
+ <span>{{ t('navigation.home') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/today-eat"
|
|
|
|
|
+ class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
+ :class="$route.path === '/today-eat' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'">
|
|
|
|
|
+ <span>🎲</span>
|
|
|
|
|
+ <span>{{ t('navigation.todayEat') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/table-design"
|
|
|
|
|
+ class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
+ :class="$route.path === '/table-design' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'">
|
|
|
|
|
+ <span>🍽️</span>
|
|
|
|
|
+ <span>{{ t('navigation.tableDesign') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/fortune-cooking"
|
|
|
|
|
+ class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
+ :class="$route.path === '/fortune-cooking' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'">
|
|
|
|
|
+ <span>🔮</span>
|
|
|
|
|
+ <span>{{ t('navigation.fortuneCooking') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/sauce-design"
|
|
|
|
|
+ class="flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm"
|
|
|
|
|
+ :class="$route.path === '/sauce-design' ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'">
|
|
|
|
|
+ <span>🥄</span>
|
|
|
|
|
+ <span>{{ t('navigation.sauceDesign') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
|
|
|
- <!-- 更多菜单下拉 -->
|
|
|
|
|
- <div class="relative" @mouseleave="handleMouseLeave">
|
|
|
|
|
- <button
|
|
|
|
|
- @mouseenter="handleMouseEnter"
|
|
|
|
|
- @click="showMoreMenu = !showMoreMenu"
|
|
|
|
|
- :class="[
|
|
|
|
|
- 'flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm',
|
|
|
|
|
- isMoreMenuActive ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
|
|
|
|
- ]"
|
|
|
|
|
- >
|
|
|
|
|
- <span>⋯</span>
|
|
|
|
|
- <span>{{ t('navigation.more') }}</span>
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <!-- 更多菜单下拉 -->
|
|
|
|
|
+ <div class="relative" @mouseleave="handleMouseLeave">
|
|
|
|
|
+ <button @mouseenter="handleMouseEnter" @click="showMoreMenu = !showMoreMenu" :class="[
|
|
|
|
|
+ 'flex items-center gap-1 px-3 py-2 rounded-lg font-bold border-2 border-[#0A0910] transition-all duration-200 transform hover:scale-105 text-sm',
|
|
|
|
|
+ isMoreMenuActive ? 'bg-yellow-400 text-gray-800' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
|
|
|
|
+ ]">
|
|
|
|
|
+ <span>⋯</span>
|
|
|
|
|
+ <span>{{ t('navigation.more') }}</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
|
|
|
- <!-- 下拉菜单 -->
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="showMoreMenu"
|
|
|
|
|
- @mouseenter="handleMouseEnter"
|
|
|
|
|
- class="absolute right-0 top-full mt-0.5 w-40 bg-white border-2 border-[#0A0910] rounded-lg shadow-lg z-50 overflow-hidden"
|
|
|
|
|
- >
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/favorites"
|
|
|
|
|
- @click="showMoreMenu = false"
|
|
|
|
|
- class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
- :class="$route.path === '/favorites' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>❤️</span>
|
|
|
|
|
- <span>{{ t('navigation.favorites') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/gallery"
|
|
|
|
|
- @click="showMoreMenu = false"
|
|
|
|
|
- class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
- :class="$route.path === '/gallery' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🖼️</span>
|
|
|
|
|
- <span>{{ t('navigation.gallery') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/about"
|
|
|
|
|
- @click="showMoreMenu = false"
|
|
|
|
|
- class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
- :class="$route.path === '/about' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>📖</span>
|
|
|
|
|
- <span>{{ t('navigation.about') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <!-- 下拉菜单 -->
|
|
|
|
|
+ <div v-if="showMoreMenu" @mouseenter="handleMouseEnter"
|
|
|
|
|
+ class="absolute right-0 top-full mt-0.5 w-40 bg-white border-2 border-[#0A0910] rounded-lg shadow-lg z-50 overflow-hidden">
|
|
|
|
|
+ <router-link to="/favorites" @click="showMoreMenu = false"
|
|
|
|
|
+ class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
+ :class="$route.path === '/favorites' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'">
|
|
|
|
|
+ <span>❤️</span>
|
|
|
|
|
+ <span>{{ t('navigation.favorites') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/gallery" @click="showMoreMenu = false"
|
|
|
|
|
+ class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
+ :class="$route.path === '/gallery' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'">
|
|
|
|
|
+ <span>🖼️</span>
|
|
|
|
|
+ <span>{{ t('navigation.gallery') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/about" @click="showMoreMenu = false"
|
|
|
|
|
+ class="flex items-center gap-2 px-4 py-3 text-sm font-bold transition-colors duration-200 hover:bg-gray-100"
|
|
|
|
|
+ :class="$route.path === '/about' ? 'bg-yellow-100 text-gray-800' : 'text-gray-700'">
|
|
|
|
|
+ <span>📖</span>
|
|
|
|
|
+ <span>{{ t('navigation.about') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <!-- 移动端导航 -->
|
|
|
|
|
- <div class="md:hidden">
|
|
|
|
|
- <!-- 顶部Logo和菜单按钮 -->
|
|
|
|
|
- <div class="flex items-center justify-between">
|
|
|
|
|
- <router-link to="/" class="flex items-center gap-2" @click="rotateLogo">
|
|
|
|
|
- <div
|
|
|
|
|
- class="w-10 h-10 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-lg flex items-center justify-center border-2 border-[#0A0910]"
|
|
|
|
|
- :class="{ 'rotate-logo': isLogoRotating }"
|
|
|
|
|
- >
|
|
|
|
|
- <span class="text-white text-lg font-bold">饭</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="text-lg font-black text-dark-800 tracking-wider">
|
|
|
|
|
- {{ pageTitle }}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="text-xs text-gray-600 font-medium">{{ pageSubtitle }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <div class="flex items-center gap-2">
|
|
|
|
|
-
|
|
|
|
|
- <LoginButton />
|
|
|
|
|
- <!-- 移动端设置按钮 -->
|
|
|
|
|
- <!-- <SettingsButton /> -->
|
|
|
|
|
- <!-- <button @click="showMobileMenu = !showMobileMenu" class="p-2 bg-gray-100 hover:bg-gray-200 rounded-lg border-2 border-[#0A0910] transition-colors">
|
|
|
|
|
|
|
+ <!-- 移动端导航 -->
|
|
|
|
|
+ <div class="md:hidden">
|
|
|
|
|
+ <!-- 顶部Logo和菜单按钮 -->
|
|
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
|
|
+ <router-link to="/" class="flex items-center gap-2" @click="rotateLogo">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="w-10 h-10 bg-gradient-to-br from-yellow-400 to-orange-500 rounded-lg flex items-center justify-center border-2 border-[#0A0910]"
|
|
|
|
|
+ :class="{ 'rotate-logo': isLogoRotating }">
|
|
|
|
|
+ <span class="text-white text-lg font-bold">饭</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="text-lg font-black text-dark-800 tracking-wider">
|
|
|
|
|
+ {{ pageTitle }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="text-xs text-gray-600 font-medium">{{ pageSubtitle }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
|
|
+
|
|
|
|
|
+ <LoginButton />
|
|
|
|
|
+ <!-- 移动端设置按钮 -->
|
|
|
|
|
+ <!-- <SettingsButton /> -->
|
|
|
|
|
+ <!-- <button @click="showMobileMenu = !showMobileMenu" class="p-2 bg-gray-100 hover:bg-gray-200 rounded-lg border-2 border-[#0A0910] transition-colors">
|
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
|
|
</svg>
|
|
</svg>
|
|
|
</button> -->
|
|
</button> -->
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 移动端菜单 - 横向滚动标签栏 -->
|
|
|
|
|
- <div v-if="showMobileMenu" class="border-t-2 border-gray-200 pt-3 mt-3">
|
|
|
|
|
- <!-- 横向滚动导航 -->
|
|
|
|
|
- <div class="overflow-x-auto scrollbar-hide">
|
|
|
|
|
- <div class="flex gap-2 pb-2 min-w-max">
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🏠</span>
|
|
|
|
|
- <span>{{ t('navigation.home') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/today-eat"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/today-eat' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🎲</span>
|
|
|
|
|
- <span>{{ t('navigation.todayEat') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/table-design"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/table-design' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🍽️</span>
|
|
|
|
|
- <span>{{ t('navigation.tableDesign') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/sauce-design"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/sauce-design' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🥄</span>
|
|
|
|
|
- <span>{{ t('navigation.sauceDesign') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/fortune-cooking"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/fortune-cooking' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🔮</span>
|
|
|
|
|
- <span>{{ t('navigation.fortuneCooking') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/favorites"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/favorites' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>❤️</span>
|
|
|
|
|
- <span>{{ t('navigation.favorites') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/gallery"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/gallery' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>🖼️</span>
|
|
|
|
|
- <span>{{ t('navigation.gallery') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- <router-link
|
|
|
|
|
- to="/about"
|
|
|
|
|
- @click="showMobileMenu = false"
|
|
|
|
|
- class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
- :class="$route.path === '/about' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'"
|
|
|
|
|
- >
|
|
|
|
|
- <span>📖</span>
|
|
|
|
|
- <span>{{ t('navigation.about') }}</span>
|
|
|
|
|
- </router-link>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <!-- 滚动提示 -->
|
|
|
|
|
- <div class="text-center text-xs text-gray-500 mt-1">{{ t('navigation.scrollHint') }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <!-- 移动端菜单 - 横向滚动标签栏 -->
|
|
|
|
|
+ <div v-if="showMobileMenu" class="border-t-2 border-gray-200 pt-3 mt-3">
|
|
|
|
|
+ <!-- 横向滚动导航 -->
|
|
|
|
|
+ <div class="overflow-x-auto scrollbar-hide">
|
|
|
|
|
+ <div class="flex gap-2 pb-2 min-w-max">
|
|
|
|
|
+ <router-link to="/" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🏠</span>
|
|
|
|
|
+ <span>{{ t('navigation.home') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/today-eat" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/today-eat' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🎲</span>
|
|
|
|
|
+ <span>{{ t('navigation.todayEat') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/table-design" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/table-design' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🍽️</span>
|
|
|
|
|
+ <span>{{ t('navigation.tableDesign') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/sauce-design" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/sauce-design' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🥄</span>
|
|
|
|
|
+ <span>{{ t('navigation.sauceDesign') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/fortune-cooking" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/fortune-cooking' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🔮</span>
|
|
|
|
|
+ <span>{{ t('navigation.fortuneCooking') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/favorites" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/favorites' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>❤️</span>
|
|
|
|
|
+ <span>{{ t('navigation.favorites') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/gallery" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/gallery' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>🖼️</span>
|
|
|
|
|
+ <span>{{ t('navigation.gallery') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
|
|
+ <router-link to="/about" @click="showMobileMenu = false"
|
|
|
|
|
+ class="flex items-center gap-1.5 px-3 py-2 rounded-full font-bold border-2 border-[#0A0910] transition-all duration-200 whitespace-nowrap text-sm"
|
|
|
|
|
+ :class="$route.path === '/about' ? 'bg-yellow-400 text-gray-800 shadow-md' : 'bg-white text-gray-700 hover:bg-gray-50 active:scale-95'">
|
|
|
|
|
+ <span>📖</span>
|
|
|
|
|
+ <span>{{ t('navigation.about') }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 滚动提示 -->
|
|
|
|
|
+ <div class="text-center text-xs text-gray-500 mt-1">{{ t('navigation.scrollHint') }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </nav>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </nav>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -252,102 +204,105 @@ const isLogoRotating = ref(false)
|
|
|
let hideMenuTimer: NodeJS.Timeout | null = null
|
|
let hideMenuTimer: NodeJS.Timeout | null = null
|
|
|
|
|
|
|
|
const rotateLogo = () => {
|
|
const rotateLogo = () => {
|
|
|
- isLogoRotating.value = true
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- isLogoRotating.value = false
|
|
|
|
|
- }, 500)
|
|
|
|
|
|
|
+ isLogoRotating.value = true
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ isLogoRotating.value = false
|
|
|
|
|
+ }, 500)
|
|
|
}
|
|
}
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
// 根据当前路由显示不同的页面标题
|
|
// 根据当前路由显示不同的页面标题
|
|
|
const pageTitle = computed(() => {
|
|
const pageTitle = computed(() => {
|
|
|
- const pathKey = route.path.replace('/', '') || 'home'
|
|
|
|
|
- const key = pathKey.replace(/-([a-z])/g, (g) => g[1].toUpperCase())
|
|
|
|
|
- return t(`navigation.pageTitle.${key}`, t('navigation.pageTitle.home'))
|
|
|
|
|
|
|
+ const pathKey = route.path.replace('/', '') || 'home'
|
|
|
|
|
+ const key = pathKey.replace(/-([a-z])/g, (g) => g[1].toUpperCase())
|
|
|
|
|
+ return t(`navigation.pageTitle.${key}`, t('navigation.pageTitle.home'))
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const pageSubtitle = computed(() => {
|
|
const pageSubtitle = computed(() => {
|
|
|
- const pathKey = route.path.replace('/', '') || 'home'
|
|
|
|
|
- const key = pathKey.replace(/-([a-z])/g, (g) => g[1].toUpperCase())
|
|
|
|
|
- return t(`navigation.pageSubtitle.${key}`, t('navigation.pageSubtitle.default'))
|
|
|
|
|
|
|
+ const pathKey = route.path.replace('/', '') || 'home'
|
|
|
|
|
+ const key = pathKey.replace(/-([a-z])/g, (g) => g[1].toUpperCase())
|
|
|
|
|
+ return t(`navigation.pageSubtitle.${key}`, t('navigation.pageSubtitle.default'))
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 检查更多菜单中的页面是否处于活跃状态
|
|
// 检查更多菜单中的页面是否处于活跃状态
|
|
|
const isMoreMenuActive = computed(() => {
|
|
const isMoreMenuActive = computed(() => {
|
|
|
- return ['/favorites', '/gallery', '/about'].includes(route.path)
|
|
|
|
|
|
|
+ return ['/favorites', '/gallery', '/about'].includes(route.path)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 处理鼠标进入事件
|
|
// 处理鼠标进入事件
|
|
|
const handleMouseEnter = () => {
|
|
const handleMouseEnter = () => {
|
|
|
- if (hideMenuTimer) {
|
|
|
|
|
- clearTimeout(hideMenuTimer)
|
|
|
|
|
- hideMenuTimer = null
|
|
|
|
|
- }
|
|
|
|
|
- showMoreMenu.value = true
|
|
|
|
|
|
|
+ if (hideMenuTimer) {
|
|
|
|
|
+ clearTimeout(hideMenuTimer)
|
|
|
|
|
+ hideMenuTimer = null
|
|
|
|
|
+ }
|
|
|
|
|
+ showMoreMenu.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 处理鼠标离开事件
|
|
// 处理鼠标离开事件
|
|
|
const handleMouseLeave = () => {
|
|
const handleMouseLeave = () => {
|
|
|
- hideMenuTimer = setTimeout(() => {
|
|
|
|
|
- showMoreMenu.value = false
|
|
|
|
|
- }, 150) // 150ms延迟,给用户足够时间移动鼠标
|
|
|
|
|
|
|
+ hideMenuTimer = setTimeout(() => {
|
|
|
|
|
+ showMoreMenu.value = false
|
|
|
|
|
+ }, 150) // 150ms延迟,给用户足够时间移动鼠标
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
/* Logo旋转动画 */
|
|
/* Logo旋转动画 */
|
|
|
@keyframes rotate {
|
|
@keyframes rotate {
|
|
|
- 0% {
|
|
|
|
|
- transform: rotate(0deg);
|
|
|
|
|
- }
|
|
|
|
|
- 100% {
|
|
|
|
|
- transform: rotate(360deg);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 0% {
|
|
|
|
|
+ transform: rotate(0deg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ 100% {
|
|
|
|
|
+ transform: rotate(360deg);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.rotate-logo {
|
|
.rotate-logo {
|
|
|
- animation: rotate 0.5s ease-out;
|
|
|
|
|
|
|
+ animation: rotate 0.5s ease-out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 移动端菜单展开动画 */
|
|
/* 移动端菜单展开动画 */
|
|
|
@keyframes slideDown {
|
|
@keyframes slideDown {
|
|
|
- from {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- transform: translateY(-10px);
|
|
|
|
|
- }
|
|
|
|
|
- to {
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- transform: translateY(0);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ from {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(-10px);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ to {
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ transform: translateY(0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.flex {
|
|
.flex {
|
|
|
- animation: slideDown 0.3s ease-out;
|
|
|
|
|
|
|
+ animation: slideDown 0.3s ease-out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 下拉菜单动画 */
|
|
/* 下拉菜单动画 */
|
|
|
@keyframes dropDown {
|
|
@keyframes dropDown {
|
|
|
- from {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- transform: translateY(-10px);
|
|
|
|
|
- }
|
|
|
|
|
- to {
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- transform: translateY(0);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ from {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(-10px);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ to {
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ transform: translateY(0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.absolute {
|
|
.absolute {
|
|
|
- animation: dropDown 0.2s ease-out;
|
|
|
|
|
|
|
+ animation: dropDown 0.2s ease-out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 隐藏滚动条 */
|
|
/* 隐藏滚动条 */
|
|
|
.scrollbar-hide {
|
|
.scrollbar-hide {
|
|
|
- -ms-overflow-style: none;
|
|
|
|
|
- scrollbar-width: none;
|
|
|
|
|
|
|
+ -ms-overflow-style: none;
|
|
|
|
|
+ scrollbar-width: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.scrollbar-hide::-webkit-scrollbar {
|
|
.scrollbar-hide::-webkit-scrollbar {
|
|
|
- display: none;
|
|
|
|
|
|
|
+ display: none;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|