Skip to content

Commit a02a6c7

Browse files
authored
Merge pull request #113 from DMU-DebugVisual/inseong2
UI 및 기능 일괄개선 2차
2 parents e5868b3 + 3cf3e21 commit a02a6c7

29 files changed

+1026
-910
lines changed

src/App.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ html, body, #root {
77
width: 100% !important; /* 너비를 100%로 설정 */
88
height: 100% !important; /* 높이를 100%로 설정 */
99
overflow: hidden !important; /* 불필요한 스크롤 방지 */
10-
background-color: #f8f9fa !important; /* 기본 배경색 (라이트 모드) */
10+
background-color: var(--surface-body) !important; /* 기본 배경색 (라이트 모드) */
11+
color: var(--text-primary);
1112
}
1213

1314
/* 다크 모드일 때 body 배경색 변경 */
1415
body.dark-mode {
15-
background-color: #1e1e1e !important; /* 다크 모드 배경색 */
16+
background-color: var(--surface-body) !important; /* 다크 모드 배경색 */
17+
color: var(--text-primary);
1618
}
1719

1820
/* Flexbox 레이아웃을 위한 래퍼 스타일 (이전 App.js 수정에서 사용) */

src/api/globalFetch.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,44 @@ const originalFetch = window.fetch;
77

88
// 2. window.fetch 함수를 우리의 감시 기능이 추가된 새 함수로 덮어씁니다.
99
window.fetch = async (...args) => {
10+
const [resource] = args;
11+
const request = resource instanceof Request ? resource : null;
12+
const rawUrl = request ? request.url : (typeof resource === "string" ? resource : "");
13+
14+
let pathname = "";
15+
if (typeof rawUrl === "string" && rawUrl) {
16+
try {
17+
pathname = new URL(rawUrl, window.location.origin).pathname;
18+
} catch (error) {
19+
pathname = rawUrl;
20+
}
21+
}
22+
1023
// 3. 백업해둔 원래 fetch 함수를 호출하여 실제 API 요청을 보냅니다.
1124
const response = await originalFetch(...args);
1225

26+
const isJoinParticipantsRequest =
27+
response.status === 403 &&
28+
typeof pathname === "string" &&
29+
pathname.includes("/api/collab/rooms/") &&
30+
pathname.endsWith("/participants");
31+
1332
// 4. 응답을 받은 후, 인증 실패(401/403)가 발생했다면
1433
if ((response.status === 401 || response.status === 403) && localStorage.getItem("token")) {
34+
if (isJoinParticipantsRequest) {
35+
return response;
36+
}
1537
localStorage.removeItem("token");
1638
localStorage.removeItem("username");
1739
localStorage.removeItem("userId");
1840
localStorage.removeItem("role");
1941

2042
window.dispatchEvent(new Event("dv:auth-updated"));
2143

22-
const redirectTo = window.location.hash ? window.location.hash.replace(/^#/, "") || "/" : window.location.pathname || "/";
44+
let redirectTo = window.location.hash ? window.location.hash.replace(/^#/, "") || "/" : window.location.pathname || "/";
45+
if (redirectTo.startsWith("/broadcast/live")) {
46+
redirectTo = "/broadcast";
47+
}
2348
promptLogin("세션이 만료되었습니다. 다시 로그인해 주세요.", { redirectTo });
2449
}
2550

src/components/codecast/Codecast.css

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
.broadcast-container {
2-
background-color: #ffffff;
2+
background-color: var(--surface-page);
33
min-height: 100vh;
44
display: flex; /* 가운데 정렬용 */
55
justify-content: center; /* 가로 가운데 */
66
align-items: center; /* 세로 가운데 */
77
flex-direction: column; /* 위아래 배치 */
88
padding: 20px; /* 좌우만 여백 */
99
text-align: center;
10+
color: var(--text-primary);
1011
}
1112

1213
.broadcast-header {
@@ -15,7 +16,7 @@
1516

1617
.broadcast-icon {
1718
font-size: 48px;
18-
color: #7a52c6;
19+
color: var(--accent-primary);
1920
}
2021

2122
.broadcast-header h2 {
@@ -25,18 +26,19 @@
2526
}
2627

2728
.broadcast-header p {
28-
color: #555;
29+
color: var(--text-muted);
2930
font-size: 16px;
3031
line-height: 1.5;
3132
}
3233

3334
.broadcast-card {
3435
margin: 0 auto;
35-
background-color: white;
36+
background-color: var(--surface-card);
3637
padding: 40px 30px;
3738
border-radius: 12px;
3839
max-width: 550px;
39-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* 테두리와 그림자 병행 */
40+
box-shadow: 0 20px 46px rgba(24, 20, 56, 0.12); /* 테두리와 그림자 병행 */
41+
border: 1px solid var(--border-subtle);
4042

4143
}
4244

@@ -49,7 +51,7 @@
4951

5052
.broadcast-card p {
5153
font-size: 14px;
52-
color: #666;
54+
color: var(--text-muted);
5355
margin-bottom: 10px;
5456
text-align: left;
5557
}
@@ -62,13 +64,15 @@
6264
.input-group input {
6365
flex: 1;
6466
padding: 10px 14px;
65-
border: 1px solid #ccc;
67+
border: 1px solid var(--border-subtle);
6668
border-radius: 8px;
6769
font-size: 14px;
70+
background-color: var(--surface-input);
71+
color: var(--text-primary);
6872
}
6973

7074
.input-group button {
71-
background-color: #a78bfa;
75+
background-color: var(--accent-primary);
7276
color: white;
7377
border: none;
7478
padding: 10px 16px;
@@ -78,6 +82,11 @@
7882
align-items: center;
7983
gap: 6px;
8084
font-weight: bold;
85+
transition: background-color 0.2s ease;
86+
}
87+
88+
.input-group button:hover {
89+
background-color: var(--accent-hover);
8190
}
8291

8392
.error-text {
@@ -92,33 +101,34 @@
92101
border: none;
93102
padding: 10px 16px;
94103
border-radius: 8px;
95-
background-color: #7a52c6;
104+
background-color: var(--accent-secondary);
96105
display: flex;
97106
justify-content: center;
98107
gap: 6px;
99108
font-weight: bold;
100109
text-decoration: none;
101110
font-size: 15px;
111+
transition: background-color 0.2s ease;
102112
}
103113

104114
.start-btn:hover {
105-
background-color: #6b42bb;
115+
background-color: var(--accent-hover);
106116
}
107117

108118
.hr-with-text {
109119
display: flex;
110120
align-items: center;
111121
text-align: center;
112122
margin: 24px 0;
113-
color: #999;
123+
color: var(--text-muted);
114124
font-size: 14px;
115125
}
116126

117127
.hr-with-text::before,
118128
.hr-with-text::after {
119129
content: "";
120130
flex: 1;
121-
border-top: 1px solid #ddd;
131+
border-top: 1px solid var(--border-subtle);
122132
margin: 0 12px;
123133
}
124134

@@ -134,15 +144,17 @@
134144
margin-bottom: 6px;
135145
text-align: left;
136146
font-size: 14px;
137-
color: #333;
147+
color: var(--text-primary);
138148
}
139149

140150
.start-input-group input {
141151
flex: 1;
142152
padding: 10px 14px;
143-
border: 1px solid #ccc;
153+
border: 1px solid var(--border-subtle);
144154
border-radius: 8px;
145155
font-size: 14px;
156+
background-color: var(--surface-input);
157+
color: var(--text-primary);
146158
}
147159

148160
.required {
@@ -152,84 +164,85 @@
152164

153165
.help-text {
154166
font-size: 12px;
155-
color: #888;
167+
color: var(--text-muted);
156168
margin-top: 6px;
157169
text-align: left;
158170
}
159171

160172
/* 🌙 전체 배경 */
161173
.dark-mode .broadcast-container {
162-
background-color: #1e1e1e;
163-
color: #f0f0f0;
174+
background-color: var(--surface-page);
175+
color: var(--text-primary);
164176
}
165177

166178
/* 🌙 아이콘 */
167179
.dark-mode .broadcast-icon {
168-
color: #6a0dad;
180+
color: var(--accent-primary);
169181
}
170182

171183
/* 🌙 설명 텍스트 */
172184
.dark-mode .broadcast-header p {
173-
color: #cccccc;
185+
color: var(--text-muted);
174186
}
175187

176188
/* 🌙 카드 배경 */
177189
.dark-mode .broadcast-card {
178-
background-color: #2a2a2a;
179-
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
190+
background-color: var(--surface-card);
191+
border-color: var(--border-subtle);
192+
box-shadow: 0 24px 48px rgba(24, 20, 56, 0.18);
180193
}
181194

182195
/* 🌙 카드 내부 텍스트 */
183196
.dark-mode .broadcast-card p {
184-
color: #bbbbbb;
197+
color: var(--text-muted);
185198
}
186199

187200
/* 🌙 인풋 */
188201
.dark-mode .input-group input,
189202
.dark-mode .start-input-group input {
190-
background-color: #1e1e1e;
191-
color: #f0f0f0;
192-
border: 1px solid #555;
203+
background-color: var(--surface-input);
204+
color: var(--text-primary);
205+
border: 1px solid var(--border-subtle);
193206
}
194207

195208
/* 🌙 참여 버튼 */
196209
.dark-mode .input-group button {
197-
background-color: #6a0dad;
210+
background-color: var(--accent-secondary);
198211
color: white;
199212
}
200213

201214
.dark-mode .input-group button:hover {
202-
background-color: #5a0099;
215+
background-color: var(--accent-hover);
203216
}
204217

205218
/* 🌙 새 방송 시작 버튼 */
206219
.dark-mode .start-btn {
207-
background-color: #6a0dad;
220+
background-color: var(--accent-secondary);
208221
color: white;
209222
}
210223

211224
.dark-mode .start-btn:hover {
212-
background-color: #5a0099;
225+
background-color: var(--accent-hover);
213226
}
214227

215228
/* 🌙 구분선 */
216229
.dark-mode .hr-with-text {
217-
color: #aaa;
230+
color: var(--text-muted);
218231
}
219232

220233
.dark-mode .hr-with-text::before,
221234
.dark-mode .hr-with-text::after {
222-
border-top: 1px solid #444;
235+
border-top: 1px solid var(--border-subtle);
223236
}
224237

225238
/* 🌙 폼 라벨 */
226239
.dark-mode .start-input-group label {
227-
color: #ddd;
240+
color: var(--text-primary);
228241
}
229242

230243
/* 🌙 헬프 텍스트 */
231244
.dark-mode .help-text {
232-
color: #aaa;
245+
color: var(--text-muted);
233246
}
234247

235248
/* 🌙 필수 표시 */

0 commit comments

Comments
 (0)