Skip to content

Commit 88ac8c5

Browse files
committed
feat: Achievements 컴포넌트 레이아웃 1차 완성
- react-slick 라이브러리 사용하여 좌우슬라이딩 구현
1 parent 857a37a commit 88ac8c5

File tree

6 files changed

+316
-5
lines changed

6 files changed

+316
-5
lines changed

package-lock.json

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
"react": "^18.3.1",
1616
"react-dom": "^18.3.1",
1717
"react-router": "^7.1.5",
18+
"react-slick": "^0.30.3",
19+
"slick-carousel": "^1.8.1",
1820
"styled-components": "^6.1.15",
1921
"zustand": "^5.0.3"
2022
},
2123
"devDependencies": {
2224
"@eslint/js": "^9.17.0",
2325
"@types/react": "^18.3.18",
2426
"@types/react-dom": "^18.3.5",
27+
"@types/react-slick": "^0.23.13",
2528
"@vitejs/plugin-react": "^4.3.4",
2629
"eslint": "^9.17.0",
2730
"eslint-plugin-react-hooks": "^5.0.0",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import styled from 'styled-components';
2+
3+
export const ItemContainer = styled.div`
4+
width: 400px;
5+
height: 400px;
6+
background-color: #ffffff;
7+
border-radius: 10px;
8+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
9+
overflow: hidden;
10+
text-align: center;
11+
`;
12+
13+
export const Image = styled.img`
14+
width: 100%;
15+
height: 180px;
16+
object-fit: cover;
17+
`;
18+
19+
export const Content = styled.div`
20+
padding: 20px;
21+
`;
22+
23+
export const Title = styled.h3`
24+
font-size: 20px;
25+
font-weight: bold;
26+
color: #191919;
27+
`;
28+
29+
export const Description = styled.p`
30+
font-size: 16px;
31+
color: #555555;
32+
line-height: 1.5;
33+
`;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import * as S from './AchievementItem.styles';
3+
4+
interface AchievementItemProps {
5+
title: string;
6+
description: string;
7+
imageUrl: string;
8+
}
9+
10+
const AchievementItem: React.FC<AchievementItemProps> = ({ title, description, imageUrl }) => {
11+
return (
12+
<S.ItemContainer>
13+
<S.Image src={imageUrl} alt={title} />
14+
<S.Content>
15+
<S.Title>{title}</S.Title>
16+
<S.Description>{description}</S.Description>
17+
</S.Content>
18+
</S.ItemContainer>
19+
);
20+
};
21+
22+
export default AchievementItem;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import styled from 'styled-components';
2+
3+
export const AchievementsContainer = styled.div`
4+
width: 100vw;
5+
min-width: 100%;
6+
background-color: #fcfcfc;
7+
padding: 60px 0;
8+
text-align: center;
9+
overflow-x: hidden;
10+
`;
11+
export const Title = styled.h2`
12+
font-size: 48px;
13+
color: #191919;
14+
font-weight: bold;
15+
margin-bottom: 40px;
16+
margin-right:670px;
17+
margin-left: 90px;
18+
text-align: left;
19+
`;
20+
21+
export const Highlight = styled.span`
22+
color: #28723f;
23+
`;
24+
25+
export const SliderWrapper = styled.div`
26+
width: 100vw;
27+
overflow: visible;
28+
29+
.slick-list {
30+
width: 100vw;
31+
margin: 0;
32+
padding: 20px 0;
33+
min-height: auto; /* 높이를 자동으로 조절 -> QA 후 일부 조정 필요요 */
34+
}
35+
36+
.slick-track {
37+
display: flex;
38+
align-items: stretch;
39+
}
40+
41+
.slick-slide {
42+
display: flex;
43+
justify-content: center;
44+
overflow: visible;
45+
}
46+
`;
47+
48+
export const StatsContainer = styled.div`
49+
display: flex;
50+
justify-content: center;
51+
gap: 30px;
52+
margin-top: 60px;
53+
flex-wrap: wrap;
54+
`;
55+
56+
export const StatBox = styled.div`
57+
width: 270px;
58+
height: 250px;
59+
border-radius: 20px;
60+
background-color: #62de88;
61+
display: flex;
62+
flex-direction: column;
63+
align-items: center;
64+
justify-content: center;
65+
`;
66+
67+
export const StatNumber = styled.div`
68+
font-size: 48px;
69+
font-weight: bold;
70+
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
71+
`;
72+
73+
export const StatLabel = styled.div`
74+
font-size: 20px;
75+
font-weight: 500;
76+
`;

0 commit comments

Comments
 (0)