world-map.scss 10 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. 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. &__pin-dot {
  179. fill: currentColor;
  180. filter: drop-shadow(0 0 3px currentColor);
  181. transition: r 0.15s ease;
  182. }
  183. &__pin-core {
  184. fill: rgba(255, 255, 255, 0.92);
  185. pointer-events: none;
  186. }
  187. // 확산 링 (상승/하락 핀)
  188. &__pulse {
  189. fill: currentColor;
  190. opacity: 0.5;
  191. transform-box: fill-box;
  192. transform-origin: center;
  193. animation: wm-pulse 2.4s ease-out infinite;
  194. pointer-events: none;
  195. }
  196. &__pin.is-active &__pin-dot {
  197. stroke: rgba(255, 255, 255, 0.9);
  198. stroke-width: 1.5;
  199. }
  200. // 툴팁
  201. &__tip {
  202. position: absolute;
  203. transform: translate(-50%, -128%);
  204. min-width: 132px;
  205. padding: var(--sp-3) var(--sp-4);
  206. background: var(--bg-page);
  207. border: 1px solid var(--border-strong);
  208. border-radius: var(--radius);
  209. box-shadow: 0 var(--sp-2) var(--sp-4) var(--shadow-color);
  210. pointer-events: none;
  211. z-index: 2;
  212. }
  213. &__tip-head {
  214. display: flex;
  215. align-items: baseline;
  216. gap: var(--sp-2);
  217. margin-bottom: var(--sp-2);
  218. }
  219. &__tip-country {
  220. font-size: var(--fs-xs);
  221. font-weight: 700;
  222. color: var(--text-primary);
  223. }
  224. &__tip-name {
  225. font-size: var(--fs-2xs);
  226. color: var(--text-muted);
  227. white-space: nowrap;
  228. }
  229. &__tip-close {
  230. font-size: var(--fs-lg);
  231. font-weight: 700;
  232. font-variant-numeric: tabular-nums;
  233. color: var(--text-primary);
  234. }
  235. &__tip-change {
  236. display: flex;
  237. align-items: baseline;
  238. justify-content: space-between;
  239. gap: var(--sp-3);
  240. margin-top: var(--sp-1);
  241. font-size: var(--fs-sm);
  242. font-weight: 600;
  243. font-variant-numeric: tabular-nums;
  244. &--up {
  245. color: var(--price-up);
  246. }
  247. &--down {
  248. color: var(--price-down);
  249. }
  250. &--flat {
  251. color: var(--price-flat);
  252. }
  253. }
  254. &__tip-exch {
  255. font-size: var(--fs-2xs);
  256. font-weight: 400;
  257. color: var(--text-muted);
  258. }
  259. // ── 지수 패널 ──
  260. &__panel {
  261. display: flex;
  262. flex-direction: column;
  263. min-width: 0;
  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. }
  296. &__grid {
  297. width: 100%;
  298. border-collapse: collapse;
  299. font-size: var(--fs-sm);
  300. font-variant-numeric: tabular-nums;
  301. th {
  302. padding: var(--sp-3);
  303. text-align: right;
  304. font-size: var(--fs-xs);
  305. font-weight: 600;
  306. color: var(--text-muted);
  307. border-bottom: 1px solid var(--border-default);
  308. white-space: nowrap;
  309. }
  310. td {
  311. padding: var(--sp-3);
  312. border-bottom: 1px solid var(--border-light);
  313. white-space: nowrap;
  314. }
  315. }
  316. &__row {
  317. cursor: default;
  318. transition: background 0.1s ease;
  319. &:hover,
  320. &.is-active {
  321. background: var(--bg-subtle-hover);
  322. }
  323. }
  324. &__c-name {
  325. text-align: left;
  326. }
  327. &__c-num {
  328. text-align: right;
  329. }
  330. &__c-time {
  331. text-align: right;
  332. font-size: var(--fs-xs);
  333. color: var(--text-muted);
  334. }
  335. &__c-chart {
  336. text-align: center;
  337. width: 1%;
  338. }
  339. &__c-close {
  340. color: var(--text-primary);
  341. font-weight: 600;
  342. }
  343. &__c-up {
  344. color: var(--price-up);
  345. }
  346. &__c-down {
  347. color: var(--price-down);
  348. }
  349. &__c-flat {
  350. color: var(--price-flat);
  351. }
  352. &__row-country {
  353. font-weight: 700;
  354. color: var(--text-primary);
  355. }
  356. &__row-name {
  357. display: block;
  358. font-size: var(--fs-2xs);
  359. color: var(--text-muted);
  360. }
  361. &__chart-btn {
  362. display: inline-flex;
  363. align-items: center;
  364. justify-content: center;
  365. padding: var(--sp-2);
  366. background: transparent;
  367. border: 1px solid var(--border-default);
  368. border-radius: var(--radius);
  369. color: var(--text-muted);
  370. cursor: pointer;
  371. transition: color 0.12s ease, border-color 0.12s ease;
  372. &:hover {
  373. color: var(--text-link);
  374. border-color: var(--text-link);
  375. }
  376. }
  377. &__empty {
  378. padding: var(--sp-6);
  379. text-align: center;
  380. font-size: var(--fs-sm);
  381. color: var(--text-muted);
  382. }
  383. // ── 차트 모달 (TradingView 드릴다운) ──
  384. &__modal {
  385. position: fixed;
  386. inset: 0;
  387. z-index: 1000;
  388. display: flex;
  389. align-items: center;
  390. justify-content: center;
  391. padding: var(--sp-5);
  392. background: rgba(0, 0, 0, 0.55);
  393. }
  394. &__modal-panel {
  395. display: flex;
  396. flex-direction: column;
  397. width: min(960px, 96vw);
  398. height: min(620px, 88vh);
  399. background: var(--bg-page);
  400. border: 1px solid var(--border-strong);
  401. border-radius: var(--radius);
  402. overflow: hidden;
  403. }
  404. &__modal-head {
  405. display: flex;
  406. align-items: center;
  407. justify-content: space-between;
  408. gap: var(--sp-3);
  409. padding: var(--sp-3) var(--sp-4);
  410. border-bottom: 1px solid var(--border-default);
  411. }
  412. &__modal-title {
  413. font-size: var(--fs-base);
  414. font-weight: 700;
  415. color: var(--text-primary);
  416. }
  417. &__modal-close {
  418. display: inline-flex;
  419. align-items: center;
  420. justify-content: center;
  421. width: 28px;
  422. height: 28px;
  423. background: transparent;
  424. border: none;
  425. border-radius: var(--radius);
  426. font-size: var(--fs-2xl);
  427. line-height: 1;
  428. color: var(--text-muted);
  429. cursor: pointer;
  430. &:hover {
  431. color: var(--text-primary);
  432. background: var(--bg-subtle-hover);
  433. }
  434. }
  435. &__modal-body {
  436. flex: 1;
  437. min-height: 0;
  438. }
  439. &__modal-note {
  440. padding: var(--sp-2) var(--sp-4);
  441. font-size: var(--fs-2xs);
  442. color: var(--text-muted);
  443. text-align: right;
  444. }
  445. }
  446. @keyframes wm-pulse {
  447. 0% {
  448. transform: scale(1);
  449. opacity: 0.5;
  450. }
  451. 100% {
  452. transform: scale(2.6);
  453. opacity: 0;
  454. }
  455. }
  456. @media (prefers-reduced-motion: reduce) {
  457. .world-map__pulse {
  458. animation: none;
  459. opacity: 0;
  460. }
  461. }