File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ export default function Home() {
7777 } ;
7878 } , [ ] ) ;
7979
80+ function getWindowWidth ( ) : number {
81+ if ( typeof window !== "undefined" ) {
82+ return window . innerWidth ;
83+ }
84+ return 0 ;
85+ }
86+
8087 return (
8188 < main >
8289 < BackgroundGradient />
@@ -241,8 +248,8 @@ export default function Home() {
241248 < div className = "mt-28 flex w-screen flex-col gap-y-16" >
242249 < motion . div
243250 ref = { infoSection1Ref }
244- initial = { { x : - window . innerWidth } }
245- animate = { { x : hasBeenInView . infoSection1 ? 0 : - window . innerWidth } }
251+ initial = { { x : - getWindowWidth ( ) } }
252+ animate = { { x : hasBeenInView . infoSection1 ? 0 : - getWindowWidth ( ) } }
246253 transition = { { duration : 1 , delay : 0.2 } }
247254 >
248255 < InfoSection
@@ -267,8 +274,8 @@ export default function Home() {
267274 </ motion . div >
268275 < motion . div
269276 ref = { infoSection2Ref }
270- initial = { { x : window . innerWidth - 100 } }
271- animate = { { x : hasBeenInView . infoSection2 ? 0 : window . innerWidth - 100 } }
277+ initial = { { x : getWindowWidth ( ) - 100 } }
278+ animate = { { x : hasBeenInView . infoSection2 ? 0 : getWindowWidth ( ) - 100 } }
272279 transition = { { duration : 1 , delay : 0.2 } }
273280 >
274281 < InfoSection
You can’t perform that action at this time.
0 commit comments