world-map.scss 10 KB

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