@@ -11,7 +11,9 @@ const { data: block } = useAsyncData(`wall-of-love-${props.uuid}`, () =>
1111 ' heading' ,
1212 {
1313 testimonials: [
14- { testimonials_id: [' id' , ' company' , ' name' , ' role' , ' quote' , ' logo' , ' avatar' , ' avatar_url' ] },
14+ {
15+ testimonials_id: [' id' , ' company' , ' name' , ' role' , ' quote' , ' logo' , ' avatar' , ' avatar_url' , ' card_width' ],
16+ },
1517 ],
1618 },
1719 ],
@@ -27,18 +29,30 @@ const displayedTestimonials = computed(() => {
2729
2830const toggleShowAll = () => {
2931 showAll .value = ! showAll .value ;
32+
33+ if (! showAll .value ) {
34+ const wallOfLoveElement = document .querySelector (' .wall-of-love' );
35+
36+ if (wallOfLoveElement ) {
37+ wallOfLoveElement .scrollIntoView ({ behavior: ' smooth' , block: ' start' });
38+ }
39+ }
3040};
3141 </script >
3242
3343<template >
3444 <div v-if =" block" class =" wall-of-love" >
3545 <h2 class =" wall-heading" >{{ block.heading }}</h2 >
36- <div class =" testimonial-container" >
46+ <div class =" testimonial-container" :class = " { expanded: showAll } " >
3747 <BlockWallOfLoveTestimonial
3848 v-for =" testimonial in displayedTestimonials"
3949 :key =" testimonial.testimonials_id.id"
4050 :testimonial-data =" testimonial.testimonials_id"
41- class =" testimonial-item"
51+ :class =" [
52+ 'testimonial-item',
53+ `size-${testimonial.testimonials_id.card_width || 'flexible'}`,
54+ testimonial.testimonials_id.quote.length > 400 ? 'long-quote' : '',
55+ ]"
4256 />
4357 <!-- Fading effect -->
4458 <div v-if =" !showAll && block.testimonials && block.testimonials.length > 6" class =" fade-out" ></div >
@@ -68,7 +82,6 @@ const toggleShowAll = () => {
6882 .wall-heading {
6983 color : var (--gray-500 );
7084 font-size : var (--font-size-2xl );
71- font-style : normal ;
7285 font-weight : 600 ;
7386 line-height : var (--line-height-2xl );
7487 }
@@ -81,37 +94,118 @@ const toggleShowAll = () => {
8194 justify-content : center ;
8295 width : 100% ;
8396 position : relative ;
97+ align-items : stretch ;
98+ max-height : calc (2 * 300px + var (--space-4 ) / 2 );
99+ overflow : hidden ;
100+ transition : max-height 0.3s ease ;
101+
102+ & .expanded {
103+ max-height : none ;
104+ overflow : visible ;
105+ }
106+
107+ .fade-out {
108+ position : absolute ;
109+ bottom : 0 ;
110+ left : 0 ;
111+ width : 100% ;
112+ height : 100px ; /* Height of the fade effect */
113+ background : linear-gradient (to bottom , transparent , rgba (255 , 255 , 255 , 0.9 ));
114+ pointer-events : none ;
115+ z-index : 1 ;
116+ }
84117 }
85118
86119 .testimonial-item {
87- flex : 1 1 calc ( 33.333 % - 16 px ) ;
120+ display : flex ;
88121 min-width : 300px ;
122+ flex-direction : column ;
123+ justify-content : space-between ;
124+ width : 100% ;
125+ height : auto ; /* Ensure cards maintain their height */
89126 box-sizing : border-box ;
127+ padding : var (--space-8 ); /* Restore proper padding inside the cards */
128+ background : var (--background ); /* Ensure cards have background */
129+ border : 1px solid var (--gray-200 );
130+ border-radius : var (--rounded-xl );
131+
132+ & p {
133+ font-family : var (--family-display ) !important ;
134+ }
135+
136+ & .size-small {
137+ flex : 1 1 calc (20% - 16px );
138+ }
139+
140+ & .size-medium {
141+ flex : 1 1 calc (30% - 16px );
142+ }
143+
144+ & .size-large {
145+ flex : 1 1 calc (40% - 16px );
146+ }
147+
148+ & .size-flexible {
149+ flex : 1 1 calc (33.333% - 16px );
150+ }
151+
152+ & .long-quote {
153+ flex : 1 1 calc (60% - 16px );
154+ }
155+
156+ .footer {
157+ display : flex ;
158+ align-items : center ;
159+ justify-content : space-between ;
160+ gap : var (--space-2 );
161+ margin-top : var (--space-4 );
162+
163+ .company-logo {
164+ max-height : 40px ;
165+ max-width : 120px ;
166+ width : auto ;
167+
168+ @media (max-width : 480px ) {
169+ max-height : 30px ;
170+ max-width : 100px ;
171+ }
172+ }
173+
174+ .stars {
175+ display : flex ;
176+ gap : var (--space-1 );
177+
178+ .star-icon {
179+ width : 16px ;
180+ height : 16px ;
181+
182+ @media (max-width : 480px ) {
183+ width : 14px ;
184+ height : 14px ;
185+ }
186+ }
187+ }
188+ }
90189 }
91190
191+ /* Tablet adjustments */
92192 @media (max-width : 768px ) {
93193 .testimonial-item {
94194 flex : 1 1 calc (50% - 16px );
95195 }
196+
197+ .testimonial-item.long-quote {
198+ flex : 1 1 calc (100% - 16px );
199+ }
96200 }
97201
202+ /* Mobile adjustments */
98203 @media (max-width : 480px ) {
99204 .testimonial-item {
100205 flex : 1 1 100% ;
101206 }
102207 }
103208
104- .fade-out {
105- position : absolute ;
106- bottom : 0 ;
107- left : 0 ;
108- width : 100% ;
109- height : 450px ;
110- background : linear-gradient (to bottom , transparent , rgba (255 , 255 , 255 , 0.9 ));
111- pointer-events : none ;
112- z-index : 1 ;
113- }
114-
115209 .see-more-button {
116210 margin : var (--space-4 ) auto ;
117211 align-self : center ;
0 commit comments