Files
SHiNE-server/shine-UI/styles/network-graph.css
T
q edc3d50136 Касания: подсветка наведения больше не залипает на телефоне
На сенсорном экране :hover после касания остаётся на элементе: после перехода в настройках
строка под пальцем выглядела выбранной, кнопка «назад» на следующем экране – нажатой.
Все правила с :hover (77) теперь внутри @media (hover: hover): с мышью всё как было, на
телефоне подсветки наведения нет. Чтобы нажатие оставалось заметным, там, где у элемента не
было своего :active, а наведение меняло только цвет, фон или рамку, тот же вид получает
:active (46 правил: строки настроек, кнопки шапки, строки уведомлений, поиск и т. д.).
Порядок правил и специфичность не менялись, !important не добавлялось.
2026-10-13 04:25:26 +03:00

368 lines
7.6 KiB
CSS

/* ============================================================================
Карта связей (экран «Связи»): canvas-карта, панель фильтров, кнопки масштаба,
карточка выбранного человека, заметка и обозначения.
Сама карта рисуется в canvas (js/pages/network/graph-canvas.js): цвета он берёт
из токенов темы, поэтому здесь нет стилей точек и линий.
Без blur-фильтров, backdrop-filter и бесконечных CSS-анимаций: они и грели ноутбук.
========================================================================== */
.network-screen,
.net-legend-sheet {
--net-family: #ff8a65;
--net-close: var(--rel-family);
--net-friend: var(--info);
--net-contact: var(--text-secondary);
}
:root[data-theme='light'] .network-screen,
:root[data-theme='light'] .net-legend-sheet {
--net-family: #c2502a;
}
.net-board {
touch-action: none;
user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.net-canvas {
position: absolute;
inset: 0;
display: block;
touch-action: none;
cursor: grab;
}
.net-canvas.is-over-node {
cursor: pointer;
}
.net-canvas.is-panning,
.net-canvas.is-dragging {
cursor: grabbing;
}
/* Нижний слой (сетка, кольца групп, аура) только рисует – нажатия ловит верхний. */
.net-canvas--back {
pointer-events: none;
}
/* Через этот элемент движок узнаёт итоговые цвета токенов темы. */
.net-color-probe {
position: absolute;
width: 0;
height: 0;
overflow: hidden;
visibility: hidden;
pointer-events: none;
}
/* Кнопки масштаба: справа внизу, над нижним меню и карточкой (bottom задаёт JS). */
.net-zoom {
position: absolute;
right: var(--page-gutter, 14px);
bottom: 12px;
z-index: 11;
display: grid;
border: 1px solid var(--border-subtle);
border-radius: 14px;
background: var(--surface);
box-shadow: var(--shadow-sm);
overflow: hidden;
}
.net-zoom[hidden] {
display: none;
}
.net-zoom__btn {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border-radius: 0;
color: var(--text-secondary);
}
.net-zoom__btn + .net-zoom__btn {
border-top: 1px solid var(--border-subtle);
}
.net-zoom__btn:active {
color: var(--text-primary);
background: var(--surface-raised);
}
@media (hover: hover) {
.net-zoom__btn:hover {
color: var(--text-primary);
background: var(--surface-raised);
}
}
.net-zoom__btn:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: -2px;
}
.net-zoom__btn svg {
width: 20px;
height: 20px;
}
/* Карточка выбранного человека: аватар, имя, кто это вам, действия. */
.net-card {
position: absolute;
left: var(--page-gutter, 14px);
right: var(--page-gutter, 14px);
bottom: 12px;
z-index: 12;
max-width: 520px;
margin-inline: auto;
display: grid;
gap: 10px;
padding: 12px 12px 12px 14px;
border: 1px solid var(--border-subtle);
border-radius: 18px;
background: var(--surface);
box-shadow: var(--shadow);
}
.net-card[hidden] {
display: none;
}
.net-card__head {
display: flex;
align-items: center;
gap: 12px;
}
.net-card__avatar {
flex: 0 0 auto;
display: grid;
place-items: center;
border-radius: 50%;
}
.net-card__avatar.is-shining .avatar {
border-radius: 50%;
box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rel-shining);
}
.net-card__answer {
width: 100%;
min-height: 40px;
}
.net-card__titles {
flex: 1;
min-width: 0;
display: grid;
gap: 2px;
}
.net-card__name {
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.net-card__meta {
font-size: 12.5px;
color: var(--text-secondary);
}
.net-card__close {
flex: 0 0 auto;
align-self: flex-start;
width: 32px;
height: 32px;
display: grid;
place-items: center;
margin: -4px -2px 0 0;
border-radius: 50%;
color: var(--text-secondary);
}
.net-card__close svg {
width: 18px;
height: 18px;
}
.net-card__actions {
display: flex;
gap: 6px;
}
.net-card__action {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 8px 2px 7px;
border-radius: 12px;
background: var(--surface-raised);
color: var(--text-primary);
font-size: 11.5px;
line-height: 1.2;
}
.net-card__action span {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.net-card__action svg {
width: 20px;
height: 20px;
color: var(--accent);
}
.net-card__action .spinner {
width: 20px;
height: 20px;
}
.net-card__action:active {
background: var(--surface-selected);
}
@media (hover: hover) {
.net-card__action:hover {
background: var(--surface-selected);
}
}
.net-card__action:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: 2px;
}
.net-card__action[aria-pressed='true'] {
background: var(--surface-selected);
}
.net-card__action:disabled {
color: var(--disabled-text);
cursor: default;
}
.net-card__hint {
margin: 0;
font-size: 12px;
color: var(--text-secondary);
}
/* Обозначения */
.net-legend {
display: grid;
gap: 12px;
margin: 0;
padding: 0;
list-style: none;
}
.net-legend__row {
display: flex;
align-items: center;
gap: 12px;
color: var(--text-primary);
}
.net-legend__sample {
flex: 0 0 32px;
height: 16px;
display: block;
position: relative;
}
.net-legend__sample--line::before,
.net-legend__sample--dash::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: 7px;
border-top: 2.5px solid var(--net-contact);
}
.net-legend__sample--dash::before {
border-top-style: dashed;
}
.net-legend__sample[data-type='close_friend']::before { border-top-color: var(--net-close); }
.net-legend__sample[data-type='friend']::before { border-top-color: var(--net-friend); }
.net-legend__sample[data-type='family']::before { border-top-color: var(--net-family); }
.net-legend__sample[data-type='contact']::before { border-top-color: var(--net-contact); opacity: .6; }
.net-legend__sample--aura {
height: 32px;
border-radius: 50%;
background: radial-gradient(circle, var(--rel-shining) 0 34%, color-mix(in srgb, var(--rel-shining) 30%, transparent) 46%, transparent 70%);
}
.net-legend__sample--badge::before,
.net-legend__sample--mark::before {
content: "";
position: absolute;
left: 8px;
top: 0;
width: 16px;
height: 16px;
border-radius: 50%;
background: rgb(47, 140, 255);
}
.net-legend__sample--mark::before {
background: var(--note-mark-green);
}
.net-legend__tips {
display: grid;
gap: 8px;
margin: 8px 0 0;
padding-left: 18px;
color: var(--text-secondary);
font-size: var(--text-sm);
line-height: var(--leading-sm, 1.45);
}
/* Поиск по связям поверх карты: найденные на карте и во всей сети. */
.net-search-panel {
position: absolute;
left: 0;
right: 0;
z-index: 13;
overflow-y: auto;
overscroll-behavior: contain;
padding: 0 var(--page-gutter) var(--space-4);
background: var(--background);
scrollbar-width: none;
}
.net-search-panel::-webkit-scrollbar {
display: none;
}
.net-search-panel[hidden] {
display: none;
}
.net-search-note {
margin: var(--space-4) 0;
color: var(--text-secondary);
font-size: var(--text-sm);
text-align: center;
}
.net-search-loading {
padding: var(--space-3) 0;
}