Skip to content

Commit

Permalink
fix : dropDown overflow
Browse files Browse the repository at this point in the history
- RWD till 750px
  • Loading branch information
jason810496 committed Jan 14, 2024
1 parent dae3969 commit d6b4bdf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
22 changes: 12 additions & 10 deletions src/components/DropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
</div>

<!-- multi links -->
<button
v-if="linkList.length > 1"
class="group hover:mt-4"
type="button"
>
<div class="flex justify-center lg:gap-x-2 md:gap-x-1">
<button v-if="linkList.length > 1" class="group lg:hover:mt-4 md:hover:mt-[18px] hover:mt-[20px]" type="button">
<div
class="flex justify-center lg:gap-x-2 md:gap-x-1"
:class="{ 'lg:px-[9px] md:px-[6px] px-4': hasLongWord(linkList) }"
>
<span
class="font-bold text-sm lg:text-xl md:text-base"
:class="{
Expand Down Expand Up @@ -54,10 +53,9 @@
v-for="link in linkList"
:key="link.name"
:href="link.link"
class="block px-1 py-2 text-xs lg:text-sm text-white hover:bg-primary-50 hover:rounded-sm hover:text-primary-900"
class="block px-1 py-2 lg:text-sm text-[11px] text-white hover:bg-primary-50 hover:rounded-sm hover:text-primary-900"
:class="{
'bg-transparent hover:rounded-m':
theme === 'light',
'bg-transparent hover:rounded-m': theme === 'light',
}"
@click="handleLinkClick(link)"
>
Expand Down Expand Up @@ -92,10 +90,14 @@ const props = defineProps({
});
const { theme, title, linkList } = toRefs(props);
const hasLongWord = (linkList) => {
return linkList.some((link) => link.name.length > 5);
};
</script>

<style scoped>
.dark-content {
color: #404040;
}
</style>
</style>
40 changes: 21 additions & 19 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
}"
>
<nav class="flex justify-center xl:gap-28 lg:gap-8 gap-3">
<a class="flex flex-col justify-center" href="/">
<img
:src="theme == 'light' ? '/logo.svg' : '/logo-dark.svg'"
alt="logo"
class="block xl:w-44 lg:w-36 md:w-28 w-24 cursor-pointer"
@click=""
/>
</a>
<a class="flex flex-col justify-center" href="/">
<img
:src="theme == 'light' ? '/logo.svg' : '/logo-dark.svg'"
alt="logo"
class="block xl:w-44 lg:w-36 md:w-28 w-24 cursor-pointer"
@click=""
/>
</a>

<div class="flex xl:gap-7 lg:gap-3 gap-2">
<template v-for="item in navBarList">
Expand All @@ -25,17 +25,19 @@
</template>
</div>

<a
href="/signup"
class="block text-center font-bold bg-primary-900 rounded-full lg:h-14 lg:w-36 lg:text-xl md:h-10 md:w-24 h-8 w-20"
>
<div class="flex flex-col justify-center h-full">
<span
class="text-bold text-primary-50 text-sm lg:text-xl md:text-base"
>即刻報名</span
>
</div>
</a>
<div class="flex flex-col justify-center">
<a
href="/signup"
class="block text-center font-bold bg-primary-900 rounded-full lg:h-14 lg:w-36 lg:text-xl md:h-10 md:w-24 h-8 w-20"
>
<div class="flex flex-col justify-center h-full">
<span
class="text-bold text-primary-50 text-sm lg:text-xl md:text-base"
>即刻報名</span
>
</div>
</a>
</div>
</nav>
</div>
</template>
Expand Down

0 comments on commit d6b4bdf

Please sign in to comment.