/
spirzen
/
it-knowledge-base
Обзор
Документация
Войти
/
spirzen
/
it-knowledge-base
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components/UniverseMap.module.css
508 строк
10 KB
Spirzen
Refactor - design, search, styles
01 июн 2026, 16:08
01 июн 2026, 16:08
840a53a
Код
Авторство
О чём код?
/* Цвета разделов (дублируют index.module.css для автономности карты) */ :root { --section-1-bg: #f8f9ff; --section-2-bg: #f9f8fb; --section-3-bg: #f6fcf8; --section-4-bg: #fff7f5; --section-5-bg: #f5f9ff; --section-6-bg: #fdf8f0; --section-7-bg: #f7f5fa; --section-8-bg: #f0f9f4; --section-9-bg: #fff2f8; --section-1-border: #4a6cf7; --section-2-border: #7b61ff; --section-3-border: #2e8b57; --section-4-border: #d2691e; --section-5-border: #1e90ff; --section-6-border: #d2b48c; --section-7-border: #9370db; --section-8-border: #32cd32; --section-9-border: #ff69b4; } html[data-theme='dark'] { --section-1-bg: #1a1d2e; --section-2-bg: #1d1c24; --section-3-bg: #1a221f; --section-4-bg: #241e1c; --section-5-bg: #1a1f2e; --section-6-bg: #221f18; --section-7-bg: #1f1d23; --section-8-bg: #18221d; --section-9-bg: #241a20; --section-1-border: #6a8cff; --section-2-border: #9b81ff; --section-3-border: #4ecb8d; --section-4-border: #e68a4e; --section-5-border: #4eb3ff; --section-6-border: #e6c99c; --section-7-border: #b390ff; --section-8-border: #5ae65a; --section-9-border: #ff8ac4; } .universeMap { padding: 3rem 0 4rem; background: linear-gradient( 180deg, color-mix(in srgb, var(--ifm-color-primary) 8%, var(--ifm-background-color)) 0%, var(--ifm-background-color) 65% ); } html[data-theme='dark'] .universeMap { background: linear-gradient( 180deg, #1a1528 0%, var(--ifm-background-color) 65% ); } .title { text-align: center; font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--ifm-color-content); } .subtitle { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; font-size: 1.1rem; line-height: 1.55; color: var(--ifm-color-content-secondary); } .layout { display: grid; gap: 2rem; align-items: start; } @media screen and (min-width: 996px) { .layout { grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: 2.5rem; } .mapPanel { position: sticky; top: calc(var(--ifm-navbar-height, 60px) + 1rem); align-self: start; } } .mapPanel { min-width: 0; } .mapCanvas { position: relative; width: min(92vw, 540px); max-width: 540px; margin: 0 auto; aspect-ratio: 1; contain: layout style paint; } .mapSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow( 0 0 24px color-mix(in srgb, var(--ifm-color-primary) 35%, transparent) ); } .orbitRingGlow { fill: none; stroke: color-mix(in srgb, var(--ifm-color-primary) 12%, transparent); stroke-width: 0.5; } .orbitRing { fill: none; stroke: url(#universe-orbit-ring); stroke-width: 0.9; } .orbitRingInner { fill: none; stroke: color-mix(in srgb, var(--ifm-color-primary) 18%, transparent); stroke-width: 0.35; stroke-dasharray: 1.5 3; } .hub { position: absolute; left: 50%; top: 50%; transform: translate3d(-50%, -50%, 0); z-index: 2; display: flex; align-items: center; justify-content: center; width: 24%; aspect-ratio: 1; min-width: 4rem; max-width: 5.75rem; border-radius: 50%; text-decoration: none; color: #fff; background: linear-gradient( 145deg, var(--ifm-color-primary) 0%, var(--ifm-color-primary-dark) 100% ); box-shadow: 0 0 50px color-mix(in srgb, var(--ifm-color-primary) 45%, transparent), inset 0 0 20px rgba(255, 255, 255, 0.12); animation: universeCorePulse 4s ease-in-out infinite; transition: transform 0.2s ease; } @keyframes universeCorePulse { 50% { box-shadow: 0 0 70px color-mix(in srgb, var(--ifm-color-primary) 55%, transparent), inset 0 0 28px rgba(255, 255, 255, 0.18); } } .hub:hover { transform: translate3d(-50%, -50%, 0) scale(1.05); color: #fff; text-decoration: none; } .hubLabel { font-size: clamp(0.85rem, 2.5vw, 1.1rem); font-weight: 800; line-height: 1.2; text-align: center; } .node { position: absolute; left: calc(50% + var(--orbit-x)); top: calc(50% + var(--orbit-y)); transform: translate3d(-50%, -50%, 0); z-index: 3; display: flex; align-items: center; justify-content: center; width: 3.35rem; height: 3.35rem; padding: 0; border-radius: 50%; text-decoration: none; border: 1px solid var(--ifm-color-emphasis-300); background: var(--ifm-background-surface-color); color: var(--ifm-color-content); box-shadow: 0 2px 10px color-mix(in srgb, var(--ifm-color-emphasis-300) 40%, transparent); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease; } .node:hover { transform: translate3d(-50%, -50%, 0) scale(1.1); text-decoration: none; border-color: var(--node-border, var(--ifm-color-primary)); background: var(--node-border, var(--ifm-color-primary)); color: #fff; box-shadow: 0 0 20px color-mix(in srgb, var(--node-border, var(--ifm-color-primary)) 45%, transparent); } .node:focus-visible { outline: 2px solid var(--ifm-color-primary); outline-offset: 2px; } .nodeActive { transform: translate3d(-50%, -50%, 0) scale(1.1); z-index: 4; border-color: var(--node-border, var(--ifm-color-primary)); background: var(--node-border, var(--ifm-color-primary)); color: #fff; box-shadow: 0 0 20px color-mix(in srgb, var(--node-border, var(--ifm-color-primary)) 50%, transparent); } .nodeNumber { font-size: 0.88rem; font-weight: 700; line-height: 1; } .roadmapLink { margin: 0.75rem 0 0; text-align: center; font-size: 0.9rem; } .roadmapLink a { font-weight: 600; } .detailPanel { display: flex; flex-direction: column; gap: 1.25rem; } .detailCard { padding: 1.5rem; border-radius: var(--ifm-global-radius); border: 1px solid var(--ifm-color-emphasis-300); border-left: 5px solid var(--node-border, var(--ifm-color-primary)); background: var(--node-bg, var(--ifm-card-background-color)); box-shadow: var(--ifm-global-shadow-md); min-height: 15.5rem; transition: border-color 0.2s ease, background-color 0.2s ease; } .detailBadge { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--node-border, var(--ifm-color-primary)); margin-bottom: 0.5rem; } .detailTitle { margin: 0 0 0.75rem; font-size: 1.35rem; min-height: 2.75rem; } .detailText { margin: 0 0 1.25rem; line-height: 1.55; color: var(--ifm-color-content-secondary); font-size: 0.95rem; min-height: 4.65em; } .detailActions { display: flex; flex-wrap: wrap; gap: 0.75rem; } .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; max-height: 280px; overflow-y: auto; } .legendItem { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 2.35rem; padding: 0.45rem 0.65rem; border: 1px solid transparent; border-left-width: 3px; border-radius: var(--ifm-global-radius); background: transparent; cursor: pointer; font-size: 0.85rem; font-weight: 500; text-align: left; color: var(--ifm-color-content); transition: background 0.15s ease, border-color 0.15s ease; } .legendItem:hover, .legendItem:focus-visible { background: var(--node-bg, var(--ifm-color-emphasis-100)); border-color: var(--ifm-color-emphasis-300); border-left-color: var(--node-border, var(--ifm-color-emphasis-400)); outline: none; } .legendItemActive { background: var(--node-bg, var(--ifm-color-emphasis-100)); border-color: var(--ifm-color-emphasis-300); border-left-color: var(--node-border, var(--ifm-color-primary)); } .legendNum { flex-shrink: 0; width: 1.4rem; height: 1.4rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--node-border, var(--ifm-color-primary)); } .legendLabel { flex: 1; min-width: 0; line-height: 1.3; } /* Цвета разделов — совпадают с главной (index.module.css) */ .node--1, .detailCard--1, .legendItem--1 { --node-bg: var(--section-1-bg); --node-border: var(--section-1-border); } .node--2, .detailCard--2, .legendItem--2 { --node-bg: var(--section-2-bg); --node-border: var(--section-2-border); } .node--3, .detailCard--3, .legendItem--3 { --node-bg: var(--section-3-bg); --node-border: var(--section-3-border); } .node--4, .detailCard--4, .legendItem--4 { --node-bg: var(--section-4-bg); --node-border: var(--section-4-border); } .node--5, .detailCard--5, .legendItem--5 { --node-bg: var(--section-5-bg); --node-border: var(--section-5-border); } .node--6, .detailCard--6, .legendItem--6 { --node-bg: var(--section-6-bg); --node-border: var(--section-6-border); } .node--7, .detailCard--7, .legendItem--7 { --node-bg: var(--section-7-bg); --node-border: var(--section-7-border); } .node--8, .detailCard--8, .legendItem--8 { --node-bg: var(--section-8-bg); --node-border: var(--section-8-border); } .node--9, .detailCard--9, .legendItem--9 { --node-bg: var(--section-9-bg); --node-border: var(--section-9-border); } @media screen and (max-width: 995px) { .title { font-size: 2rem; } .subtitle { font-size: 1rem; margin-bottom: 1.75rem; } .layout { grid-template-columns: 1fr; } .mapPanel { position: static; } .mapCanvas { width: min(94vw, 400px); max-width: 400px; } .node { width: clamp(3.1rem, 11vw, 3.65rem); height: clamp(3.1rem, 11vw, 3.65rem); } .nodeNumber { font-size: clamp(0.82rem, 2.8vw, 0.95rem); } .hub { min-width: 3.75rem; max-width: 5.25rem; } .detailPanel { max-width: 520px; margin: 0 auto; } .legend { max-height: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; } } @media screen and (max-width: 576px) { .universeMap { padding: 2rem 0 3rem; } .mapCanvas { width: min(96vw, 340px); max-width: 340px; } .node { width: clamp(3.2rem, 12.5vw, 3.75rem); height: clamp(3.2rem, 12.5vw, 3.75rem); } .legend { grid-template-columns: 1fr; } .detailActions { flex-direction: column; } .detailActions :global(.button) { width: 100%; } } @media (prefers-reduced-motion: reduce) { .hub { animation: none; } .hub, .node, .legendItem { transition: none; } }