chat-dock.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. // ─────────────────────────────────────────────────────────────
  2. // 우측 고정 채팅 도크 (ChatDock) — 색/치수는 토큰 변수만 사용(하드코딩 금지)
  3. // mobile(<1124px): 우측 fixed 드로어 + 플로팅 버튼 / desktop(≥1124px): grid chat 컬럼(접기=레일)
  4. // #chat-room 본체 스타일은 (main)/chat/style.scss 에서 로드(도크가 함께 import)
  5. // ─────────────────────────────────────────────────────────────
  6. .chat-dock {
  7. display: flex;
  8. flex-direction: column;
  9. overflow: hidden;
  10. background: var(--bg-page);
  11. // ── mobile 기본 = 우측 슬라이드 드로어(fixed) ──
  12. position: fixed;
  13. top: var(--header-h, 56px);
  14. right: 0;
  15. width: min(360px, 90vw);
  16. height: calc(100vh - var(--header-h, 56px));
  17. height: calc(100dvh - var(--header-h, 56px));
  18. z-index: 1100;
  19. transform: translateX(100%);
  20. transition: transform 0.3s ease;
  21. border-left: 1px solid var(--border-default);
  22. box-shadow: none;
  23. &--open {
  24. transform: translateX(0);
  25. box-shadow: -4px 0 12px var(--shadow-color);
  26. }
  27. @media (prefers-reduced-motion: reduce) {
  28. transition: none;
  29. }
  30. // ── desktop = grid chat 컬럼(흐름 안) ──
  31. @media (min-width: 1124px) {
  32. position: relative;
  33. grid-area: chat;
  34. top: auto;
  35. right: auto;
  36. width: auto;
  37. height: auto;
  38. z-index: auto;
  39. transform: none;
  40. transition: none;
  41. box-shadow: none;
  42. }
  43. // 본체 래퍼 — #chat-room(height:100%)을 채우도록 flex 채움
  44. &__inner {
  45. display: flex;
  46. flex: 1;
  47. min-height: 0;
  48. }
  49. // 도크 안 #chat-room 은 좁은 폭에 맞춰 패딩·타이포 축소
  50. #chat-room {
  51. flex: 1;
  52. min-width: 0;
  53. padding: var(--sp-3);
  54. padding-bottom: 0;
  55. gap: var(--sp-2);
  56. // 좁은 폭: 참여자 수 버튼 타이포 축소
  57. .chat-room__count {
  58. padding: var(--sp-1);
  59. font-size: var(--fs-xs);
  60. }
  61. }
  62. // 헤더 주입 컨트롤(접기/닫기)
  63. &__ctrl {
  64. display: none;
  65. align-items: center;
  66. justify-content: center;
  67. width: var(--sp-6);
  68. height: var(--sp-6);
  69. border: none;
  70. background: transparent;
  71. color: var(--text-secondary);
  72. font-size: var(--fs-lg);
  73. cursor: pointer;
  74. border-radius: 0; // Twitch 플랫: 헤더 접기/닫기 버튼도 사각 (형제 아이콘 버튼과 일치)
  75. &:hover {
  76. background: var(--bg-icon);
  77. color: var(--text-primary);
  78. }
  79. // desktop: 접기만 노출 / mobile: 닫기만 노출
  80. &--collapse {
  81. @media (min-width: 1124px) {
  82. display: inline-flex;
  83. }
  84. }
  85. &--close {
  86. @media (max-width: 1123.98px) {
  87. display: inline-flex;
  88. }
  89. }
  90. }
  91. // ── 접힘 레일(desktop 전용) — 기본 숨김, --collapsed 에서만 노출 ──
  92. &__rail {
  93. display: none;
  94. flex-direction: column;
  95. align-items: center;
  96. gap: var(--sp-3);
  97. width: 100%;
  98. height: 100%;
  99. padding: var(--sp-4) 0;
  100. border: none;
  101. background: transparent;
  102. color: var(--text-secondary);
  103. cursor: pointer;
  104. &:hover {
  105. color: var(--az-accent);
  106. }
  107. svg {
  108. font-size: var(--fs-xl);
  109. }
  110. }
  111. &__rail-label {
  112. writing-mode: vertical-rl;
  113. text-orientation: upright;
  114. font-size: var(--fs-xs);
  115. letter-spacing: 0.1em;
  116. }
  117. // desktop 접힘: 본체 숨기고 레일 노출
  118. @media (min-width: 1124px) {
  119. &--collapsed {
  120. .chat-dock__inner {
  121. display: none;
  122. }
  123. .chat-dock__rail {
  124. display: flex;
  125. }
  126. }
  127. }
  128. // mobile 에서는 접기(레일) 개념 없음 — 본체 항상 표시
  129. @media (max-width: 1123.98px) {
  130. &__rail {
  131. display: none;
  132. }
  133. .chat-dock__inner {
  134. display: flex;
  135. }
  136. }
  137. }
  138. // ── 모바일 플로팅 토글 버튼(FAB) — desktop 미표시 ──
  139. .chat-dock__fab {
  140. display: none;
  141. position: fixed;
  142. right: 16px;
  143. bottom: 16px;
  144. width: 52px;
  145. height: 52px;
  146. border: none;
  147. border-radius: 50%;
  148. background: var(--az-accent);
  149. color: var(--btn-primary-text);
  150. font-size: var(--fs-xl);
  151. cursor: pointer;
  152. z-index: 1000;
  153. box-shadow: 0 var(--sp-1) var(--sp-4) var(--shadow-color);
  154. @media (max-width: 1123.98px) {
  155. display: inline-flex;
  156. align-items: center;
  157. justify-content: center;
  158. }
  159. &:hover {
  160. background: var(--az-accent-hover);
  161. }
  162. }
  163. // 드로어 열림 시 FAB 숨김(오버레이와 중첩 방지)
  164. .chat-dock--open ~ .chat-dock__fab {
  165. display: none;
  166. }
  167. // ── 모바일 오버레이 ──
  168. .chat-dock__overlay {
  169. display: none;
  170. @media (max-width: 1123.98px) {
  171. position: fixed;
  172. top: var(--header-h, 56px);
  173. left: 0;
  174. right: 0;
  175. bottom: 0;
  176. background: var(--overlay-color);
  177. z-index: 1050;
  178. }
  179. &--visible {
  180. @media (max-width: 1123.98px) {
  181. display: block;
  182. }
  183. }
  184. }