11<template >
2- <div class =" brand-header" @click = " toggleCollapse " >
2+ <div class =" brand-header" >
33 <span >倾情赞助</span >
4- <span class =" toggle-icon" >
5- <Icon v-if =" isCollapsed" name =" iconamoon:arrow-right-2" />
6- <Icon v-else name =" iconamoon:arrow-down-2" />
7- </span >
84 </div >
95 <div class =" brand-container" >
106 <div class =" gold-sponsors" >
117 <div
128 v-for =" brand in goldSponsors"
139 v-show =" shouldShowSponsor(brand)"
14- :class =" { 'collapsed-mode': isCollapsed }"
1510 class =" brand-item gold"
1611 @click =" openSponsorLink(brand.href, '_blank')"
1712 >
18- <img v-if =" !isCollapsed" :alt =" brand.alt" :src =" brand.link" class =" brand-image" />
19- <span v-else class =" brand-text collapsed-text" >
20- {{ brand.alt }}
21- </span >
13+ <img :alt =" brand.alt" :src =" brand.link" class =" brand-image" />
2214 </div >
2315 </div >
2416 <div class =" general-sponsors" >
2517 <div
2618 v-for =" brand in generalSponsors"
2719 v-show =" shouldShowSponsor(brand)"
28- :class =" { 'collapsed-mode': isCollapsed }"
2920 class =" brand-item"
3021 @click =" openSponsorLink(brand.href, '_blank')"
3122 >
32- <img v-if =" !isCollapsed" :alt =" brand.alt" :src =" brand.link" class =" brand-image" />
33- <span v-else class =" brand-text collapsed-text" >
34- {{ brand.alt }}
35- </span >
23+ <img :alt =" brand.alt" :src =" brand.link" class =" brand-image" />
3624 </div >
3725 </div >
3826 <div
@@ -54,26 +42,11 @@ import {
5442 shouldShowSponsor ,
5543 sponsorUrl
5644} from " ../data/sponsors" ;
57- import { useStorage } from " @vueuse/core" ;
58-
59- const isCollapsed = useStorage (' fba-docs-sponsor-collapsed' , false );
6045
6146const shouldShowExtraBecomeSponsor = computed (() => {
6247 return (goldSponsors .filter (brand => shouldShowSponsor (brand)).length +
6348 generalSponsors .filter (brand => shouldShowSponsor (brand)).length ) < 9 ;
6449});
65-
66- const toggleCollapse = () => {
67- isCollapsed .value = ! isCollapsed .value ;
68- };
69-
70- const brandItemGoldHeight = computed (() => {
71- return isCollapsed .value ? ' 32px' : ' 96px'
72- })
73-
74- const brandItemHeight = computed (() => {
75- return isCollapsed .value ? ' 32px' : ' 66px'
76- })
7750 </script >
7851
7952<style scoped>
@@ -87,12 +60,6 @@ const brandItemHeight = computed(() => {
8760 margin : 3px 0 2px ;
8861}
8962
90- .toggle-icon {
91- font-size : 10px ;
92- transform : scale (1.2 );
93- opacity : 0.7 ;
94- }
95-
9663.brand-container {
9764 display : flex ;
9865 flex-direction : column ;
@@ -117,7 +84,7 @@ const brandItemHeight = computed(() => {
11784 display : flex ;
11885 align-items : center ;
11986 justify-content : center ;
120- height : v-bind(brandItemHeight) ;
87+ height : 66 px ;
12188 transition : all 0.3s ease ;
12289 position : relative ;
12390}
@@ -127,7 +94,7 @@ const brandItemHeight = computed(() => {
12794}
12895
12996.brand-item.gold {
130- height : v-bind(brandItemGoldHeight) ;
97+ height : 96 px ;
13198}
13299
133100.brand-image {
@@ -152,24 +119,6 @@ const brandItemHeight = computed(() => {
152119 font-size : 13px ;
153120}
154121
155- .collapsed-mode {
156- height : 32px !important ;
157- }
158-
159- .collapsed-mode .brand-image {
160- opacity : 0 ;
161- }
162-
163- .collapsed-text {
164- color : var (--vp-c-brand-1 ) !important ;
165- font-weight : 600 ;
166- transform : scale (1.05 );
167- }
168-
169- .collapsed-mode :hover .collapsed-text {
170- color : var (--vp-c-text-1 ) !important ;
171- }
172-
173122.become-brand {
174123 height : 32px ;
175124 background-color : unset ;
0 commit comments