Skip to content

Commit d968cf3

Browse files
feat: 약속 참여 api 호출 및 애니메이션 추가 (#48)
## #️⃣연관된 이슈 > ex) #이슈번호, #이슈번호 ## 📝작업 내용 > 이번 PR에서 작업한 내용을 간략히 설명해주세요 ### 스크린샷 (선택) ## 💬리뷰 요구사항(선택) > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
1 parent 1a96435 commit d968cf3

File tree

10 files changed

+472
-272
lines changed

10 files changed

+472
-272
lines changed

frontend/src/App.css

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,38 @@ body, html, #root {
88
}
99

1010
.appLayout {
11-
display: flex;
11+
--sidebar-width: 120px;
12+
display: grid;
13+
grid-template-columns: var(--sidebar-width) 1fr;
14+
min-height: 100vh;
15+
transition: grid-template-columns 0.45s ease;
16+
}
17+
18+
.appLayout.sidebar-open {
19+
--sidebar-width: 360px;
1220
}
1321

1422
.content {
15-
flex: 1;
23+
width: 100%;
24+
min-width: 0;
25+
transition: margin 0.45s ease, padding 0.45s ease;
26+
}
27+
28+
.appLayout.sidebar-animating .content {
29+
opacity: 0.65;
30+
}
31+
32+
.page-transition {
33+
opacity: 0;
34+
animation: fadeIn 0.55s ease forwards;
35+
}
36+
37+
@keyframes fadeIn {
38+
from {
39+
opacity: 0;
40+
}
41+
42+
to {
43+
opacity: 1;
44+
}
1645
}

frontend/src/AppLayout.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Outlet } from "react-router-dom";
1+
import { Outlet, useLocation } from "react-router-dom";
22
import { useEffect, useMemo, useState } from "react";
33

44
import SidebarLeft from "./components/SidebarLeft";
@@ -13,12 +13,14 @@ import { API_BASE_URL } from "./config/api";
1313
export default function AppLayout() {
1414
// 약속 데이터 목록 상태
1515
const [sidebarEvents, setSidebarEvents] = useState([]);
16+
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
1617

1718
// 에러 메시지 상태
1819
const [error, setError] = useState("");
1920

2021
// 로그인 토큰
2122
const token = useMemo(() => localStorage.getItem("access_token"), []);
23+
const location = useLocation();
2224

2325
useEffect(() => {
2426
const fetchAppointments = async () => {
@@ -58,10 +60,18 @@ export default function AppLayout() {
5860
fetchAppointments();
5961
}, [token]);
6062

63+
const layoutClass = `appLayout ${isSidebarOpen ? "sidebar-open" : "sidebar-closed"}`;
64+
6165
return (
62-
<div className="appLayout">
63-
<SidebarLeft events={sidebarEvents} />
64-
<Outlet className="content" />
66+
<div className={layoutClass}>
67+
<SidebarLeft
68+
events={sidebarEvents}
69+
isOpen={isSidebarOpen}
70+
onToggle={setIsSidebarOpen}
71+
/>
72+
<div key={location.pathname} className="content page-transition">
73+
<Outlet />
74+
</div>
6575
</div>
6676
);
6777
}

frontend/src/components/Calendar.css

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/ 캘린더 전체 레이아웃 & 공통 스타일 /
33
/ ---------------------------------------------------- */
44
.calendar-container {
5-
background-color: #FAFFF2;
5+
background-color: #FDFDF8 !important;
66
border-radius: 12px;
77
padding: 24px;
88
display: flex;
@@ -44,7 +44,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
4444

4545
.view-toggle-buttons {
4646
display: flex;
47-
background: #EAEEE0;
47+
background: #E9E9E3;
4848
border-radius: 20px;
4949
padding: 5px;
5050
}
@@ -61,7 +61,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
6161
}
6262

6363
.view-toggle-buttons button.active {
64-
background: #FAFFF2;
64+
background: #FDFDF8;
6565
box-shadow: 0px 3px 3px rgba(118, 113, 113, 0.07);
6666
}
6767

@@ -75,7 +75,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
7575
width: 50px;
7676
height: 50px;
7777
padding: 12px;
78-
background: #EAEEE0;
78+
background: #E9E9E3;
7979
border-radius: 15px;
8080
color: #85837B;
8181
font-size: 20px;
@@ -92,7 +92,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
9292
padding: 10px 18px;
9393
background: #1F1F1F;
9494
border-radius: 15px;
95-
color: #FAFFF2;
95+
color: #E9E9E3;
9696
font-size: 15px;
9797
border: none;
9898
cursor: pointer;
@@ -132,7 +132,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
132132
justify-content: flex-start;
133133
overflow: hidden;
134134
align-items: flex-start;
135-
background-color: #FAFFF2;
135+
background-color: #FDFDF8;
136136
}
137137

138138
/* 날짜 번호 */
@@ -235,7 +235,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
235235

236236
/* 과거/오늘/미래 이벤트 색상 */
237237
.past-event {
238-
background: #EAEEE0;
238+
background: #E9E9E3;
239239
color: #C4C5B7 !important;
240240
}
241241

@@ -249,7 +249,7 @@ button, .custom-header span, .fc-col-header-cell-cushion {
249249
color: #FFFFFF !important;
250250
}
251251

252-
.past-event .event-title, .past-event .event-time-start { color: #C4C5B7 !important; }
252+
.past-event .event-title, .past-event .event-time-start { color: #E9E9E3 !important; }
253253
.today-event .event-title, .today-event .event-time-start { color: #FFFFFF !important; }
254254
.future-event .event-title, .future-event .event-time-start { color: #FFFFFF !important; }
255255

@@ -355,13 +355,13 @@ button, .custom-header span, .fc-col-header-cell-cushion {
355355
/* 헤더 고정 */
356356
.fc-timegrid-header {
357357
top: 0;
358-
background-color: #FAFFF2;
358+
background-color: #FDFDF8;
359359
z-index: 10;
360360
}
361361

362362
.fc-col-header,
363363
.fc-col-header table {
364-
background-color: #FAFFF2;
364+
background-color: #FDFDF8;
365365
}
366366

367367

@@ -509,6 +509,24 @@ button, .custom-header span, .fc-col-header-cell-cushion {
509509
color: inherit !important;
510510
}
511511

512+
.calendar-surface {
513+
position: relative;
514+
}
515+
516+
.fade-swap {
517+
opacity: 0;
518+
animation: calendarSoftFade 0.55s ease forwards;
519+
}
520+
521+
@keyframes calendarSoftFade {
522+
from {
523+
opacity: 0;
524+
}
525+
526+
to {
527+
opacity: 1;
528+
}
529+
}
512530

513531

514532

0 commit comments

Comments
 (0)