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