world-map.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. }
  294. &__grid {
  295. width: 100%;
  296. border-collapse: collapse;
  297. font-size: var(--fs-sm);
  298. font-variant-numeric: tabular-nums;
  299. th {
  300. padding: var(--sp-3);
  301. text-align: right;
  302. font-size: var(--fs-xs);
  303. font-weight: 600;
  304. color: var(--text-muted);
  305. border-bottom: 1px solid var(--border-default);
  306. white-space: nowrap;
  307. }
  308. td {
  309. padding: var(--sp-3);
  310. border-bottom: 1px solid var(--border-light);
  311. white-space: nowrap;
  312. }
  313. }
  314. &__row {
  315. cursor: default;
  316. transition: background 0.1s ease;
  317. &:hover,
  318. &.is-active {
  319. background: var(--bg-subtle-hover);
  320. }
  321. }
  322. &__c-name {
  323. text-align: left;
  324. }
  325. &__c-num {
  326. text-align: right;
  327. }
  328. &__c-time {
  329. text-align: right;
  330. font-size: var(--fs-xs);
  331. color: var(--text-muted);
  332. }
  333. &__c-chart {
  334. text-align: center;
  335. width: 1%;
  336. }
  337. &__c-close {
  338. color: var(--text-primary);
  339. font-weight: 600;
  340. }
  341. &__c-up {
  342. color: var(--price-up);
  343. }
  344. &__c-down {
  345. color: var(--price-down);
  346. }
  347. &__c-flat {
  348. color: var(--price-flat);
  349. }
  350. &__row-country {
  351. font-weight: 700;
  352. color: var(--text-primary);
  353. }
  354. &__row-name {
  355. display: block;
  356. font-size: var(--fs-2xs);
  357. color: var(--text-muted);
  358. }
  359. &__chart-btn {
  360. display: inline-flex;
  361. align-items: center;
  362. justify-content: center;
  363. padding: var(--sp-2);
  364. background: transparent;
  365. border: 1px solid var(--border-default);
  366. border-radius: var(--radius);
  367. color: var(--text-muted);
  368. cursor: pointer;
  369. transition: color 0.12s ease, border-color 0.12s ease;
  370. &:hover {
  371. color: var(--text-link);
  372. border-color: var(--text-link);
  373. }
  374. }
  375. &__empty {
  376. padding: var(--sp-6);
  377. text-align: center;
  378. font-size: var(--fs-sm);
  379. color: var(--text-muted);
  380. }
  381. // ── 차트 모달 (TradingView 드릴다운) ──
  382. &__modal {
  383. position: fixed;
  384. inset: 0;
  385. z-index: 1000;
  386. display: flex;
  387. align-items: center;
  388. justify-content: center;
  389. padding: var(--sp-5);
  390. background: rgba(0, 0, 0, 0.55);
  391. }
  392. &__modal-panel {
  393. display: flex;
  394. flex-direction: column;
  395. width: min(960px, 96vw);
  396. height: min(620px, 88vh);
  397. background: var(--bg-page);
  398. border: 1px solid var(--border-strong);
  399. border-radius: var(--radius);
  400. overflow: hidden;
  401. }
  402. &__modal-head {
  403. display: flex;
  404. align-items: center;
  405. justify-content: space-between;
  406. gap: var(--sp-3);
  407. padding: var(--sp-3) var(--sp-4);
  408. border-bottom: 1px solid var(--border-default);
  409. }
  410. &__modal-title {
  411. font-size: var(--fs-base);
  412. font-weight: 700;
  413. color: var(--text-primary);
  414. }
  415. &__modal-close {
  416. display: inline-flex;
  417. align-items: center;
  418. justify-content: center;
  419. width: 28px;
  420. height: 28px;
  421. background: transparent;
  422. border: none;
  423. border-radius: var(--radius);
  424. font-size: var(--fs-2xl);
  425. line-height: 1;
  426. color: var(--text-muted);
  427. cursor: pointer;
  428. &:hover {
  429. color: var(--text-primary);
  430. background: var(--bg-subtle-hover);
  431. }
  432. }
  433. &__modal-body {
  434. flex: 1;
  435. min-height: 0;
  436. }
  437. &__modal-note {
  438. padding: var(--sp-2) var(--sp-4);
  439. font-size: var(--fs-2xs);
  440. color: var(--text-muted);
  441. text-align: right;
  442. }
  443. }
  444. @keyframes wm-pulse {
  445. 0% {
  446. transform: scale(1);
  447. opacity: 0.5;
  448. }
  449. 100% {
  450. transform: scale(2.6);
  451. opacity: 0;
  452. }
  453. }
  454. @media (prefers-reduced-motion: reduce) {
  455. .world-map__pulse {
  456. animation: none;
  457. opacity: 0;
  458. }
  459. }