world-map.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. // ─────────────────────────────────────────────────────────────
  2. // 메인 세계지도 (WorldMarketMap) — 주요국 증시지수 핀 + 지역 탭 + 데이터 그리드
  3. // d3-geo geoNaturalEarth1 투영 · 국가별 topojson feature 렌더.
  4. // 색은 토큰/반투명 리터럴만(라이트·다크 양립). 등락색 --price-up/down/flat(상승 적/하락 청).
  5. // ─────────────────────────────────────────────────────────────
  6. .world-map {
  7. // 지도 전용 반투명 톤 — 패널 배경 위에 얹혀 양 테마에서 자연스럽게 블렌딩
  8. --az-map-ocean-1: rgba(46, 110, 190, 0.18);
  9. --az-map-ocean-2: rgba(46, 110, 190, 0.03);
  10. --az-map-land: rgba(140, 158, 180, 0.34);
  11. --az-map-land-edge: rgba(150, 168, 190, 0.55);
  12. margin-bottom: var(--sp-6);
  13. &__head {
  14. display: flex;
  15. align-items: center;
  16. justify-content: space-between;
  17. flex-wrap: wrap;
  18. gap: var(--sp-3);
  19. margin-bottom: var(--sp-4);
  20. padding-bottom: var(--sp-3);
  21. border-bottom: 1px solid var(--border-default);
  22. }
  23. &__title {
  24. font-size: var(--fs-lg);
  25. font-weight: 700;
  26. color: var(--text-primary);
  27. }
  28. &__meta {
  29. display: flex;
  30. align-items: center;
  31. gap: var(--sp-4);
  32. font-size: var(--fs-xs);
  33. color: var(--text-muted);
  34. }
  35. &__legend {
  36. display: inline-flex;
  37. align-items: center;
  38. gap: var(--sp-2);
  39. }
  40. &__dot {
  41. display: inline-block;
  42. width: 8px;
  43. height: 8px;
  44. border-radius: 50%;
  45. &--up {
  46. background: var(--price-up);
  47. margin-left: var(--sp-2);
  48. }
  49. &--down {
  50. background: var(--price-down);
  51. margin-left: var(--sp-3);
  52. }
  53. }
  54. &__asof {
  55. font-variant-numeric: tabular-nums;
  56. }
  57. // ── 레이아웃: 지도(넓게) + 지수 패널(우측). 좁은 화면은 세로 스택 ──
  58. &__body {
  59. display: grid;
  60. grid-template-columns: minmax(0, 6fr) minmax(300px, 4fr);
  61. gap: var(--sp-5);
  62. align-items: stretch;
  63. }
  64. @media (max-width: 960px) {
  65. &__body {
  66. grid-template-columns: 1fr;
  67. }
  68. }
  69. // ── 지도 무대 ── (7fr 열을 자연 비율 2:1 로 채움. 광폭 오버랩은 home__inner max-width 로 방지)
  70. &__stage {
  71. position: relative;
  72. width: 100%;
  73. aspect-ratio: 1000 / 500;
  74. min-width: 0;
  75. }
  76. &__svg {
  77. width: 100%;
  78. height: 100%;
  79. display: block;
  80. cursor: grab;
  81. touch-action: none;
  82. &.is-panning {
  83. cursor: grabbing;
  84. }
  85. }
  86. // 줌 컨트롤 (지도 우상단)
  87. &__zoom {
  88. position: absolute;
  89. top: var(--sp-3);
  90. right: var(--sp-3);
  91. display: flex;
  92. flex-direction: column;
  93. gap: var(--sp-2);
  94. }
  95. &__zoom-btn {
  96. width: 28px;
  97. height: 28px;
  98. display: flex;
  99. align-items: center;
  100. justify-content: center;
  101. background: var(--bg-page);
  102. border: 1px solid var(--border-default);
  103. border-radius: var(--radius);
  104. color: var(--text-secondary);
  105. font-size: var(--fs-lg);
  106. line-height: 1;
  107. cursor: pointer;
  108. &:hover {
  109. color: var(--text-primary);
  110. border-color: var(--border-strong);
  111. }
  112. }
  113. // 상시 핀 라벨 (국가명 + 등락률) — 지도 위 가독 위해 배경색 헤일로(paint-order stroke)
  114. &__label {
  115. pointer-events: none;
  116. }
  117. &__label-name {
  118. font-size: 12px;
  119. font-weight: 700;
  120. fill: var(--text-primary);
  121. stroke: var(--bg-page);
  122. stroke-width: 3px;
  123. paint-order: stroke;
  124. vector-effect: non-scaling-stroke;
  125. }
  126. &__label-rate {
  127. font-size: 12px;
  128. font-weight: 700;
  129. font-variant-numeric: tabular-nums;
  130. stroke: var(--bg-page);
  131. stroke-width: 3px;
  132. paint-order: stroke;
  133. vector-effect: non-scaling-stroke;
  134. &--up {
  135. fill: var(--price-up);
  136. }
  137. &--down {
  138. fill: var(--price-down);
  139. }
  140. &--flat {
  141. fill: var(--price-flat);
  142. }
  143. }
  144. &__label-close {
  145. font-size: 10px;
  146. font-weight: 600;
  147. font-variant-numeric: tabular-nums;
  148. fill: var(--text-secondary);
  149. stroke: var(--bg-page);
  150. stroke-width: 3px;
  151. paint-order: stroke;
  152. vector-effect: non-scaling-stroke;
  153. }
  154. // 대륙 (국가별 topojson feature path)
  155. &__land path {
  156. fill: var(--az-map-land);
  157. stroke: var(--az-map-land-edge);
  158. stroke-width: 0.4;
  159. stroke-linejoin: round;
  160. vector-effect: non-scaling-stroke;
  161. }
  162. // 핀 — 그룹 color 로 방향색 상속, dot/pulse 는 currentColor
  163. &__pin {
  164. cursor: pointer;
  165. outline: none;
  166. &--up {
  167. color: var(--price-up);
  168. }
  169. &--down {
  170. color: var(--price-down);
  171. }
  172. &--flat {
  173. color: var(--price-flat);
  174. }
  175. }
  176. // map-pin 막대 (지점 → 머리)
  177. &__pin-stem {
  178. stroke: currentColor;
  179. stroke-width: 2;
  180. stroke-linecap: round;
  181. opacity: 0.65;
  182. vector-effect: non-scaling-stroke;
  183. }
  184. // map-pin 머리 (방향색 + 흰 테두리 + 그림자로 부양감)
  185. &__pin-head {
  186. fill: currentColor;
  187. stroke: rgba(255, 255, 255, 0.9);
  188. stroke-width: 1.5;
  189. vector-effect: non-scaling-stroke;
  190. filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45));
  191. transition: r 0.15s ease;
  192. }
  193. &__pin.is-active &__pin-head {
  194. stroke-width: 2.5;
  195. }
  196. // 툴팁
  197. &__tip {
  198. position: absolute;
  199. transform: translate(-50%, -128%);
  200. min-width: 132px;
  201. padding: var(--sp-3) var(--sp-4);
  202. background: var(--bg-page);
  203. border: 1px solid var(--border-strong);
  204. border-radius: var(--radius);
  205. box-shadow: 0 var(--sp-2) var(--sp-4) var(--shadow-color);
  206. pointer-events: none;
  207. z-index: 2;
  208. }
  209. &__tip-head {
  210. display: flex;
  211. align-items: baseline;
  212. gap: var(--sp-2);
  213. margin-bottom: var(--sp-2);
  214. }
  215. &__tip-country {
  216. font-size: var(--fs-xs);
  217. font-weight: 700;
  218. color: var(--text-primary);
  219. }
  220. &__tip-name {
  221. font-size: var(--fs-2xs);
  222. color: var(--text-muted);
  223. white-space: nowrap;
  224. }
  225. &__tip-close {
  226. font-size: var(--fs-lg);
  227. font-weight: 700;
  228. font-variant-numeric: tabular-nums;
  229. color: var(--text-primary);
  230. }
  231. &__tip-change {
  232. display: flex;
  233. align-items: baseline;
  234. justify-content: space-between;
  235. gap: var(--sp-3);
  236. margin-top: var(--sp-1);
  237. font-size: var(--fs-sm);
  238. font-weight: 600;
  239. font-variant-numeric: tabular-nums;
  240. &--up {
  241. color: var(--price-up);
  242. }
  243. &--down {
  244. color: var(--price-down);
  245. }
  246. &--flat {
  247. color: var(--price-flat);
  248. }
  249. }
  250. &__tip-exch {
  251. font-size: var(--fs-2xs);
  252. font-weight: 400;
  253. color: var(--text-muted);
  254. }
  255. // ── 지수 패널 (회색 카드 — 지도는 페이지 배경 위, 배경은 이 패널에만) ──
  256. &__panel {
  257. display: flex;
  258. flex-direction: column;
  259. min-width: 0;
  260. padding: var(--sp-4);
  261. background: var(--bg-elevated);
  262. border: 1px solid var(--border-default);
  263. border-radius: var(--radius);
  264. }
  265. // 지역 탭 (언더라인 스타일)
  266. &__tabs {
  267. display: flex;
  268. flex-wrap: wrap;
  269. gap: var(--sp-2);
  270. border-bottom: 1px solid var(--border-default);
  271. margin-bottom: var(--sp-2);
  272. }
  273. &__tab {
  274. padding: var(--sp-3) var(--sp-4);
  275. background: transparent;
  276. border: none;
  277. border-bottom: 2px solid transparent;
  278. margin-bottom: -1px;
  279. font-size: var(--fs-sm);
  280. font-weight: 600;
  281. color: var(--text-muted);
  282. cursor: pointer;
  283. transition: color 0.12s ease, border-color 0.12s ease;
  284. &:hover {
  285. color: var(--text-secondary);
  286. }
  287. &.is-active {
  288. color: var(--text-primary);
  289. border-bottom-color: var(--text-link);
  290. }
  291. }
  292. // 데이터 그리드 (세로 스크롤 — 행 많으면 스크롤). 모바일/세로스택 폴백 높이.
  293. &__grid-wrap {
  294. overflow-x: auto;
  295. overflow-y: auto;
  296. max-height: 460px;
  297. }
  298. // ── 2열(≥961px): 패널 높이를 지도(aspect-ratio) 높이에 정확히 일치 ──
  299. // contain:size → 패널 내용(탭+표)이 grid 행 높이를 부풀리지 않음 → 지도가 행 높이를 결정하고
  300. // 패널은 stretch 로 동일 높이. 패널 내부는 grid(탭 auto + 표 1fr)로 표가 남는 높이를 채우며 스크롤.
  301. // (전 해상도 연속 적용 — home__inner max-width:1600 로 QHD 에서도 지도 높이 유한)
  302. @media (min-width: 961px) {
  303. &__panel {
  304. display: grid;
  305. grid-template-rows: auto minmax(0, 1fr);
  306. contain: size;
  307. min-height: 0;
  308. }
  309. &__grid-wrap {
  310. max-height: none;
  311. min-height: 0;
  312. }
  313. }
  314. &__grid {
  315. width: 100%;
  316. border-collapse: collapse;
  317. font-size: var(--fs-sm);
  318. font-variant-numeric: tabular-nums;
  319. th {
  320. position: sticky;
  321. top: 0;
  322. padding: var(--sp-3);
  323. text-align: right;
  324. font-size: var(--fs-xs);
  325. font-weight: 600;
  326. color: var(--text-muted);
  327. background: var(--bg-elevated);
  328. border-bottom: 1px solid var(--border-default);
  329. white-space: nowrap;
  330. z-index: 1;
  331. }
  332. td {
  333. padding: var(--sp-3);
  334. border-bottom: 1px solid var(--border-light);
  335. white-space: nowrap;
  336. }
  337. }
  338. &__row {
  339. cursor: pointer;
  340. transition: background 0.1s ease;
  341. &:hover,
  342. &.is-active {
  343. background: var(--bg-subtle-hover);
  344. }
  345. }
  346. &__c-name {
  347. text-align: left;
  348. }
  349. &__c-num {
  350. text-align: right;
  351. }
  352. &__c-time {
  353. text-align: right;
  354. font-size: var(--fs-xs);
  355. color: var(--text-muted);
  356. }
  357. &__c-close {
  358. color: var(--text-primary);
  359. font-weight: 600;
  360. }
  361. &__c-up {
  362. color: var(--price-up);
  363. }
  364. &__c-down {
  365. color: var(--price-down);
  366. }
  367. &__c-flat {
  368. color: var(--price-flat);
  369. }
  370. &__row-country {
  371. font-weight: 700;
  372. color: var(--text-primary);
  373. }
  374. &__row-name {
  375. display: block;
  376. font-size: var(--fs-2xs);
  377. color: var(--text-muted);
  378. }
  379. &__empty {
  380. padding: var(--sp-6);
  381. text-align: center;
  382. font-size: var(--fs-sm);
  383. color: var(--text-muted);
  384. }
  385. // ── 차트 모달 (TradingView 드릴다운) ──
  386. &__modal {
  387. position: fixed;
  388. inset: 0;
  389. z-index: 1000;
  390. display: flex;
  391. align-items: center;
  392. justify-content: center;
  393. padding: var(--sp-5);
  394. background: rgba(0, 0, 0, 0.55);
  395. }
  396. &__modal-panel {
  397. display: flex;
  398. flex-direction: column;
  399. width: min(960px, 96vw);
  400. height: min(620px, 88vh);
  401. background: var(--bg-page);
  402. border: 1px solid var(--border-strong);
  403. border-radius: var(--radius);
  404. overflow: hidden;
  405. }
  406. &__modal-head {
  407. display: flex;
  408. align-items: center;
  409. justify-content: space-between;
  410. gap: var(--sp-3);
  411. padding: var(--sp-3) var(--sp-4);
  412. border-bottom: 1px solid var(--border-default);
  413. }
  414. &__modal-title {
  415. font-size: var(--fs-base);
  416. font-weight: 700;
  417. color: var(--text-primary);
  418. }
  419. &__modal-close {
  420. display: inline-flex;
  421. align-items: center;
  422. justify-content: center;
  423. width: 28px;
  424. height: 28px;
  425. background: transparent;
  426. border: none;
  427. border-radius: var(--radius);
  428. font-size: var(--fs-2xl);
  429. line-height: 1;
  430. color: var(--text-muted);
  431. cursor: pointer;
  432. &:hover {
  433. color: var(--text-primary);
  434. background: var(--bg-subtle-hover);
  435. }
  436. }
  437. &__modal-body {
  438. flex: 1;
  439. min-height: 0;
  440. }
  441. &__modal-note {
  442. padding: var(--sp-2) var(--sp-4);
  443. font-size: var(--fs-2xs);
  444. color: var(--text-muted);
  445. text-align: right;
  446. }
  447. }
  448. @keyframes wm-pulse {
  449. 0% {
  450. transform: scale(1);
  451. opacity: 0.5;
  452. }
  453. 100% {
  454. transform: scale(2.6);
  455. opacity: 0;
  456. }
  457. }
  458. @media (prefers-reduced-motion: reduce) {
  459. .world-map__pulse {
  460. animation: none;
  461. opacity: 0;
  462. }
  463. }