Skip to content

Commit 4d90ca3

Browse files
committed
Fix: 채팅 관련 UI 수정
1 parent 00b5544 commit 4d90ca3

File tree

2 files changed

+153
-62
lines changed

2 files changed

+153
-62
lines changed

src/components/ChatRoom.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ const ChatRoom = ({ roomId: propRoomId, onLeaveRoom, refreshRooms }) => {
707707
className="send-btn"
708708
disabled={!newMessage.trim() || actionInProgress || !connected}
709709
>
710-
<i className="fa-solid fa-paper-plane">전송</i>
710+
<i className="fa-solid fa-paper-plane"></i>
711+
전송
711712
</button>
712713
</form>
713714
</div>

src/components/ChatStyles.css

Lines changed: 151 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -189,53 +189,41 @@
189189
}
190190

191191
/* 채팅 생성 버튼 */
192-
.create-room-btn {
193-
position: fixed;
194-
bottom: 20px;
195-
left: 150px;
196-
width: 50px;
197-
height: 50px;
198-
border-radius: 50%;
199-
background-color: var(--white);
200-
border: 2px solid var(--primary-green);
201-
color: var(--primary-green);
192+
.create-room-btn,
193+
.refresh-btn {
194+
position: static;
195+
/* Remove fixed positioning */
196+
width: auto;
197+
/* Remove fixed width */
198+
height: auto;
199+
/* Remove fixed height */
200+
border-radius: 20px;
201+
/* Rounded corners but not circular */
202+
background-color: var(--primary-green);
203+
color: var(--white);
202204
display: flex;
203-
justify-content: center;
204205
align-items: center;
205-
font-size: 24px;
206+
justify-content: center;
207+
padding: 8px 15px;
206208
cursor: pointer;
207-
z-index: 10;
208-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
209+
font-size: 14px;
210+
font-weight: 500;
211+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
212+
transition: all 0.2s ease;
213+
border: none;
209214
}
210215

211-
.create-room-btn:hover {
212-
background-color: var(--primary-green);
213-
color: var(--white);
216+
.create-room-btn i,
217+
.refresh-btn i {
218+
margin-right: 5px;
219+
font-size: 16px;
214220
}
215221

216-
/* 새로고침 버튼 */
217-
.refresh-btn {
218-
position: fixed;
219-
bottom: 80px;
220-
left: 150px;
221-
width: 50px;
222-
height: 50px;
223-
border-radius: 50%;
224-
background-color: var(--white);
225-
border: 2px solid var(--primary-green);
226-
color: var(--primary-green);
227-
display: flex;
228-
justify-content: center;
229-
align-items: center;
230-
font-size: 20px;
231-
cursor: pointer;
232-
z-index: 10;
233-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
234-
}
235222

223+
.create-room-btn:hover,
236224
.refresh-btn:hover {
237-
background-color: var(--primary-green);
238-
color: var(--white);
225+
transform: translateY(-2px);
226+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
239227
}
240228

241229
/* 채팅방 생성 폼 */
@@ -368,8 +356,10 @@
368356
.chat-messages {
369357
flex: 1;
370358
padding: 20px;
371-
overflow-y: auto; /* 세로 스크롤 적용 */
372-
max-height: calc(100vh - 180px); /* 채팅 입력창과 헤더를 제외한 높이로 설정 */
359+
overflow-y: auto;
360+
/* 세로 스크롤 적용 */
361+
max-height: calc(100vh - 180px);
362+
/* 채팅 입력창과 헤더를 제외한 높이로 설정 */
373363
display: flex;
374364
flex-direction: column;
375365
}
@@ -380,8 +370,10 @@
380370
display: flex;
381371
flex-direction: column;
382372
background-color: var(--light-green);
383-
height: 100%; /* 전체 높이 사용 */
384-
overflow: hidden; /* 넘치는 부분 숨김 */
373+
height: 100%;
374+
/* 전체 높이 사용 */
375+
overflow: hidden;
376+
/* 넘치는 부분 숨김 */
385377
}
386378

387379
/* 날짜 구분선 */
@@ -516,11 +508,11 @@
516508
.chat-input {
517509
display: flex;
518510
align-items: center;
519-
padding: 15px;
520-
background-color: #222;
521-
/* 전체 입력 영역 배경색 변경 */
511+
padding: 15px 20px;
512+
background-color: #2a2a2a;
513+
/* 배경색 약간 밝게 조정 */
522514
border-top: 1px solid #444;
523-
/* 경계선 색상 변경 */
515+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
524516
}
525517

526518
/* 버튼 색상도 조정 */
@@ -538,40 +530,105 @@
538530
.chat-input input {
539531
flex: 1;
540532
border: none;
541-
padding: 10px;
533+
padding: 12px 16px;
542534
font-size: 15px;
543535
outline: none;
544536
color: white;
545-
/* 글자색을 흰색으로 변경 */
546-
background-color: #222;
547-
/* 이미 검은색 배경이라면 배경색은 그대로 유지하거나 약간 밝게 */
548-
border-radius: 5px;
549-
/* 입력창에 둥근 모서리 추가 */
537+
background-color: #333;
538+
/* 입력창 배경색 */
539+
border-radius: 20px;
540+
/* 더 둥근 모서리 */
541+
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
542+
transition: all 0.2s ease;
543+
margin-right: 10px;
544+
}
545+
546+
.chat-input input:focus {
547+
background-color: #3a3a3a;
548+
/* 포커스 시 약간 밝은 배경 */
549+
box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(63, 178, 127, 0.3);
550550
}
551551

552552
/* 플레이스홀더 텍스트 색상도 변경 */
553553
.chat-input input::placeholder {
554554
color: #aaa;
555-
/* 흐린 회색으로 설정 */
556555
}
557556

558557
.chat-input .send-btn {
559-
width: 40px;
560-
height: 40px;
561-
border-radius: 50%;
562558
background-color: var(--primary-green);
563559
color: white;
564560
border: none;
561+
border-radius: 20px;
562+
/* 둥근 모서리 */
563+
padding: 10px 20px;
564+
font-size: 15px;
565+
font-weight: 500;
566+
cursor: pointer;
567+
transition: all 0.2s ease;
565568
display: flex;
566-
justify-content: center;
567569
align-items: center;
568-
cursor: pointer;
569-
margin-left: 10px;
570+
justify-content: center;
571+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
572+
}
573+
574+
.chat-input .send-btn i {
575+
margin-right: 5px;
576+
font-size: 16px;
577+
}
578+
579+
.chat-input .send-btn:hover {
580+
background-color: #45c28d;
581+
/* 호버 시 더 밝은 녹색 */
582+
transform: translateY(-2px);
583+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
584+
}
585+
586+
.chat-input .send-btn:active {
587+
transform: translateY(0);
588+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
570589
}
571590

572591
.chat-input .send-btn:disabled {
573-
background-color: var(--medium-gray);
592+
background-color: #555;
593+
color: #999;
574594
cursor: not-allowed;
595+
transform: none;
596+
box-shadow: none;
597+
}
598+
599+
/* 반응형 디자인 */
600+
@media (max-width: 768px) {
601+
.chat-input {
602+
padding: 12px 15px;
603+
}
604+
605+
.chat-input input {
606+
padding: 10px 14px;
607+
font-size: 14px;
608+
}
609+
610+
.chat-input .send-btn {
611+
padding: 8px 15px;
612+
font-size: 14px;
613+
}
614+
}
615+
616+
@media (max-width: 576px) {
617+
.chat-input {
618+
padding: 10px;
619+
}
620+
621+
.chat-input input {
622+
padding: 8px 12px;
623+
}
624+
625+
.chat-input .send-btn {
626+
padding: 8px 12px;
627+
}
628+
629+
.chat-input .send-btn i {
630+
margin-right: 0;
631+
}
575632
}
576633

577634
.chat-content-area {
@@ -648,7 +705,8 @@
648705
}
649706

650707
.chat-list-container {
651-
width: 260px;
708+
position: relative;
709+
/* For absolute positioning of buttons */
652710
}
653711

654712
.create-room-btn {
@@ -732,4 +790,36 @@
732790

733791
.empty-state p {
734792
margin: 10px 0;
793+
}
794+
795+
.chat-action-buttons {
796+
position: absolute;
797+
top: 15px;
798+
right: 20px;
799+
display: flex;
800+
gap: 10px;
801+
z-index: 10;
802+
}
803+
804+
@media (max-width: 768px) {
805+
.chat-action-buttons {
806+
top: 10px;
807+
right: 10px;
808+
gap: 5px;
809+
}
810+
811+
.create-room-btn,
812+
.refresh-btn {
813+
padding: 6px 12px;
814+
font-size: 13px;
815+
}
816+
}
817+
818+
/* For mobile layouts */
819+
@media (max-width: 576px) {
820+
.chat-action-buttons {
821+
top: 70px;
822+
/* Adjust based on your mobile header height */
823+
right: 10px;
824+
}
735825
}

0 commit comments

Comments
 (0)