@@ -14,7 +14,6 @@ type CTAButton = {
14
14
}
15
15
16
16
type HeroProps = {
17
- heading : string
18
17
primaryCta ?: CTAButton
19
18
secondaryCta ?: CTAButton
20
19
buttonVisible ?: boolean
@@ -47,7 +46,7 @@ const getHoverAnimation = (variant: 'primary' | 'secondary') => ({
47
46
const transitionConfig = { type : 'spring' , damping : 15 } as const
48
47
49
48
const getButtonContainerClasses = ( variant : 'primary' | 'secondary' ) =>
50
- `relative z-20 mt-8 md:mt-12 ${ variant === 'primary' ? 'mx-auto w-fit' : 'right-[calc(50%-120px)]' } `
49
+ `relative z-20 mt-8 md:mt-12 flex flex-col items-center justify-center ${ variant === 'primary' ? 'mx-auto w-fit' : 'right-[calc(50%-120px)]' } `
51
50
52
51
const getButtonClasses = ( variant : 'primary' | 'secondary' ) =>
53
52
`${ variant === 'primary' ? 'btn bg-white fill-n-1 text-n-1 hover:bg-white/90' : 'btn-yellow' } px-7 md:px-9 py-3 md:py-8 text-base md:text-xl btn-shadow-primary-4`
@@ -99,26 +98,19 @@ const renderArrows = (variant: 'primary' | 'secondary', arrowOpacity: number, bu
99
98
</ >
100
99
)
101
100
102
- export function Hero ( { heading , primaryCta, secondaryCta, buttonVisible, buttonScale = 1 } : HeroProps ) {
101
+ export function Hero ( { primaryCta, secondaryCta, buttonVisible, buttonScale = 1 } : HeroProps ) {
103
102
const [ screenWidth , setScreenWidth ] = useState ( typeof window !== 'undefined' ? window . innerWidth : 1200 )
104
- const [ scrollY , setScrollY ] = useState ( 0 )
105
103
106
104
useEffect ( ( ) => {
107
105
const handleResize = ( ) => {
108
106
setScreenWidth ( window . innerWidth )
109
107
}
110
108
111
- const handleScroll = ( ) => {
112
- setScrollY ( window . scrollY )
113
- }
114
-
115
109
handleResize ( )
116
110
window . addEventListener ( 'resize' , handleResize )
117
- window . addEventListener ( 'scroll' , handleScroll )
118
111
119
112
return ( ) => {
120
113
window . removeEventListener ( 'resize' , handleResize )
121
- window . removeEventListener ( 'scroll' , handleScroll )
122
114
}
123
115
} , [ ] )
124
116
@@ -148,53 +140,47 @@ export function Hero({ heading, primaryCta, secondaryCta, buttonVisible, buttonS
148
140
</ Button >
149
141
</ a >
150
142
151
- < p className = "font-roboto-flex-bold mt-2 text-xs italic text-n-1 md:text-sm" > Takes 10 seconds</ p >
143
+ < p className = "font-roboto-flex-bold mx-auto mt-2 text-xs italic text-n-1 md:text-sm" >
144
+ Takes 10 seconds
145
+ </ p >
152
146
153
147
{ renderArrows ( variant , arrowOpacity , buttonVisible ) }
154
148
</ motion . div >
155
149
)
156
150
}
157
151
158
152
return (
159
- < div className = "relative flex h-[90vh] flex-col justify-between overflow-x-hidden overflow-y-hidden bg-primary-1 " >
153
+ < section className = "relative flex min- h-[85vh] w-full flex-col items-center justify-between bg-primary-1 px-4 py-4 xl:h-fit xl:justify-center " >
160
154
< CloudImages screenWidth = { screenWidth } />
161
-
162
- < div className = "relative mb-8 mt-0 flex grow flex-col justify-between space-y-6 md:mb-10 md:mt-4" >
155
+ < div className = "relative mt-10 w-full md:mt-0" >
163
156
< img
164
- src = { PeanutGuyGIF . src }
165
- className = "mg:bottom -0 absolute bottom-[55%] left-1/2 z-10 mx-auto h-auto max-h-[40vh] w-auto max- w-[90%] -translate-x-1/2 translate-y-1/2 transform object-contain "
166
- alt = "Peanut Guy "
157
+ src = { ButterySmoothGlobalMoney . src }
158
+ className = "z -0 mx-auto w-full max-w-[1000px] object-contain md: w-[50%] "
159
+ alt = "Buttery Smooth Global Money "
167
160
/>
168
161
169
- < Stack spacing = { 2 } className = "relative h-1/3 items-center justify-center px-4 text-center lg:h-full" >
170
- < img
171
- src = { ButterySmoothGlobalMoney . src }
172
- className = "z-0 mx-auto w-full max-w-[1000px] object-contain md:w-[50%]"
173
- alt = "Buttery Smooth Global Money"
174
- />
175
-
176
- < HeroImages />
177
- </ Stack >
178
-
179
- < Stack spacing = { 2 } className = "relative h-1/3 items-center justify-center px-4 text-center lg:h-full" >
180
- < div className = "mt-8 md:mt-12 lg:mt-6" >
181
- < h2 className = "font-roboto-flex-extrabold text-[2.375rem] font-extraBlack text-black md:text-heading" >
182
- INSTANTLY SEND & RECEIVE
183
- </ h2 >
184
- < span
185
- className = "mt-2 block text-xl leading-tight text-n-1 md:mt-4 md:text-5xl"
186
- style = { { fontWeight : 500 , letterSpacing : '-0.5px' } }
187
- >
188
- MONEY ACROSS THE GLOBE
189
- </ span >
190
- </ div >
191
-
192
- { primaryCta && renderCTAButton ( primaryCta , 'primary' ) }
193
- { secondaryCta && renderCTAButton ( secondaryCta , 'secondary' ) }
194
-
195
- < HeroImages />
196
- </ Stack >
162
+ < HeroImages />
163
+ </ div >
164
+ < img
165
+ src = { PeanutGuyGIF . src }
166
+ className = "mg:bottom-0 absolute bottom-[55%] left-1/2 z-10 mx-auto h-auto max-h-[40vh] w-auto max-w-[90%] -translate-x-1/2 translate-y-1/2 transform object-contain"
167
+ alt = "Peanut Guy"
168
+ />
169
+
170
+ < div className = "relative mb-4 flex w-full flex-col items-center justify-center md:mb-0" >
171
+ < h2 className = "font-roboto-flex-extrabold mt-18 text-center text-[2.375rem] font-extraBlack text-black md:text-heading" >
172
+ INSTANTLY SEND & RECEIVE
173
+ </ h2 >
174
+ < span
175
+ className = "mt-2 block text-xl leading-tight text-n-1 md:mt-4 md:text-5xl"
176
+ style = { { fontWeight : 500 , letterSpacing : '-0.5px' } }
177
+ >
178
+ MONEY ACROSS THE GLOBE
179
+ </ span >
180
+ { primaryCta && renderCTAButton ( primaryCta , 'primary' ) }
181
+ { secondaryCta && renderCTAButton ( secondaryCta , 'secondary' ) }
182
+ < HeroImages />
197
183
</ div >
198
- </ div >
184
+ </ section >
199
185
)
200
186
}
0 commit comments