chat-dock.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. gap: var(--sp-2);
  55. // 좁은 폭: 참여자 수 버튼 타이포 축소
  56. .chat-room__count {
  57. padding: var(--sp-1);
  58. font-size: var(--fs-xs);
  59. }
  60. }
  61. // 헤더 주입 컨트롤(접기/닫기)
  62. &__ctrl {
  63. display: none;
  64. align-items: center;
  65. justify-content: center;
  66. width: var(--sp-6);
  67. height: var(--sp-6);
  68. border: none;
  69. background: transparent;
  70. color: var(--text-secondary);
  71. font-size: var(--fs-lg);
  72. cursor: pointer;
  73. border-radius: 0; // Twitch 플랫: 헤더 접기/닫기 버튼도 사각 (형제 아이콘 버튼과 일치)
  74. &:hover {
  75. background: var(--bg-icon);
  76. color: var(--text-primary);
  77. }
  78. // desktop: 접기만 노출 / mobile: 닫기만 노출
  79. &--collapse {
  80. @media (min-width: 1124px) {
  81. display: inline-flex;
  82. }
  83. }
  84. &--close {
  85. @media (max-width: 1123.98px) {
  86. display: inline-flex;
  87. }
  88. }
  89. }
  90. // ── 접힘 레일(desktop 전용) — 기본 숨김, --collapsed 에서만 노출 ──
  91. &__rail {
  92. display: none;
  93. flex-direction: column;
  94. align-items: center;
  95. gap: var(--sp-3);
  96. width: 100%;
  97. height: 100%;
  98. padding: var(--sp-4) 0;
  99. border: none;
  100. background: transparent;
  101. color: var(--text-secondary);
  102. cursor: pointer;
  103. &:hover {
  104. color: var(--az-accent);
  105. }
  106. svg {
  107. font-size: var(--fs-xl);
  108. }
  109. }
  110. &__rail-label {
  111. writing-mode: vertical-rl;
  112. text-orientation: upright;
  113. font-size: var(--fs-xs);
  114. letter-spacing: 0.1em;
  115. }
  116. // desktop 접힘: 본체 숨기고 레일 노출
  117. @media (min-width: 1124px) {
  118. &--collapsed {
  119. .chat-dock__inner {
  120. display: none;
  121. }
  122. .chat-dock__rail {
  123. display: flex;
  124. }
  125. }
  126. }
  127. // mobile 에서는 접기(레일) 개념 없음 — 본체 항상 표시
  128. @media (max-width: 1123.98px) {
  129. &__rail {
  130. display: none;
  131. }
  132. .chat-dock__inner {
  133. display: flex;
  134. }
  135. }
  136. }
  137. // ── 모바일 플로팅 토글 버튼(FAB) — desktop 미표시 ──
  138. .chat-dock__fab {
  139. display: none;
  140. position: fixed;
  141. right: 16px;
  142. bottom: 16px;
  143. width: 52px;
  144. height: 52px;
  145. border: none;
  146. border-radius: 50%;
  147. background: var(--az-accent);
  148. color: var(--btn-primary-text);
  149. font-size: var(--fs-xl);
  150. cursor: pointer;
  151. z-index: 1000;
  152. box-shadow: 0 var(--sp-1) var(--sp-4) var(--shadow-color);
  153. @media (max-width: 1123.98px) {
  154. display: inline-flex;
  155. align-items: center;
  156. justify-content: center;
  157. }
  158. &:hover {
  159. background: var(--az-accent-hover);
  160. }
  161. }
  162. // 드로어 열림 시 FAB 숨김(오버레이와 중첩 방지)
  163. .chat-dock--open ~ .chat-dock__fab {
  164. display: none;
  165. }
  166. // ── 모바일 오버레이 ──
  167. .chat-dock__overlay {
  168. display: none;
  169. @media (max-width: 1123.98px) {
  170. position: fixed;
  171. top: var(--header-h, 56px);
  172. left: 0;
  173. right: 0;
  174. bottom: 0;
  175. background: var(--overlay-color);
  176. z-index: 1050;
  177. }
  178. &--visible {
  179. @media (max-width: 1123.98px) {
  180. display: block;
  181. }
  182. }
  183. }