Skip to content

Commit cc7ceca

Browse files
committed
merge: origin/develop into develop 병합
2 parents 464577a + a4ad3ae commit cc7ceca

File tree

8 files changed

+53
-24
lines changed

8 files changed

+53
-24
lines changed

frontend/src/pages/LandingPage/LandingPage.styled.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ export const LandingPageLayout = styled.div`
1515
display: none;
1616
}
1717
`;
18+
19+
export const LoginButtonWrapper = styled.div<{ $isIntro: boolean }>`
20+
position: fixed;
21+
bottom: ${({ $isIntro }) => ($isIntro ? '28%' : '6%')};
22+
left: 0;
23+
right: 0;
24+
display: flex;
25+
justify-content: center;
26+
z-index: 100;
27+
pointer-events: auto;
28+
transition: bottom 0.3s ease;
29+
`;

frontend/src/pages/LandingPage/components/ServiceGuide/GuideIntro/GuideIntro.styled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const ScrollDownContainer = styled.div`
2222
flex-direction: column;
2323
align-items: center;
2424
gap: 2rem;
25+
margin-top: 10rem;
2526
`;
2627

2728
export const ScrollDownText = styled.div`

frontend/src/pages/LandingPage/components/ServiceGuide/GuideIntro/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import LandingHeader from '../../LandingHeader';
44
import LandingMessage from '../../LandingMessage';
55

66
import scrollDownImage from '@/assets/images/scrollDown.webp';
7-
import LoginButton from '@/components/Button/LoginButton';
87

98
const GuideIntro = () => {
109
return (
1110
<S.GuideIntroLayout>
1211
<LandingHeader />
1312
<LandingMessage />
1413
<CarouselList />
15-
<LoginButton />
1614
<S.ScrollDownContainer>
1715
<S.ScrollDownText>아래로 스크롤하면 서비스 소개를 볼 수 있어요</S.ScrollDownText>
1816
<S.ScrollDownImage src={scrollDownImage} alt="scrollDown" />

frontend/src/pages/LandingPage/components/ServiceGuide/GuideOutro/GuideOutro.styled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const GuideOutroLayout = styled.div`
1616
${({ theme }) => theme.colors.green100} 0%,
1717
${({ theme }) => theme.colors.white} 56.28%
1818
);
19+
padding-bottom: 9rem;
1920
`;
2021

2122
export const ContentContainer = styled.div`

frontend/src/pages/LandingPage/components/ServiceGuide/GuideOutro/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import CarouselList from '../../CarouselList';
33
import LandingHeader from '../../LandingHeader';
44
import LandingMessage from '../../LandingMessage';
55

6-
import LoginButton from '@/components/Button/LoginButton';
7-
86
const GuideOutro = () => {
97
return (
108
<S.GuideOutroLayout>
@@ -13,7 +11,6 @@ const GuideOutro = () => {
1311
<CarouselList />
1412
<S.ButtonContainer>
1513
<S.ScrollDownText>로그인하여 두리번을 시작해보세요</S.ScrollDownText>
16-
<LoginButton />
1714
</S.ButtonContainer>
1815
</S.GuideOutroLayout>
1916
);

frontend/src/pages/LandingPage/components/ServiceGuide/GuideSlide/GuideSlide.styled.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const GuideSlideLayout = styled.div`
1212
scroll-snap-stop: always;
1313
flex-shrink: 0;
1414
overflow: hidden;
15-
gap: 5rem;
15+
gap: 10%;
1616
`;
1717

1818
export const Description = styled.div`
@@ -45,8 +45,3 @@ export const IndexCircle = styled.div<{ $isActive: boolean }>`
4545
background-color: ${({ theme, $isActive }) =>
4646
$isActive ? theme.colors.green600 : theme.colors.gray300};
4747
`;
48-
49-
export const ButtonContainer = styled.div`
50-
position: absolute;
51-
bottom: 3rem;
52-
`;

frontend/src/pages/LandingPage/components/ServiceGuide/GuideSlide/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import * as S from './GuideSlide.styled';
22
import { ServiceGuideStepType } from '../../../LandingPage.types';
33
import LandingHeader from '../../LandingHeader';
44

5-
import LoginButton from '@/components/Button/LoginButton';
6-
75
interface ServiceGuideProps {
86
step: ServiceGuideStepType;
97
totalSteps: number;
@@ -21,10 +19,6 @@ const GuideSlide = ({ step, totalSteps }: ServiceGuideProps) => {
2119
))}
2220
</S.IndexContainer>
2321
<S.Image src={step.image} alt="service guide" />
24-
25-
<S.ButtonContainer>
26-
<LoginButton />
27-
</S.ButtonContainer>
2822
</S.GuideSlideLayout>
2923
);
3024
};

frontend/src/pages/LandingPage/index.tsx

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
1+
import { useEffect, useState, useRef } from 'react';
2+
13
import GuideIntro from './components/ServiceGuide/GuideIntro';
24
import GuideOutro from './components/ServiceGuide/GuideOutro';
35
import GuideSlide from './components/ServiceGuide/GuideSlide';
46
import { SERVICE_GUIDE_STEPS } from './LandingPage.constants';
57
import * as S from './LandingPage.styled';
68

9+
import LoginButton from '@/components/Button/LoginButton';
10+
711
const LandingPage = () => {
12+
const [isIntro, setIsIntro] = useState<boolean>(true);
13+
const scrollContainerRef = useRef<HTMLDivElement>(null);
14+
15+
useEffect(() => {
16+
const scrollContainer = scrollContainerRef.current;
17+
18+
if (!scrollContainer) return;
19+
20+
const handleScroll = () => {
21+
const scrollTop = scrollContainer.scrollTop;
22+
const viewportHeight = window.innerHeight;
23+
setIsIntro(scrollTop < viewportHeight * 0.5);
24+
};
25+
26+
scrollContainer.addEventListener('scroll', handleScroll);
27+
handleScroll();
28+
29+
return () => {
30+
scrollContainer.removeEventListener('scroll', handleScroll);
31+
};
32+
}, []);
33+
834
return (
9-
<S.LandingPageLayout>
10-
<GuideIntro />
11-
{SERVICE_GUIDE_STEPS.map((step) => (
12-
<GuideSlide key={step.step} step={step} totalSteps={SERVICE_GUIDE_STEPS.length} />
13-
))}
14-
<GuideOutro />
15-
</S.LandingPageLayout>
35+
<>
36+
<S.LandingPageLayout ref={scrollContainerRef}>
37+
<GuideIntro />
38+
{SERVICE_GUIDE_STEPS.map((step) => (
39+
<GuideSlide key={step.step} step={step} totalSteps={SERVICE_GUIDE_STEPS.length} />
40+
))}
41+
<GuideOutro />
42+
</S.LandingPageLayout>
43+
<S.LoginButtonWrapper $isIntro={isIntro}>
44+
<LoginButton />
45+
</S.LoginButtonWrapper>
46+
</>
1647
);
1748
};
1849

0 commit comments

Comments
 (0)