1
- import { NavBar } from '@/components/NavBar' ;
2
1
import Head from 'next/head' ;
3
2
import clsx from 'clsx' ;
4
3
import { text , title } from '../fonts' ;
5
- import pets from '../dogandcat.png' ;
6
- import Image , { ImageProps } from 'next/image' ;
7
- import { FaGlasses , FaHeart , FaShower } from 'react-icons/fa' ;
8
- import { ImageGallery } from '@/components/ImageGallery' ;
9
- import { WithChildrenProps } from '../types' ;
10
-
11
- import pet1 from 'images/pet1.webp' ;
12
- import pet2 from 'images/pet2.webp' ;
13
- import pet3 from 'images/pet3.webp' ;
14
- import { useEffect , useState } from 'react' ;
15
4
import { Footer } from '@/components/Footer' ;
16
5
import { SocialsFooter } from '@/components/SocialsFooter' ;
6
+ import { Intro } from '@/components/Intro' ;
7
+ import { Gallery } from '@/components/Gallery' ;
8
+ import { Testimonials } from '@/components/Testimonials' ;
17
9
18
10
export default function Home ( ) {
19
11
return (
@@ -34,147 +26,3 @@ export default function Home() {
34
26
</ div >
35
27
) ;
36
28
}
37
-
38
- function Intro ( ) {
39
- return (
40
- < div className = "text-light flex h-[36rem] w-full flex-col items-center justify-center bg-secondary md:h-[90vh]" >
41
- < NavBar />
42
- < main className = "relative flex w-full grow items-start justify-center py-12 px-4 md:items-center md:justify-start md:px-12" >
43
- < header
44
- className = { clsx (
45
- 'z-10 flex flex-col gap-4 md:-mt-36' ,
46
- title . className
47
- ) } >
48
- < h1 className = "text-center text-5xl md:text-start md:text-8xl" >
49
- The Best Pet < br /> Groomers < br /> in Town
50
- </ h1 >
51
- < p className = { clsx ( 'text-3xl font-light' , text . className ) } >
52
- For a pawfect look and feel!
53
- </ p >
54
- </ header >
55
- < div className = "absolute right-0 -bottom-12 w-full sm:w-4/5 md:-bottom-36 md:w-[950px]" >
56
- < Image src = { pets } alt = "Cat and dog" />
57
- </ div >
58
- </ main >
59
- </ div >
60
- ) ;
61
- }
62
-
63
- function Gallery ( ) {
64
- return (
65
- < div
66
- className = { clsx (
67
- 'mt-48 flex min-h-screen w-full flex-col items-center justify-center gap-14 px-4 text-primary md:px-12' ,
68
- text . className
69
- ) } >
70
- < h1
71
- className = { clsx (
72
- 'text-center text-4xl md:text-8xl' ,
73
- title . className
74
- ) } >
75
- Your pet deserves < br /> to be pampered!
76
- </ h1 >
77
- < div className = "flex flex-col gap-12 text-3xl md:flex-row" >
78
- < div className = "flex flex-row items-center justify-center gap-5" >
79
- < FaShower className = "text-4xl" />
80
- Bath or Shower
81
- </ div >
82
- < div className = "flex flex-row items-center justify-center gap-5" >
83
- < FaGlasses className = "text-4xl" />
84
- Hands-On Assessment
85
- </ div >
86
- < div className = "flex flex-row items-center justify-center gap-5" >
87
- < FaHeart className = "text-4xl" />
88
- Safe Drying
89
- </ div >
90
- </ div >
91
- < button className = "flex flex-row gap-12 rounded-full bg-primary px-8 py-4 text-2xl text-white" >
92
- Book an Appointment
93
- </ button >
94
- < ImageGallery />
95
- </ div >
96
- ) ;
97
- }
98
- const names = [
99
- 'Abi' ,
100
- 'Brian' ,
101
- 'Carl' ,
102
- 'Daniella' ,
103
- 'Edward' ,
104
- 'Ruby' ,
105
- 'John' ,
106
- 'Alan' ,
107
- ] ;
108
- const locations = [ 'Nottingham' , 'Manchester' , 'London' , 'York' , 'Brighton' ] ;
109
-
110
- function Testimonial ( {
111
- className,
112
- children,
113
- } : WithChildrenProps & { className ?: string } ) {
114
- const [ randomName , setRandomName ] = useState ( '' ) ;
115
- const [ randomLocation , setRandomLocation ] = useState ( '' ) ;
116
-
117
- useEffect ( ( ) => {
118
- setRandomName ( names [ Math . floor ( Math . random ( ) * names . length ) ] ) ;
119
- setRandomLocation (
120
- locations [ Math . floor ( Math . random ( ) * locations . length ) ]
121
- ) ;
122
- } , [ ] ) ; //To make sure the random generation only runs on the client
123
-
124
- return (
125
- < div
126
- className = { clsx (
127
- 'text-md flex aspect-[3/4] h-96 flex-col items-center justify-between gap-8 rounded-md bg-white p-6 font-light text-secondary shadow' ,
128
- className
129
- ) } >
130
- { children }
131
- < div className = "w-full text-start font-bold" >
132
- { randomName } , { randomLocation }
133
- </ div >
134
- </ div >
135
- ) ;
136
- }
137
-
138
- function Testimonials ( ) {
139
- return (
140
- < div className = "flex min-h-[120vh] w-full flex-col items-center justify-center gap-12 bg-secondary px-4 py-24 md:p-24" >
141
- < h2
142
- className = { clsx (
143
- 'text-center text-4xl text-primary md:w-1/2 md:text-7xl' ,
144
- title . className
145
- ) } >
146
- What Our Happy Clients Say
147
- </ h2 >
148
- < div className = "flex grow flex-wrap items-center items-center justify-center justify-center gap-24" >
149
- < Testimonial className = "md:mb-24" >
150
- < TestimonialImage src = { pet1 } alt = "" />
151
- "They do a great job making Milo look so lovely. The
152
- staff are knowledgeable and friendly, always willing to give
153
- help and advice. Would definitely recommend!"
154
- </ Testimonial >
155
- < Testimonial className = "md:mt-12" >
156
- < TestimonialImage src = { pet2 } alt = "" />
157
- "They do a great job making Milo look so lovely. The
158
- staff are knowledgeable and friendly, always willing to give
159
- help and advice. Would definitely recommend!"
160
- </ Testimonial >
161
- < Testimonial className = "md:mb-12" >
162
- < TestimonialImage src = { pet3 } alt = "" />
163
- "They do a great job making Milo look so lovely. The
164
- staff are knowledgeable and friendly, always willing to give
165
- help and advice. Would definitely recommend!"
166
- </ Testimonial >
167
- </ div >
168
- </ div >
169
- ) ;
170
- }
171
-
172
- function TestimonialImage ( { src, alt } : ImageProps ) {
173
- return (
174
- < div className = "flex h-full w-full items-center justify-center" >
175
- < div className = "aspect-square h-28 overflow-clip rounded-full" >
176
- < Image src = { src } alt = { alt } className = "object-cover" />
177
- </ div >
178
- </ div >
179
- ) ;
180
- }
0 commit comments