Skip to content

Commit 8c58f52

Browse files
authored
Merge pull request #14 from DguFarmSystem/feature/10-achievements-layout
feat: Achievements 컴포넌트 레이아웃 1차 완성
2 parents 7a6246f + 6202137 commit 8c58f52

File tree

6 files changed

+350
-5
lines changed

6 files changed

+350
-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
@@ -17,13 +17,16 @@
1717
"react-dom": "^18.3.1",
1818
"react-responsive": "^10.0.0",
1919
"react-router": "^7.1.5",
20+
"react-slick": "^0.30.3",
21+
"slick-carousel": "^1.8.1",
2022
"styled-components": "^6.1.15",
2123
"zustand": "^5.0.3"
2224
},
2325
"devDependencies": {
2426
"@eslint/js": "^9.17.0",
2527
"@types/react": "^18.3.18",
2628
"@types/react-dom": "^18.3.5",
29+
"@types/react-slick": "^0.23.13",
2730
"@vitejs/plugin-react": "^4.3.4",
2831
"eslint": "^9.17.0",
2932
"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:#175321;
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: 14px;
25+
color: #fcfcfc;
26+
`;
27+
28+
export const Description = styled.p`
29+
font-size: 20px;
30+
font-weight: bold;
31+
color: #fcfcfc;
32+
line-height: 1.5;
33+
`;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as S from './AchievementItem.styles';
2+
3+
interface AchievementItemProps {
4+
title: string;
5+
description: string;
6+
imageUrl: string;
7+
}
8+
9+
const AchievementItem: React.FC<AchievementItemProps> = ({ title, description, imageUrl }) => {
10+
return (
11+
<S.ItemContainer>
12+
<S.Image src={imageUrl} alt={title} />
13+
<S.Content>
14+
<S.Title>{title}</S.Title>
15+
<S.Description>{description}</S.Description>
16+
</S.Content>
17+
</S.ItemContainer>
18+
);
19+
};
20+
21+
export default AchievementItem;
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import styled from 'styled-components';
2+
3+
export const AchievementsContainer = styled.div`
4+
width: 100vw;
5+
min-width: 100%;
6+
padding: 60px 0;
7+
text-align: center;
8+
overflow-x: hidden;
9+
`;
10+
export const Title = styled.h2`
11+
font-size: 48px;
12+
color: #191919;
13+
font-weight: bold;
14+
margin-bottom: 40px;
15+
margin-right:670px;
16+
margin-left: 90px;
17+
text-align: left;
18+
`;
19+
20+
export const Highlight = styled.span`
21+
color: #28723f;
22+
`;
23+
24+
export const SliderWrapper = styled.div`
25+
width: 100vw;
26+
position: relative; /* 블러 효과 위치 */
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+
&::before,
49+
&::after {
50+
content: "";
51+
position: absolute;
52+
top: 0;
53+
width: 400px; /* 블러 영역 너비 -> 뷰 포인트에 따라 조절 필요*/
54+
height: 100%;
55+
z-index: 2;
56+
pointer-events: none;
57+
}
58+
59+
&::before {
60+
left: 0;
61+
background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
62+
}
63+
64+
&::after {
65+
right: 0;
66+
background: linear-gradient(to left, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
67+
}
68+
`;
69+
70+
71+
export const StatsContainer = styled.div`
72+
display: flex;
73+
justify-content: center;
74+
gap: 30px;
75+
margin-top: 60px;
76+
flex-wrap: wrap;
77+
`;
78+
79+
const statColors = ["#62de88", "#5ccc7e", "#50b46f", "#48a164"];
80+
81+
export const StatBox = styled.div<{ index: number }>`
82+
width: 270px;
83+
height: 250px;
84+
border-radius: 20px;
85+
background-color: ${({ index }) => statColors[index]}; /* 각 박스마다 다른 색상 적용 */
86+
display: flex;
87+
flex-direction: column;
88+
align-items: center;
89+
justify-content: center;
90+
`;
91+
92+
export const StatNumber = styled.div`
93+
font-size: 48px;
94+
font-weight: bold;
95+
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
96+
color: #fff;
97+
`;
98+
99+
export const StatLabel = styled.div`
100+
font-size: 20px;
101+
font-weight: 500;
102+
color: #fff;
103+
`;

0 commit comments

Comments
 (0)