2026-05-02 08:26:18 +12:00
< script lang = "ts" >
import { onMount } from 'svelte' ;
import { reveal } from '$lib/actions/reveal' ;
import Icon from '$lib/components/Icon.svelte' ;
2026-05-02 19:44:45 +12:00
import { getImageMetadata } from '$lib/image-metadata' ;
2026-05-02 08:26:18 +12:00
import type { TestimonialContent } from '$lib/types' ;
export let testimonials : TestimonialContent [];
2026-05-07 21:47:42 +12:00
export let eyebrow = '30+ five-star reviews' ;
export let heading = 'Proof your dog is in good hands' ;
export let blurb = 'Peace of mind for busy Auckland dog owners. Happier dogs, smoother routines, and a team owners trust with the important stuff.' ;
2026-05-02 08:26:18 +12:00
export let instagramHref = 'https://www.instagram.com/goodwalk.nz/' ;
2026-05-03 11:16:53 +12:00
export let instagramLabel = 'goodwalk.nz' ;
2026-05-02 08:26:18 +12:00
type TestimonialSlide = TestimonialContent & { imageUrl : string };
const wordpressTestimonials : Record < string , TestimonialSlide > = {
Kate : {
reviewer : 'Kate' ,
detail : "Archie's mum" ,
quote :
'Love Aless! She is so amazing with my slightly hyper and anxious dog. She is great with communication if anything on either of our ends need to change. Archie love his walks, and I love the photos she posts of him.' ,
imageUrl : '/images/archie-auckland-dog-walking-review.png'
},
Estelle : {
reviewer : 'Estelle' ,
detail : "Monty's mum" ,
quote :
'GoodWalk was the best dog walking service for my little pooch ! Aless was very helpful - basically doubled as a second mum to Monty. She always provided feedback on his outings and assisted where possible with any additional training that she felt he could work on and made recommendations where necessary which i feel is what every dog mum wants and needs!' ,
imageUrl : '/images/monty-auckland-dog-walking-review.png'
},
Ross : {
reviewer : 'Ross' ,
2026-05-07 21:47:42 +12:00
detail : "Otis's dad" ,
2026-05-02 08:26:18 +12:00
quote :
'Truly the best dog walker in Auckland! I feel so lucky to have found Aless and my little terrier Otis absolutely adores her. He enjoys his regular weekly walks and always comes back happy & tired. Love the updates on social media so I can see how my dog is enjoying his day! Aless makes logistics so easy too. Highly highly recommend, there’ s a reason she has 5 stars!' ,
imageUrl : '/images/otis-auckland-dog-walking-review.png'
},
Nina : {
reviewer : 'Nina' ,
detail : "Wallace's mum" ,
quote :
'Alessandra has been walking and spending time with my pup since she was 10 weeks old, coming over and doing puppy visits through to transitioning her to pack walks with her little doggo friends. I know Alassandra loves and cares for my dog as much as I do and my dog has a great time! Cant recommend enough' ,
imageUrl : '/images/wallace-auckland-dog-walking-review.png'
}
};
let activeIndex = 0 ;
let paused = false ;
2026-05-03 11:49:59 +12:00
let inView = false ;
let prefersReducedMotion = false ;
let carouselEl : HTMLDivElement | undefined ;
2026-05-02 08:26:18 +12:00
$ : slides = testimonials
. map (( testimonial ) => wordpressTestimonials [ testimonial . reviewer ] ?? testimonial )
. filter (( testimonial ) : testimonial is TestimonialSlide => Boolean ( testimonial . imageUrl ));
$ : if ( activeIndex >= slides . length ) {
activeIndex = 0 ;
}
2026-05-05 08:12:36 +12:00
function dogNameFromDetail ( detail : string ) {
const match = detail . match ( /^([^'’ ]+)/ );
return match ? match [ 1 ]. trim () : '' ;
}
function testimonialAlt ( testimonial : TestimonialSlide ) {
const dog = dogNameFromDetail ( testimonial . detail );
return dog
? ` ${ dog } , a happy Goodwalk dog walking client in Auckland`
: ` ${ testimonial . reviewer } 's dog after a Goodwalk Auckland dog walk` ;
}
2026-05-02 08:26:18 +12:00
function showPrevious() {
if ( ! slides . length ) {
return ;
}
activeIndex = ( activeIndex - 1 + slides . length ) % slides . length ;
}
function showNext() {
if ( ! slides . length ) {
return ;
}
activeIndex = ( activeIndex + 1 ) % slides . length ;
}
onMount (() => {
2026-05-03 11:49:59 +12:00
const motionQuery = window . matchMedia ( '(prefers-reduced-motion: reduce)' );
prefersReducedMotion = motionQuery . matches ;
const onMotionChange = ( event : MediaQueryListEvent ) => {
prefersReducedMotion = event . matches ;
};
motionQuery . addEventListener ( 'change' , onMotionChange );
const observer = carouselEl
? new IntersectionObserver (
([ entry ]) => {
inView = entry . isIntersecting ;
},
{ threshold : 0.25 }
)
: null ;
if ( observer && carouselEl ) {
observer . observe ( carouselEl );
}
2026-05-02 08:26:18 +12:00
const interval = window . setInterval (() => {
2026-05-03 11:49:59 +12:00
if ( ! paused && ! prefersReducedMotion && inView && slides . length > 1 ) {
2026-05-02 08:26:18 +12:00
showNext ();
}
2026-05-03 11:49:59 +12:00
}, 9000 );
2026-05-02 08:26:18 +12:00
2026-05-03 11:49:59 +12:00
return () => {
window . clearInterval ( interval );
motionQuery . removeEventListener ( 'change' , onMotionChange );
observer ? . disconnect ();
};
2026-05-02 08:26:18 +12:00
});
</ script >
< section id = "testimonials" use:reveal = {{ delay : 40 }} class="reveal-block" >
< div class = "testimonials-inner" >
2026-05-07 21:47:42 +12:00
< span class = "testimonials-eyebrow" > { eyebrow } </ span >
2026-05-02 08:26:18 +12:00
< h2 class = "section-heading" > { heading } </ h2 >
< div class = "testimonials-intro" >
< p > { blurb } </ p >
</ div >
{ #if slides . length }
< div
2026-05-03 11:49:59 +12:00
bind:this = { carouselEl }
2026-05-02 08:26:18 +12:00
class="testimonials-carousel"
role = "region"
aria-label = "Customer testimonials"
on:mouseenter = {() => ( paused = true )}
on:mouseleave= {() => ( paused = false )}
2026-05-03 11:49:59 +12:00
on:focusin = {() => ( paused = true )}
on:focusout= {() => ( paused = false )}
2026-05-02 08:26:18 +12:00
>
< button
class = "testimonial-arrow testimonial-arrow-left"
type = "button"
aria-label = "Previous testimonial"
on:click = { showPrevious }
>
< Icon name = "fas fa-chevron-left" />
</ button >
< div class = "testimonial-stage" >
< div class = "testimonial-woof" aria-hidden = "true" >
< span class = "testimonial-woof-text" > WOOF</ span >
< span class = "testimonial-ray testimonial-ray-1" ></ span >
< span class = "testimonial-ray testimonial-ray-2" ></ span >
< span class = "testimonial-ray testimonial-ray-3" ></ span >
</ div >
{ #each slides as testimonial , index }
< article class:testimonial-slide-active = { index === activeIndex } class="testimonial-slide" >
< div class = "testimonial-photo-wrap" >
< div class = "testimonial-photo-frame" >
{ #if index === activeIndex }
2026-05-02 19:44:45 +12:00
{ @const imageMeta = getImageMetadata ( testimonial . imageUrl )}
2026-05-02 08:26:18 +12:00
< img
class = "testimonial-photo"
src = { testimonial . imageUrl }
2026-05-05 08:12:36 +12:00
alt= { testimonialAlt ( testimonial )}
2026-05-02 19:44:45 +12:00
width = { imageMeta ? . width }
height= { imageMeta ? . height }
loading = "lazy"
2026-05-02 08:26:18 +12:00
decoding = "async"
/>
{ /if }
</ div >
</ div >
< div class = "testimonial-copy" >
< span class = "testimonial-quote-mark" > "</ span >
2026-05-03 11:49:59 +12:00
< blockquote class = "testimonial-quote" > { testimonial . quote } </ blockquote >
2026-05-02 08:26:18 +12:00
< div class = "testimonial-author" >
< span class = "testimonial-author-name" > { testimonial . reviewer } </ span >
< span class = "testimonial-author-detail" > { testimonial . detail } </ span >
</ div >
< div class = "testimonial-divider" ></ div >
2026-05-06 11:36:19 +12:00
< div class = "testimonial-mobile-controls" aria-label = "Testimonial navigation" >
< button
class = "testimonial-arrow testimonial-arrow-inline"
type = "button"
aria-label = "Previous testimonial"
on:click = { showPrevious }
>
< Icon name = "fas fa-chevron-left" />
</ button >
< button
class = "testimonial-arrow testimonial-arrow-inline"
type = "button"
aria-label = "Next testimonial"
on:click = { showNext }
>
< Icon name = "fas fa-chevron-right" />
</ button >
</ div >
2026-05-02 08:26:18 +12:00
< a
class = "testimonial-google"
href = "https://g.page/r/CUsvrWPhkYrAEB0/"
target = "_blank"
rel = "noopener"
>
2026-05-06 11:36:19 +12:00
< img
class = "testimonial-google-logo"
src = "/images/google-g-logo.svg"
alt = ""
width = "18"
height = "19"
/>
2026-05-06 08:27:24 +12:00
< span > 30+ five-star Google reviews</ span >
2026-05-02 08:26:18 +12:00
</ a >
</ div >
</ article >
{ /each }
</ div >
< button
class = "testimonial-arrow testimonial-arrow-right"
type = "button"
aria-label = "Next testimonial"
on:click = { showNext }
>
< Icon name = "fas fa-chevron-right" />
</ button >
</ div >
{ /if }
2026-05-06 11:36:19 +12:00
< a href = { instagramHref } target="_blank" rel = "noopener" class = "testimonials-instagram-link" >
< Icon name = "fab fa-instagram" />
< span > { instagramLabel } </ span >
</ a >
2026-05-02 08:26:18 +12:00
</ div >
</ section >
< style >
2026-05-07 21:47:42 +12:00
. testimonials-eyebrow {
display : block ;
width : fit-content ;
margin : 0 auto 10 px ;
padding : 7 px 12 px ;
border-radius : 999 px ;
background : rgba ( 33 , 48 , 33 , 0.08 );
color : var ( -- gw - green );
font-size : 12 px ;
font-weight : 800 ;
letter-spacing : 0.08 em ;
text-transform : uppercase ;
box-shadow : inset 0 0 0 1 px rgba ( 17 , 20 , 24 , 0.05 );
}
2026-05-02 08:26:18 +12:00
. testimonials-intro {
max-width : 760 px ;
margin : 18 px auto 0 ;
text-align : center ;
}
. testimonials-intro p {
margin : 0 ;
color : #4c5056 ;
font-size : 17 px ;
line-height : 1.65 ;
}
. testimonials-instagram-link {
2026-05-06 11:36:19 +12:00
display : flex ;
width : fit-content ;
2026-05-02 08:26:18 +12:00
align-items : center ;
gap : 10 px ;
2026-05-06 11:36:19 +12:00
margin : 18 px auto 0 ;
2026-05-02 08:26:18 +12:00
padding : 10 px 16 px ;
border-radius : 999 px ;
background : rgba ( 33 , 48 , 33 , 0.06 );
2026-05-07 21:47:42 +12:00
color : var ( -- gw - green );
2026-05-02 08:26:18 +12:00
font-weight : 700 ;
text-decoration : none ;
box-shadow : inset 0 0 0 1 px rgba ( 17 , 20 , 24 , 0.06 );
transition :
transform 0.16 s cubic-bezier ( 0.22 , 1 , 0.36 , 1 ),
background 0.2 s ease ,
box-shadow 0.2 s ease ;
}
: global ( . testimonials-instagram-link . icon ) {
font-size : 18 px ;
}
@ media ( hover : hover ) {
. testimonials-instagram-link : hover {
transform : translateY ( -2 px );
background : rgba ( 33 , 48 , 33 , 0.09 );
box-shadow :
inset 0 0 0 1 px rgba ( 17 , 20 , 24 , 0.06 ),
0 10 px 22 px rgba ( 17 , 20 , 24 , 0.08 );
}
}
. testimonials-instagram-link : active {
transform : translateY ( 1 px ) scale ( 0.985 );
}
. testimonials-carousel {
position : relative ;
margin-top : 48 px ;
2026-05-07 21:47:42 +12:00
padding : 0 38 px ;
2026-05-02 08:26:18 +12:00
}
@ media ( max-width : 768px ) {
2026-05-07 21:47:42 +12:00
. testimonials-eyebrow {
margin-bottom : 8 px ;
padding : 6 px 10 px ;
font-size : 11 px ;
}
2026-05-02 08:26:18 +12:00
. testimonials-intro {
margin-top : 14 px ;
}
. testimonials-intro p {
font-size : 15 px ;
line-height : 1.55 ;
}
. testimonials-instagram-link {
2026-05-06 11:36:19 +12:00
margin : 14 px auto 0 ;
2026-05-02 08:26:18 +12:00
padding : 9 px 14 px ;
font-size : 15 px ;
}
}
. testimonial-arrow {
transition :
transform 0.16 s cubic-bezier ( 0.22 , 1 , 0.36 , 1 ),
box-shadow 0.2 s ease ,
background 0.2 s ease ;
-webkit- tap-highlight-color : transparent ;
touch-action : manipulation ;
}
@ media ( hover : hover ) {
. testimonial-arrow : hover {
transform : translateY ( -50 % ) scale ( 1.05 );
box-shadow : 0 14 px 28 px rgba ( 17 , 20 , 24 , 0.12 );
}
}
. testimonial-arrow : active {
transform : translateY ( -50 % ) scale ( 0.95 );
}
: global ( . reveal-ready . reveal-block ) {
opacity : 0 ;
transform : translate3d ( 0 , var ( -- reveal - distance , 24 px ), 0 );
transition :
opacity 0.55 s ease ,
transform 0.7 s cubic-bezier ( 0.2 , 0.8 , 0.2 , 1 );
transition-delay : var ( -- reveal - delay , 0 ms );
}
: global ( . reveal-visible . reveal-block ) {
opacity : 1 ;
transform : translate3d ( 0 , 0 , 0 );
}
. testimonial-stage {
position : relative ;
overflow : hidden ;
2026-05-05 21:23:41 +12:00
border-radius : 28 px ;
2026-05-02 08:26:18 +12:00
background : #fff ;
box-shadow : 0 10 px 30 px rgba ( 20 , 24 , 20 , 0.06 );
min-height : 620 px ;
}
. testimonial-slide {
position : absolute ;
inset : 0 ;
display : grid ;
grid-template-columns : 45 % 55 % ;
align-items : stretch ;
opacity : 0 ;
pointer-events : none ;
transition :
opacity 0.35 s ease ,
transform 0.35 s ease ;
transform : translateX ( 18 px );
}
. testimonial-slide-active {
opacity : 1 ;
pointer-events : auto ;
transform : translateX ( 0 );
}
. testimonial-photo-wrap {
display : flex ;
align-items : flex-start ;
justify-content : center ;
padding : 32 px 24 px 0 24 px ;
}
. testimonial-photo-frame {
width : min ( 100 % , 340 px );
}
. testimonial-photo {
display : block ;
width : 100 % ;
margin : 0 auto ;
aspect-ratio : 1 / 1 ;
object-fit : cover ;
}
. testimonial-copy {
align-self : start ;
padding : 118 px 112 px 76 px 10 px ;
}
. testimonial-quote-mark {
display : block ;
font-family : Georgia , serif ;
font-size : 72 px ;
line-height : 0.6 ;
color : var ( -- yellow );
margin-bottom : 20 px ;
user-select : none ;
}
2026-05-03 11:49:59 +12:00
. testimonial-copy . testimonial-quote {
2026-05-02 08:26:18 +12:00
max-width : 500 px ;
margin : 0 ;
font-size : 17 px ;
font-style : italic ;
font-weight : 400 ;
line-height : 1.6 ;
letter-spacing : 0 ;
color : #2e3031 ;
}
. testimonial-author {
display : flex ;
align-items : center ;
gap : 10 px ;
margin-top : 24 px ;
}
. testimonial-author-name {
font-family : var ( -- font - head );
font-size : 15 px ;
font-weight : 700 ;
color : #1a1a1a ;
}
. testimonial-author-detail {
font-size : 14 px ;
color : #6b7280 ;
}
. testimonial-author-detail :: before {
content : '—' ;
margin-right : 6 px ;
}
. testimonial-divider {
width : 100 % ;
max-width : 690 px ;
height : 1 px ;
margin : 44 px 0 0 ;
background : #e7e7e7 ;
}
. testimonial-google {
display : inline-flex ;
align-items : center ;
gap : 12 px ;
margin-top : 28 px ;
padding : 10 px 20 px ;
border-radius : 999 px ;
background : #f8f8f8 ;
color : #0a304e ;
font-size : 14 px ;
line-height : 1.3 ;
box-shadow : 0 0 0 1 px rgba ( 10 , 48 , 78 , 0.06 );
}
2026-05-06 11:36:19 +12:00
. testimonial-google-logo {
width : 18 px ;
height : 19 px ;
flex : 0 0 auto ;
2026-05-02 08:26:18 +12:00
}
. testimonial-google : hover {
background : #efe6d5 ;
}
2026-05-06 11:36:19 +12:00
. testimonial-mobile-controls {
display : none ;
}
2026-05-02 08:26:18 +12:00
. testimonial-woof {
position : absolute ;
top : 40 px ;
right : 60 px ;
z-index : 2 ;
color : #2e3031 ;
transform : rotate ( -6 deg );
transform-origin : center center ;
}
. testimonial-woof-text {
display : inline-block ;
font-family : 'Fredoka One' , var ( -- font - head ), sans-serif ;
font-size : 32 px ;
line-height : 1 ;
letter-spacing : 0.02 em ;
}
. testimonial-ray {
position : absolute ;
border-radius : 999 px ;
background : #ffd100 ;
}
. testimonial-ray-1 {
top : -12 px ;
right : -48 px ;
width : 32 px ;
height : 11 px ;
transform : rotate ( -35 deg );
}
. testimonial-ray-2 {
top : 6 px ;
right : -60 px ;
width : 46 px ;
height : 13 px ;
transform : rotate ( -35 deg );
}
. testimonial-ray-3 {
top : 24 px ;
right : -50 px ;
width : 36 px ;
height : 11 px ;
transform : rotate ( -35 deg );
}
. testimonial-arrow {
position : absolute ;
top : 50 % ;
z-index : 3 ;
display : inline-flex ;
align-items : center ;
justify-content : center ;
width : 58 px ;
height : 58 px ;
border : 1 px solid rgba ( 0 , 0 , 0 , 0.08 );
border-radius : 20 px ;
background : rgba ( 255 , 255 , 255 , 0.95 );
color : #111 ;
font-size : 22 px ;
transform : translateY ( -50 % );
box-shadow : 0 12 px 28 px rgba ( 20 , 24 , 20 , 0.07 );
}
. testimonial-arrow : hover {
background : #fff ;
}
. testimonial-arrow-left {
2026-05-07 21:47:42 +12:00
left : 0 ;
2026-05-02 08:26:18 +12:00
}
. testimonial-arrow-right {
2026-05-07 21:47:42 +12:00
right : 0 ;
2026-05-02 08:26:18 +12:00
}
@ media ( max-width : 1024px ) {
. testimonial-stage {
min-height : 560 px ;
}
. testimonial-photo-wrap {
padding : 88 px 16 px 64 px 44 px ;
}
. testimonial-copy {
padding : 96 px 72 px 64 px 8 px ;
}
2026-05-03 11:49:59 +12:00
. testimonial-copy . testimonial-quote {
2026-05-02 08:26:18 +12:00
max-width : 460 px ;
font-size : 17 px ;
}
. testimonial-woof {
right : 40 px ;
}
}
@ media ( max-width : 767px ) {
. testimonials-carousel {
margin-top : 32 px ;
2026-05-07 21:47:42 +12:00
padding : 0 ;
2026-05-02 08:26:18 +12:00
}
. testimonial-stage {
min-height : unset ;
2026-05-06 11:36:19 +12:00
padding-bottom : 0 ;
2026-05-02 08:26:18 +12:00
}
. testimonial-slide {
position : relative ;
display : none ;
grid-template-columns : 1 fr ;
transform : none ;
}
. testimonial-slide-active {
display : grid ;
}
. testimonial-photo-wrap {
justify-content : center ;
padding : 48 px 22 px 16 px ;
}
. testimonial-photo-frame {
width : min ( 100 % , 220 px );
}
. testimonial-photo {
aspect-ratio : 1 / 1 ;
}
. testimonial-copy {
padding : 8 px 28 px 32 px ;
align-self : start ;
}
. testimonial-quote-mark {
font-size : 44 px ;
margin-bottom : 8 px ;
}
2026-05-03 11:49:59 +12:00
. testimonial-copy . testimonial-quote {
2026-05-02 08:26:18 +12:00
font-size : 16 px ;
line-height : 1.55 ;
}
. testimonial-divider {
margin-top : 28 px ;
}
2026-05-06 11:36:19 +12:00
. testimonial-mobile-controls {
display : inline-flex ;
align-items : center ;
gap : 12 px ;
margin-top : 20 px ;
}
. testimonial-arrow-inline {
position : static ;
width : 48 px ;
height : 48 px ;
font-size : 18 px ;
transform : none ;
box-shadow : 0 10 px 22 px rgba ( 20 , 24 , 20 , 0.08 );
}
2026-05-02 08:26:18 +12:00
. testimonial-google {
2026-05-06 11:36:19 +12:00
margin-top : 20 px ;
2026-05-02 08:26:18 +12:00
font-size : 16 px ;
gap : 10 px ;
padding : 10 px 14 px ;
}
. testimonial-google : global ( . icon ) {
font-size : 20 px ;
}
. testimonial-woof {
top : 24 px ;
right : 22 px ;
}
. testimonial-woof-text {
font-size : 22 px ;
}
. testimonial-ray {
right : -28 px ;
width : 9 px ;
}
. testimonial-ray-1 {
top : -7 px ;
height : 34 px ;
}
. testimonial-ray-2 {
top : 10 px ;
right : -38 px ;
width : 34 px ;
height : 9 px ;
}
. testimonial-ray-3 {
top : 35 px ;
right : -28 px ;
width : 27 px ;
height : 8 px ;
}
2026-05-06 11:36:19 +12:00
. testimonial-arrow-left ,
2026-05-02 08:26:18 +12:00
. testimonial-arrow-right {
2026-05-06 11:36:19 +12:00
display : none ;
2026-05-02 08:26:18 +12:00
}
}
</ style >