国外MOSE官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
12 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <script setup lang="ts">
  2. import { ref, computed } from 'vue';
  3. import { useI18n } from 'vue-i18n';
  4. const { t, locale } = useI18n();
  5. const isMenuOpen = ref(false);
  6. // 切换菜单
  7. const toggleMenu = () => {
  8. isMenuOpen.value = !isMenuOpen.value;
  9. };
  10. // 切换语言
  11. const changeLanguage = (lang: string) => {
  12. emit('changeLanguage', lang);
  13. };
  14. // 语言选项
  15. const languages = [
  16. { code: 'en', name: t('language.en') },
  17. { code: 'zh', name: t('language.zh') },
  18. { code: 'ja', name: t('language.ja') },
  19. { code: 'ar', name: t('language.ar') },
  20. { code: 'fr', name: t('language.fr') },
  21. { code: 'ko', name: t('language.ko') },
  22. { code: 'ms', name: t('language.ms') },
  23. { code: 'pt', name: t('language.pt') },
  24. { code: 'ru', name: t('language.ru') },
  25. { code: 'th', name: t('language.th') },
  26. { code: 'vi', name: t('language.vi') },
  27. ];
  28. // 当前语言
  29. const currentLanguage = computed(() => {
  30. return languages.find(lang => lang.code === locale.value)?.name || t('language.en');
  31. });
  32. // 语言下拉菜单
  33. const isLangDropdownOpen = ref(false);
  34. const toggleLangDropdown = () => {
  35. isLangDropdownOpen.value = !isLangDropdownOpen.value;
  36. };
  37. // 定义emit
  38. const emit = defineEmits(['changeLanguage']);
  39. </script>
  40. <template>
  41. <header class="bg-background-dark text-text py-4 px-6 md:px-12 lg:px-24 fixed w-full z-50">
  42. <div class="container mx-auto flex justify-between items-center">
  43. <!-- Logo -->
  44. <router-link to="/" class="flex items-center animate__animated animate__fadeIn animate__duration-fast">
  45. <img src="/public/real_logo.png" alt="MOSE Logo" class="h-8 w-auto mr-2" />
  46. <!-- <span class="text-xl font-bold text-primary-light">MOSE</span> -->
  47. </router-link>
  48. <!-- Desktop Navigation -->
  49. <nav class="hidden md:flex items-center space-x-6">
  50. <!-- 首页 -->
  51. <router-link
  52. to="/"
  53. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast"
  54. :class="{ 'text-primary-light font-medium': $route.path === '/' }"
  55. >
  56. {{ t('nav.home') }}
  57. </router-link>
  58. <!-- 生态系统 -->
  59. <router-link
  60. to="/ecosystem"
  61. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-xs"
  62. :class="{ 'text-primary-light font-medium': $route.path === '/ecosystem' }"
  63. >
  64. {{ t('nav.ecosystem') }}
  65. </router-link>
  66. <!-- 技术 -->
  67. <router-link
  68. to="/technology"
  69. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-sm"
  70. :class="{ 'text-primary-light font-medium': $route.path === '/technology' }"
  71. >
  72. {{ t('nav.technology') }}
  73. </router-link>
  74. <!-- 关于我们 -->
  75. <router-link
  76. to="/about"
  77. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-sm"
  78. :class="{ 'text-primary-light font-medium': $route.path === '/about' }"
  79. >
  80. {{ t('nav.about') }}
  81. </router-link>
  82. <!-- 社区 -->
  83. <router-link
  84. to="/community"
  85. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-lg"
  86. :class="{ 'text-primary-light font-medium': $route.path === '/community' }"
  87. >
  88. {{ t('nav.community') }}
  89. </router-link>
  90. <!-- 常见问题 -->
  91. <router-link
  92. to="/faq"
  93. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-lg"
  94. :class="{ 'text-primary-light font-medium': $route.path === '/faq' }"
  95. >
  96. {{ t('nav.faq') }}
  97. </router-link>
  98. <!-- 联系我们 -->
  99. <router-link
  100. to="/contact"
  101. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-lg"
  102. :class="{ 'text-primary-light font-medium': $route.path === '/contact' }"
  103. >
  104. {{ t('nav.contact') }}
  105. </router-link>
  106. <!-- 动画演示 -->
  107. <!-- <router-link
  108. to="/animations"
  109. class="text-text-secondary hover:text-text transition-colors duration-200 animate__animated animate__fadeInDown animate__duration-fast animate__delay-lg"
  110. :class="{ 'text-primary-light font-medium': $route.path === '/animations' }"
  111. >
  112. 动画演示
  113. </router-link> -->
  114. <!-- Language Selector -->
  115. <div class="relative animate__animated animate__fadeInDown animate__delay-lg animate__duration-fast">
  116. <button
  117. @click="toggleLangDropdown"
  118. class="flex items-center text-text-secondary hover:text-text"
  119. >
  120. {{ currentLanguage }}
  121. <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  122. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
  123. </svg>
  124. </button>
  125. <div
  126. v-show="isLangDropdownOpen"
  127. class="absolute right-0 mt-2 w-40 bg-background-light rounded-md shadow-lg py-1 z-10 animate__animated animate__fadeIn animate__duration-very-fast"
  128. >
  129. <button
  130. v-for="lang in languages"
  131. :key="lang.code"
  132. @click="changeLanguage(lang.code); toggleLangDropdown()"
  133. class="block w-full text-left px-4 py-2 text-text-secondary hover:bg-background hover:text-text"
  134. :class="{ 'text-primary-light': locale === lang.code }"
  135. >
  136. {{ lang.name }}
  137. </button>
  138. </div>
  139. </div>
  140. </nav>
  141. <!-- Mobile Menu Button -->
  142. <button
  143. @click="toggleMenu"
  144. class="md:hidden text-text-secondary hover:text-text focus:outline-none animate__animated animate__fadeIn animate__duration-fast"
  145. >
  146. <svg
  147. xmlns="http://www.w3.org/2000/svg"
  148. class="h-6 w-6"
  149. fill="none"
  150. viewBox="0 0 24 24"
  151. stroke="currentColor"
  152. >
  153. <path
  154. v-if="!isMenuOpen"
  155. stroke-linecap="round"
  156. stroke-linejoin="round"
  157. stroke-width="2"
  158. d="M4 6h16M4 12h16M4 18h16"
  159. />
  160. <path
  161. v-else
  162. stroke-linecap="round"
  163. stroke-linejoin="round"
  164. stroke-width="2"
  165. d="M6 18L18 6M6 6l12 12"
  166. />
  167. </svg>
  168. </button>
  169. </div>
  170. <!-- Mobile Menu -->
  171. <div
  172. v-show="isMenuOpen"
  173. class="md:hidden bg-background-light mt-4 rounded-lg py-4 px-6 shadow-lg animate__animated animate__duration-fast"
  174. :class="{'animate__fadeIn': isMenuOpen, 'animate__fadeOut': !isMenuOpen}"
  175. >
  176. <div class="flex flex-col space-y-4">
  177. <!-- 首页 -->
  178. <router-link
  179. to="/"
  180. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast"
  181. :class="{ 'text-primary-light font-medium': $route.path === '/' }"
  182. @click="isMenuOpen = false"
  183. >
  184. {{ t('nav.home') }}
  185. </router-link>
  186. <!-- 生态系统 -->
  187. <router-link
  188. to="/ecosystem"
  189. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-xs"
  190. :class="{ 'text-primary-light font-medium': $route.path === '/ecosystem' }"
  191. @click="isMenuOpen = false"
  192. >
  193. {{ t('nav.ecosystem') }}
  194. </router-link>
  195. <!-- 技术 -->
  196. <router-link
  197. to="/technology"
  198. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-sm"
  199. :class="{ 'text-primary-light font-medium': $route.path === '/technology' }"
  200. @click="isMenuOpen = false"
  201. >
  202. {{ t('nav.technology') }}
  203. </router-link>
  204. <!-- 关于我们 -->
  205. <router-link
  206. to="/about"
  207. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-sm"
  208. :class="{ 'text-primary-light font-medium': $route.path === '/about' }"
  209. @click="isMenuOpen = false"
  210. >
  211. {{ t('nav.about') }}
  212. </router-link>
  213. <!-- 社区 -->
  214. <router-link
  215. to="/community"
  216. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-md"
  217. :class="{ 'text-primary-light font-medium': $route.path === '/community' }"
  218. @click="isMenuOpen = false"
  219. >
  220. {{ t('nav.community') }}
  221. </router-link>
  222. <!-- 常见问题 -->
  223. <router-link
  224. to="/faq"
  225. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-lg"
  226. :class="{ 'text-primary-light font-medium': $route.path === '/faq' }"
  227. @click="isMenuOpen = false"
  228. >
  229. {{ t('nav.faq') }}
  230. </router-link>
  231. <!-- 联系我们 -->
  232. <router-link
  233. to="/contact"
  234. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-lg"
  235. :class="{ 'text-primary-light font-medium': $route.path === '/contact' }"
  236. @click="isMenuOpen = false"
  237. >
  238. {{ t('nav.contact') }}
  239. </router-link>
  240. <!-- 动画演示 -->
  241. <!-- <router-link
  242. to="/animations"
  243. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-lg"
  244. :class="{ 'text-primary-light font-medium': $route.path === '/animations' }"
  245. @click="isMenuOpen = false"
  246. >
  247. 动画演示
  248. </router-link> -->
  249. <!-- 翻译工具 -->
  250. <!-- <router-link
  251. to="/translate"
  252. class="text-text-secondary hover:text-text py-2 animate__animated animate__fadeInRight animate__duration-fast animate__delay-lg"
  253. :class="{ 'text-primary-light font-medium': $route.path === '/translate' }"
  254. @click="isMenuOpen = false"
  255. >
  256. 翻译工具
  257. </router-link> -->
  258. <!-- Mobile Language Selector -->
  259. <div class="py-2 border-t border-background animate__animated animate__fadeInUp animate__delay-lg animate__duration-fast">
  260. <!-- <p class="text-text-secondary mb-2">{{ t('language.en') }}</p> -->
  261. <div class="flex flex-col space-y-2">
  262. <button
  263. v-for="lang in languages"
  264. :key="lang.code"
  265. @click="changeLanguage(lang.code); isMenuOpen = false"
  266. class="text-left text-text-secondary hover:text-text"
  267. :class="{ 'text-primary-light': locale === lang.code }"
  268. >
  269. {{ lang.name }}
  270. </button>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </header>
  276. <!-- Spacer to prevent content from hiding under fixed header -->
  277. <div class="h-16"></div>
  278. </template>