Skip to content

Commit c90b76e

Browse files
authored
🎨 style: css파일 -> module.scss로 변경, 반응형 구현
🎨 (style): css파일 -> module.scss로 변경, 반응형 구현
2 parents 2346133 + dfb2b1c commit c90b76e

File tree

3 files changed

+144
-139
lines changed

3 files changed

+144
-139
lines changed

src/pages/Home/Home.css

Lines changed: 0 additions & 95 deletions
This file was deleted.

src/pages/Home/Home.jsx

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
1-
import './Home.css';
2-
import '../../assets/images/img_01.png';
3-
import '../../assets/images/img_02.png';
1+
import styles from './Home.module.scss';
2+
import img01 from '../../assets/images/img_01.png';
3+
import img02 from '../../assets/images/img_02.png';
4+
import Button from '../../components/common/Button';
5+
import { useNavigate } from 'react-router-dom';
46

57
export default function Home() {
8+
const navigate = useNavigate();
9+
610
return (
7-
<>
8-
<div className="header-box"></div>
9-
<section>
10-
<div className="intro-box first-section">
11-
<div className="intro-left">
12-
<div className="point-badge">Point.01</div>
13-
<h2 className="intro-title">
14-
누구나 손쉽게, 온라인
15-
<br />
16-
롤링 페이퍼를 만들 수 있어요
17-
</h2>
18-
<p className="intro-subtext">로그인 없이 자유롭게 만들어요.</p>
19-
</div>
20-
<div>
21-
<img
22-
src="/src/assets/images/img_01.png"
23-
className="intro-image"
24-
alt="롤링 이미지"
25-
/>
26-
</div>
11+
<div className={styles.homeWrapper}>
12+
<section className={`${styles.sectionBox} ${styles.rightImage}`}>
13+
<img
14+
src={img01}
15+
alt="롤링페이퍼 이미지"
16+
className={styles.sectionImage}
17+
/>
18+
<div className={styles.textBox}>
19+
<div className={styles.pointBadge}>Point.01</div>
20+
<h2 className={styles.title}>
21+
누구나 손쉽게, 온라인
22+
<br />
23+
롤링 페이퍼를 만들 수 있어요
24+
</h2>
25+
<p className={styles.subtext}>로그인 없이 자유롭게 만들어요.</p>
2726
</div>
2827
</section>
29-
<section>
30-
<div className="intro-box second-section">
31-
<div>
32-
<div className="point-badge">Point.02</div>
33-
<h2 className="intro-title">
34-
서로에게 이모지로 감정을
35-
<br />
36-
표현해주세요
37-
</h2>
38-
<p className="intro-subtext">
39-
롤링 페이퍼에 이모지를 추가할 수 있어요.
40-
</p>
41-
</div>
42-
<div>
43-
<img
44-
src="/src/assets/images/img_02.png"
45-
className="intro-image"
46-
alt="이모지 이미지"
47-
/>
48-
</div>
28+
29+
<section className={`${styles.sectionBox} ${styles.leftImage}`}>
30+
<img src={img02} alt="이모지 이미지" className={styles.sectionImage} />
31+
<div className={styles.textBox}>
32+
<div className={styles.pointBadge}>Point.02</div>
33+
<h2 className={styles.title}>
34+
서로에게 이모지로 감정을
35+
<br />
36+
표현해주세요
37+
</h2>
38+
<p className={styles.subtext}>
39+
롤링 페이퍼에 이모지를 추가할 수 있어요.
40+
</p>
4941
</div>
5042
</section>
51-
</>
43+
44+
<div className={styles.buttonWrapper}>
45+
<Button text="구경해보기" onClick={() => navigate()} />
46+
</div>
47+
</div>
5248
);
5349
}

src/pages/Home/Home.module.scss

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
.homeWrapper {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
gap: 40px;
6+
padding: 80px 0;
7+
}
8+
9+
.sectionBox {
10+
display: flex;
11+
align-items: center;
12+
background-color: #f6f8ff;
13+
border-radius: 16px;
14+
width: 1200px;
15+
height: 324px;
16+
padding: 40px 60px;
17+
box-sizing: border-box;
18+
}
19+
20+
.leftImage {
21+
flex-direction: row;
22+
}
23+
24+
.rightImage {
25+
flex-direction: row-reverse;
26+
}
27+
28+
.sectionImage {
29+
width: 720px;
30+
height: 204px;
31+
object-fit: contain;
32+
}
33+
34+
.textBox {
35+
display: flex;
36+
flex-direction: column;
37+
gap: 12px;
38+
width: 360px;
39+
}
40+
41+
.pointBadge {
42+
background-color: #9935ff;
43+
color: #fff;
44+
font-size: 14px;
45+
font-weight: 600;
46+
padding: 6px 12px;
47+
border-radius: 50px;
48+
width: fit-content;
49+
}
50+
51+
.title {
52+
font-size: 24px;
53+
font-weight: 700;
54+
line-height: 36px;
55+
color: #181818;
56+
}
57+
58+
.subtext {
59+
font-size: 18px;
60+
font-weight: 400;
61+
line-height: 28px;
62+
color: #555;
63+
}
64+
65+
.buttonWrapper {
66+
margin-top: 40px;
67+
}
68+
69+
@media (max-width: 1247px) {
70+
.sectionBox {
71+
width: 100%;
72+
padding: 40px 32px;
73+
}
74+
.homeWrapper {
75+
padding: 60px 0;
76+
}
77+
}
78+
79+
@media (max-width: 767px) {
80+
.homeWrapper {
81+
padding: 40px 0;
82+
padding-inline: 24px;
83+
}
84+
85+
.sectionBox {
86+
flex-direction: column;
87+
height: auto;
88+
padding: 32px 24px;
89+
gap: 24px;
90+
}
91+
92+
.sectionImage {
93+
width: 100%;
94+
height: auto;
95+
}
96+
97+
.textBox {
98+
width: 100%;
99+
}
100+
101+
.buttonWrapper {
102+
width: 100%;
103+
}
104+
}

0 commit comments

Comments
 (0)