Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NDD-85] 랜딩 페이지 구현, 웹팩 file-loader, svgr 설정 (9h/8h) #27

Merged
merged 34 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ccee5fd
design: Header 영역을 위한 컴포넌트 생성 후 위치만 잡음
milk717 Nov 9, 2023
019d027
design: 랜딩 페이지 레이아웃 잡기
milk717 Nov 9, 2023
7477742
feat: Layout 컴포넌트의 스타일을 덮어씌울 수 있도록 타입과 props 변경
milk717 Nov 9, 2023
e7e8267
feat: LandingPageLayout 간격 변경
milk717 Nov 9, 2023
089a27c
rename: Intro -> StartButton으로 이름 변경
milk717 Nov 9, 2023
2ab0815
design: 그라데이션 테마 추가
milk717 Nov 9, 2023
a032048
design: typography variant 추가
milk717 Nov 9, 2023
a2fb903
design: 그림자 테마 추가
milk717 Nov 9, 2023
5341da0
design: 랜딩페이지 시작버튼 디자인 완료
milk717 Nov 9, 2023
c8c3e72
design: 랜딩페이지 시작버튼 hover, active 효과 추가
milk717 Nov 9, 2023
d9f44df
design: 랜딩페이지 뒷배경 추가하고 가운대로 배치
milk717 Nov 9, 2023
6555f4e
chore: 웹팩에 file-loader 추가
milk717 Nov 9, 2023
e2dd209
feat: png 로드를 위한 타입 선언
milk717 Nov 9, 2023
6f1cdaa
design: 랜딩페이지에 곰인형 배치
milk717 Nov 9, 2023
e361c65
feat: Typography 컴포넌트에서 paragraph 활성화하면 줄바꿈 인식하도록 변경
milk717 Nov 9, 2023
40cca1b
design: WelcomeBlurb 문구 수정 후 애니메이션 추가
milk717 Nov 9, 2023
75c2655
chore: assets 경로별칭 추가
milk717 Nov 9, 2023
2dbce64
design: 로고 추가
milk717 Nov 9, 2023
22c5f1d
chore: svgr loader 추가
milk717 Nov 9, 2023
94e4e92
design: 구글 로그인 버튼 추가
milk717 Nov 9, 2023
5cb3a10
design: header 스크롤 안되게 위치 고정
milk717 Nov 9, 2023
9f44633
design: 시작 버튼 눌림 효과 변경
milk717 Nov 9, 2023
19d3dad
design: 메인 이미지 다른 버전도 추가
milk717 Nov 9, 2023
ac5a695
remove: 랜딩 이미지 2안 제거
milk717 Nov 9, 2023
5cd0e3a
design: 랜딩 페이지 반응형 대응 완료
milk717 Nov 9, 2023
5d4218b
fix: import 경로 잘못된 것 수정
milk717 Nov 9, 2023
9184ef6
rename: StartButton 타입을 StartButtonProps타입으로 이름 변경
milk717 Nov 10, 2023
4790056
fix: px로 되어있는 단위 모두 rem으로 수정
milk717 Nov 10, 2023
985e052
rename: Header -> LandingPageHeader으로 변경
milk717 Nov 10, 2023
2ac715e
feat: breakpoint 테마 추가하고 적용
milk717 Nov 10, 2023
aaa2a6f
rename: 파일명 === export명 통일성 맞춤
milk717 Nov 10, 2023
95130cd
style: Typography 내부에 들어가는 개행 <br />로 수정
milk717 Nov 10, 2023
44f229f
rename: buttonLargeShadow를 buttonLargeHoverShadow, buttonLargeDefault…
milk717 Nov 10, 2023
4f34a78
fix: PR에서 리뷰 바로 반영 후 코드 오류난 것 수정
milk717 Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FE/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@svgr/webpack": "^8.1.0",
"@types/react": "^18.2.35",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/eslint-plugin": "^6.9.1",
Expand All @@ -37,6 +38,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^3.0.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"msw": "^2.0.3",
"prettier": "^3.0.3",
Expand Down
Binary file added FE/src/assets/images/landing-bear.png
milk717 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/src/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions FE/src/assets/svg/google-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions FE/src/components/common/Logo/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import logo from '@assets/images/logo.png';
import { css } from '@emotion/react';
import Typography from '@foundation/Typography/Typography';

const Logo: React.FC = ({}) => {
return (
<div
css={css`
display: flex;
justify-content: space-between;
align-items: center;
column-gap: 1rem;
`}
>
<img
src={logo}
alt={'곰돌이 로고'}
css={css`
width: 2.5rem;
`}
/>
<Typography variant="title2">곰터뷰</Typography>
</div>
);
};

export default Logo;
2 changes: 1 addition & 1 deletion FE/src/components/foundation/Button/Button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export const buttonSize = {
lg: css`
padding: 0.7rem 1.2rem;
border-radius: 1rem;
${theme.typography.title2}
${theme.typography.title3}
`,
};
7 changes: 5 additions & 2 deletions FE/src/components/foundation/Typography/Typography.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ElementType, ReactNode } from 'react';
import { css, Theme } from '@emotion/react';
import { theme } from '@styles/theme';
import { HTMLElementTypes } from '@/types/utils';

type Props = {
component?: ElementType;
Expand All @@ -9,7 +10,7 @@ type Props = {
paragraph?: boolean;
color?: string;
children: ReactNode;
};
} & HTMLElementTypes<HTMLDivElement>;
milk717 marked this conversation as resolved.
Show resolved Hide resolved

const Typography: React.FC<Props> = ({
component,
Expand All @@ -18,8 +19,9 @@ const Typography: React.FC<Props> = ({
paragraph,
color,
children,
...args
}) => {
const Component = component || (paragraph ? 'p' : 'span');
const Component = component || (paragraph ? 'pre' : 'span');

return (
<Component
Expand All @@ -37,6 +39,7 @@ const Typography: React.FC<Props> = ({
`,
theme.typography[variant],
]}
{...args}
>
{children}
</Component>
Expand Down
33 changes: 33 additions & 0 deletions FE/src/components/landingPage/GoogleLoginButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import GoogleLogo from '@assets/svg/google-logo.svg';
import { css } from '@emotion/react';
import { theme } from '@styles/theme';
import Typography from '@foundation/Typography/Typography';

const GoogleLoginButton: React.FC = () => {
return (
<button
css={css`
display: flex;
justify-content: space-between;
align-items: center;
column-gap: 0.75rem;
padding: 0.59375rem 0.75rem;
border-radius: 50rem;
border: 1px solid ${theme.colors.border.default};
milk717 marked this conversation as resolved.
Show resolved Hide resolved
transition: transform 0.15s ease-in-out;
background-color: ${theme.colors.surface.default};

&:hover {
transform: translateY(-4px);
}
`}
>
<GoogleLogo />
<Typography variant="body1" color={theme.colors.text.default}>
Google로 시작하기
</Typography>
</button>
);
};

export default GoogleLoginButton;
24 changes: 24 additions & 0 deletions FE/src/components/landingPage/Header.tsx
milk717 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { css } from '@emotion/react';
import Logo from '@common/Logo/Logo';
import GoogleLoginButton from '@components/landingPage/GoogleLoginButton';

const Header: React.FC = () => {
return (
<div
css={css`
position: fixed;
top: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 2rem;
`}
>
<Logo />
<GoogleLoginButton />
</div>
);
};

export default Header;
47 changes: 0 additions & 47 deletions FE/src/components/landingPage/Intro.tsx

This file was deleted.

27 changes: 27 additions & 0 deletions FE/src/components/landingPage/LandingImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { css } from '@emotion/react';
import LandingBear from '@assets/images/landing-bear.png';

const LandingImage: React.FC = () => {
return (
<div
css={css`
display: flex;
justify-content: center;
align-items: center;
justify-self: end;
align-self: end;
`}
>
<img
src={LandingBear}
alt={'노트북을 하는 곰돌이의 뒷모습'}
css={css`
height: 40vw;
milk717 marked this conversation as resolved.
Show resolved Hide resolved
min-height: 30rem;
`}
/>
</div>
);
};

export default LandingImage;
64 changes: 61 additions & 3 deletions FE/src/components/landingPage/Layout.tsx
milk717 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,15 +1,73 @@
import Layout from '@/components/layout/Layout';
import { css } from '@emotion/react';
import Header from '@components/landingPage/Header';
import Layout from '@components/layout/Layout';
import { theme } from '@styles/theme';

type LandingPageLayoutProps = {
children: React.ReactNode;
};

const LandingPageLayout: React.FC<LandingPageLayoutProps> = ({ children }) => {
return (
<Layout full direction="row">
{children}
<Layout
full
direction="column"
css={css`
row-gap: 10rem;
background: ${theme.gradient.linear.skyblue};
`}
>
<Header />
<div
css={[
css`
display: grid;
grid-template-columns: auto auto;
milk717 marked this conversation as resolved.
Show resolved Hide resolved
grid-template-rows: 3fr 1fr;
justify-content: space-evenly;
justify-items: center;
align-items: center;
gap: 2rem;
padding: 2rem;
margin: auto 0;

> *:nth-child(3) {
grid-area: 1 / 2 / 3 / 3;
}
`,
LandingPageResponsiveStyles,
]}
>
{children}
</div>
</Layout>
);
};

const LandingPageResponsiveStyles = css`
@media (max-width: 1024px) {
milk717 marked this conversation as resolved.
Show resolved Hide resolved
grid-template-columns: 1fr;
justify-items: start;

> *:nth-child(1) {
grid-area: 1 / 1 / 1 / 2;
}

> *:nth-child(2) {
grid-area: 2 / 1 / 2 / 2;
}

> *:nth-child(3) {
grid-area: 1 / 1 / 3 / 3;
}
}

@media (max-width: 576px) {
justify-items: center;
> *:nth-child(3) {
display: none;
}
}
`;

export default LandingPageLayout;
19 changes: 0 additions & 19 deletions FE/src/components/landingPage/SideBackground.tsx

This file was deleted.

40 changes: 40 additions & 0 deletions FE/src/components/landingPage/StartButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Link } from 'react-router-dom';
import { PATH } from '@constants/path';
import Button from '@foundation/Button/Button';
import { css } from '@emotion/react';
import { theme } from '@styles/theme';

type StartButton = {
milk717 marked this conversation as resolved.
Show resolved Hide resolved
text?: string;
};

const InterviewStartButton: React.FC<StartButton> = ({
text = '비회원으로 시작하기',
milk717 marked this conversation as resolved.
Show resolved Hide resolved
}) => {
// 로그인 여부에 따라 버튼의 문구가 달라집니다.
return (
<div>
<Link to={PATH.INTERVIEW_SETTING}>
<Button
size="lg"
css={css`
position: relative;
padding: 1.5rem 3rem;
border-radius: 3.125rem;
background: ${theme.gradient.linear.blue};
box-shadow: ${theme.shadow.buttonLargeShadow(10)};
z-index: 2;

&:hover {
transform: translateY(4px);
box-shadow: ${theme.shadow.buttonLargeShadow(6)};
}
`}
>
{text}
</Button>
</Link>
</div>
);
};
export default InterviewStartButton;
Loading