Skip to content

Commit 654e6b9

Browse files
authored
#92 [fix] 메인 하단 UI 수정
* fix: 메인 하단 UI 수정 * refactor: ServiceExplainSection 내 컴퍼넌트 분리
1 parent dceb555 commit 654e6b9

8 files changed

Lines changed: 134 additions & 76 deletions

File tree

src/assets/images/ClickingLike.png

99 KB
Loading
15.7 KB
Loading
29.4 KB
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
3+
interface FeatureCardProps {
4+
emoji: string
5+
title: string
6+
description: string
7+
isExpanded: boolean
8+
onClick: () => void
9+
}
10+
11+
const FeatureCard: React.FC<FeatureCardProps> = ({
12+
emoji,
13+
title,
14+
description,
15+
isExpanded,
16+
onClick
17+
}) => {
18+
return (
19+
<div
20+
className={`w-full group relative bg-gradient-to-b from-white to-lightBeige rounded-3xl p-6 text-center overflow-hidden transition-all duration-500 shadow-lg flex-1 self-start cursor-pointer ${isExpanded ? 'pb-20 shadow-xl' : ''}`}
21+
style={{ boxShadow: '0 10px 25px rgba(226, 95, 71, 0.3)' }}
22+
onClick={onClick}
23+
>
24+
<div className="text-4xl mb-4">{emoji}</div>
25+
<h3 className="text-lg sm:text-xl md:text-2xl text-mainColor font-mainFont mb-4">
26+
{title}
27+
</h3>
28+
<div className={`absolute bottom-0 left-0 right-0 bg-mainColor bg-opacity-90 text-white p-4 transition-transform duration-500 ${isExpanded ? 'translate-y-0' : 'translate-y-full'}`}>
29+
<p className="text-sm font-gothicFont leading-relaxed">
30+
{description}
31+
</p>
32+
</div>
33+
</div>
34+
)
35+
}
36+
37+
export default FeatureCard
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react'
2+
3+
interface PointCardProps {
4+
title: string
5+
imageUrl: string
6+
description: string
7+
}
8+
9+
const PointCard: React.FC<PointCardProps> = ({
10+
title,
11+
imageUrl,
12+
description
13+
}) => {
14+
return (
15+
<div className="flex flex-col items-start hover:scale-105 duration-300 flex-1">
16+
<div className="flex flex-col items-start">
17+
<h4 className="text-md font-mainFont text-white text-center mb-2 bg-mainColor rounded-full py-1.5 px-4 inline-block">
18+
{title}
19+
</h4>
20+
</div>
21+
<div
22+
className="rounded-2xl w-full md:h-50 h-32 text-white shadow-md bg-cover bg-center bg-no-repeat"
23+
style={{ backgroundImage: `url(${imageUrl})` }}
24+
/>
25+
<p className="text-sm text-mainGray font-gothicFont mt-2">{description}</p>
26+
</div>
27+
)
28+
}
29+
30+
export default PointCard

src/common/components/ServiceExplainCard.tsx

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

src/common/components/ServiceExplainSection.tsx

Lines changed: 64 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,79 @@
1-
import React from 'react'
2-
3-
import ServiceExplainCard from './ServiceExplainCard'
1+
import React, { useState } from 'react'
2+
import NightSkyDrawing from '@/assets/images/NightSkyDrawing.png'
3+
import CommentWriting from '@/assets/images/CommentWriting.png'
4+
import ClickLike from '@/assets/images/ClickingLike.png'
5+
import FeatureCard from './FeatureCard'
6+
import PointCard from './PointCard'
47

58
const ServiceExplainSection: React.FC = () => {
9+
const [expandedCard, setExpandedCard] = useState<string | null>(null)
610
return (
7-
<section className="relative w-full max-w-[1920px] mx-auto px-4 md:px-8 lg:px-12">
8-
{/* 제목 */}
9-
<h2 className="text-xl sm:text-2xl md:text-3xl text-center text-mainColor font-mainFont mt-20 mb-20 relative z-10">
10-
달토끼엔 이런 기능들이 있어요
11-
</h2>
12-
13-
{/* 별 배경 이미지 */}
14-
<div className="absolute inset-0 w-full h-80% mt-40 z-index-0">
15-
<img
16-
src="/images/MoonRabbitStars.png"
17-
alt="달토끼 별 배경"
18-
className="w-full h-full object-cover"
19-
loading="lazy"
20-
/>
11+
<section className="relative w-full max-w-[1920px] mx-auto px-4 md:px-8 lg:px-12 py-20 md:my-16">
12+
{/* 달토끼 게시판 역할 */}
13+
<div className="mb-8">
14+
<h2 className="text-2xl md:text-4xl text-right text-mainColor font-mainFont leading-tight">
15+
달토끼와 같이 고민을 나눠요
16+
</h2>
17+
<p className="text-base sm:text-lg md:text-xl text-lightWalnut font-mainFont mt-2 text-right">
18+
마음이 답답한데 어디에도 털어놓지 못하고 있다면, 달토끼에게 털어놓아보세요.
19+
</p>
2120
</div>
2221

23-
{/* 카드 */}
24-
<div className="relative">
25-
<ServiceExplainCard
22+
<div className="flex flex-col md:flex-row gap-8 md:mb-40 mb-20 items-start">
23+
<FeatureCard
24+
emoji="🌙"
2625
title="밤하늘"
27-
subtitle={`밤하늘은 자유롭게 고민을 나누는 곳이에요.\n여러 고민들을 보고 얘기를 나눌 수 있어요.`}
28-
backgroundImage="/shooting-star-2024127-1920-1.png"
26+
description="자유롭게 고민을 나누는 곳이에요. 여러 고민들을 보고 얘기를 나눌 수 있어요."
27+
isExpanded={expandedCard === 'night-sky'}
28+
onClick={() => setExpandedCard(expandedCard === 'night-sky' ? null : 'night-sky')}
2929
/>
30-
</div>
31-
32-
<div className="relative mt-20">
33-
<ServiceExplainCard
30+
<FeatureCard
31+
emoji="⭐"
3432
title="별자리"
35-
subtitle={`별자리는 마음에 닿는 플리를 추천해주는 공간이에요.\n지금 당신에게 어울리는 작은 위로를 찾아보세요.`}
36-
backgroundImage="/shooting-star-2024127-1920-1.png"
33+
description="마음에 닿는 플리를 추천해주는 공간이에요. 지금 당신에게 어울리는 작은 위로를 찾아보세요."
34+
isExpanded={expandedCard === 'constellation'}
35+
onClick={() => setExpandedCard(expandedCard === 'constellation' ? null : 'constellation')}
3736
/>
38-
</div>
39-
40-
<div className="relative mt-20 mb-20">
41-
<ServiceExplainCard
37+
<FeatureCard
38+
emoji="💭"
4239
title="오늘의 질문"
43-
subtitle={`오늘의 질문은 매일매일 바뀌는 질문에 답을 하며 스스로에게 말을 걸어보는 시간이에요.\n내 마음을 천천히 들여다보는 작은 계기를 놓치지 마세요.`}
44-
backgroundImage="/shooting-star-2024127-1920-1.png"
40+
description="매일매일 바뀌는 질문에 답을 하며 스스로에게 말을 걸어보는 시간이에요."
41+
isExpanded={expandedCard === 'daily-question'}
42+
onClick={() => setExpandedCard(expandedCard === 'daily-question' ? null : 'daily-question')}
4543
/>
4644
</div>
45+
46+
{/* 신뢰도 */}
47+
<div className="w-full">
48+
<div>
49+
<div className="text-left mb-8">
50+
<h3 className="text-2xl md:text-4xl text-mainColor font-mainFont mb-2">
51+
신뢰도를 쌓아 포인트를 얻어요
52+
</h3>
53+
<p className="text-base sm:text-lg text-lightWalnut font-mainFont">
54+
여러 활동을 통해 포인트를 얻고 내 프로필을 꾸며보세요!
55+
</p>
56+
</div>
57+
58+
<div className="flex flex-col md:flex-row gap-8 w-full">
59+
<PointCard
60+
title="밤하늘 그리기"
61+
imageUrl={NightSkyDrawing}
62+
description="모두와 고민을 공유하기만 해도 포인트를 얻을 수 있어요"
63+
/>
64+
<PointCard
65+
title="댓글 달기"
66+
imageUrl={CommentWriting}
67+
description="다른 사람의 고민에 공감과 위로의 답변을 달아요"
68+
/>
69+
<PointCard
70+
title="좋아요 받기"
71+
imageUrl={ClickLike}
72+
description="내 댓글에 좋아요가 달리면 포인트가 올라요"
73+
/>
74+
</div>
75+
</div>
76+
</div>
4777
</section>
4878
)
4979
}

src/common/components/ServiceIntro.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import React from 'react'
33
const ServiceIntro: React.FC = () => {
44
return (
55
<section className="w-full max-w-[1920px] mx-auto px-4 md:px-8 lg:px-12">
6-
<h2 className="text-xl sm:text-2xl md:text-3xl text-center text-mainColor font-mainFont mt-20 mb-6">
6+
<h2 className="text-2xl md:text-4xl text-center text-mainColor font-mainFont mt-12 md:mt-30 mb-6">
77
달토끼 서비스 소개
88
</h2>
99

1010
<div
1111
className="
12-
relative w-full mt-20
12+
relative w-full mt-8 md:mt-16
1313
max-h-[720px]
1414
rounded-[20px] border-[3px] sm:border-[4px] md:border-[5px]
1515
border-solid border-mainColor
@@ -25,7 +25,7 @@ const ServiceIntro: React.FC = () => {
2525
"
2626
>
2727
{/* 텍스트 */}
28-
<p className="font-gothicFont ml-10 leading-relaxed tracking-tight text-mainBlack text-sm sm:text-base md:text-lg lg:text-xl xl:text-3xl lg:text-left max-w-[720px] lg:max-w-[50%] lg:order-1">
28+
<p className="font-gothicFont ml-0 xl:ml-10 leading-relaxed tracking-tight text-mainBlack text-sm sm:text-base md:text-lg lg:text-xl xl:text-3xl lg:text-left max-w-[720px] lg:max-w-[50%] lg:order-1">
2929
<span className="block text-mainColor">
3030
달토끼는 서로의 마음을 조용히 안아주는 고민 상담 커뮤니티예요.
3131
</span>

0 commit comments

Comments
 (0)