Skip to content

Commit 1c6360b

Browse files
committed
Fix horizontal scroll bug from home page animations
1 parent 0a60c81 commit 1c6360b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default function Home() {
209209
<ScrollFeatureSection ref={firstLineRef}>
210210
<ScrollFeatureTitle
211211
animate={{
212-
x: firstLineView ? 0 : "-40vw",
212+
x: firstLineView ? 0 : "-100%",
213213
opacity: firstLineView ? 1 : 0
214214
}}
215215
transition={{ duration: 0.9, ease: "easeOut" }}
@@ -230,7 +230,7 @@ export default function Home() {
230230
<ScrollFeatureSection ref={secondLineRef}>
231231
<ScrollFeatureTitle
232232
animate={{
233-
x: secondLineView ? 0 : "40vw",
233+
x: secondLineView ? 0 : "100%",
234234
opacity: secondLineView ? 1 : 0
235235
}}
236236
transition={{ duration: 0.9, ease: "easeOut" }}
@@ -251,7 +251,7 @@ export default function Home() {
251251
<ScrollFeatureSection ref={thirdLineRef}>
252252
<ScrollFeatureTitle
253253
animate={{
254-
x: thirdLineView ? 0 : "-40vw",
254+
x: thirdLineView ? 0 : "-100%",
255255
opacity: thirdLineView ? 1 : 0
256256
}}
257257
transition={{ duration: 0.9, ease: "easeOut" }}
@@ -495,7 +495,7 @@ const HeroButtonContainer = styled.div`
495495
`
496496

497497
const ScrollFeatureSection = styled.section`
498-
width: 100vw;
498+
width: 100%;
499499
min-height: 80vh;
500500
display: flex;
501501
flex-direction: column;
@@ -505,6 +505,8 @@ const ScrollFeatureSection = styled.section`
505505
gap: 1.5rem;
506506
box-sizing: border-box;
507507
margin: 4rem 0;
508+
overflow: hidden;
509+
position: relative;
508510
509511
@media (max-width: 768px) {
510512
min-height: 70vh;

0 commit comments

Comments
 (0)