mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Clean the awful code.
This commit is contained in:
parent
98ffbec764
commit
569cd087e7
15 changed files with 193 additions and 167 deletions
|
@ -13,7 +13,6 @@ const availableLocales = computed(() => {
|
|||
const toggleDropdown = () => {
|
||||
dropdownOpen.value = !dropdownOpen.value;
|
||||
};
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<!--Spent too much time trying to set a Navbar....-->
|
||||
|
@ -23,7 +22,9 @@ const toggleDropdown = () => {
|
|||
<div class="text-3xl text-bold">
|
||||
<NuxtLink :to="localePath('home')" ref="title">BlindSpec</NuxtLink>
|
||||
</div>
|
||||
<div class="text-[0.9em] left-1/2 absolute transform -translate-x-1/2 space-x-4 items-center">
|
||||
<div
|
||||
class="text-[0.9em] left-1/2 absolute transform -translate-x-1/2 space-x-4 items-center"
|
||||
>
|
||||
<NuxtLink
|
||||
:to="localePath('/home')"
|
||||
class="hover:text-blue-500 cursor-pointer transiton-all duration-100"
|
||||
|
@ -37,58 +38,60 @@ const toggleDropdown = () => {
|
|||
>
|
||||
</div>
|
||||
<div class="flex flex-row align-center justify-center text-center">
|
||||
<div class="relative ml-0">
|
||||
<button
|
||||
@click="toggleDropdown"
|
||||
class="flex items-center space-x-1 px-4 py-2 rounded hover:bg-gray-900 transition-all duration-100 mr-5"
|
||||
>
|
||||
<span>{{ locale }}</span>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
<div class="relative ml-0">
|
||||
<button
|
||||
@click="toggleDropdown"
|
||||
class="flex items-center space-x-1 px-4 py-2 rounded hover:bg-gray-900 transition-all duration-100 mr-5"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M19 9l-7 7-7-7"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<Transition
|
||||
enter-active-class="animate__animated animate__fadeInDown animate_fastest"
|
||||
leave-active-class="animate__animated animate__fadeOutUp animate_fastest"
|
||||
>
|
||||
<div
|
||||
v-if="dropdownOpen"
|
||||
class="absolute top-full right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1"
|
||||
>
|
||||
<a
|
||||
v-for="loc in availableLocales"
|
||||
:key="loc.code"
|
||||
:href="switchLocalePath(loc.code)"
|
||||
v-on:click="dropdownOpen = false"
|
||||
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-all duration-100"
|
||||
<span>{{ locale }}</span>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
{{ loc.name || loc.code }}
|
||||
</a>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
<div class="mr-2 ml-0">
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M19 9l-7 7-7-7"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<Transition
|
||||
enter-active-class="animate__animated animate__fadeInDown animate_fastest"
|
||||
leave-active-class="animate__animated animate__fadeOutUp animate_fastest"
|
||||
>
|
||||
<div
|
||||
v-if="dropdownOpen"
|
||||
class="absolute top-full right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1"
|
||||
>
|
||||
<a
|
||||
v-for="loc in availableLocales"
|
||||
:key="loc.code"
|
||||
:href="switchLocalePath(loc.code)"
|
||||
v-on:click="dropdownOpen = false"
|
||||
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-all duration-100"
|
||||
>
|
||||
{{ loc.name || loc.code }}
|
||||
</a>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
<div class="mr-2 ml-0">
|
||||
<NuxtLink :to="localePath('/system/login')">
|
||||
<button class="text-white hover:text-[#C6C6C6] transition-all duration-150">
|
||||
<button
|
||||
class="text-white hover:text-[#C6C6C6] transition-all duration-150"
|
||||
>
|
||||
<i class="bi bi-person text-3xl"></i>
|
||||
</button>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.animate_fastest {
|
||||
--animate-duration: 0.2s;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue