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

677 lines
15 KiB
CSS

/* Shared attachment UI styles. */
.message-attachments {
display: grid;
gap: 0.5rem;
}
.message-attachment-carousel {
gap: 0.35rem;
margin: 0.5rem 0 0.4rem;
max-width: min(100%, 34rem);
}
.message-attachment-carousel-viewport {
align-items: center;
background: transparent;
border: 1px solid var(--border-subtle);
border-radius: 14px;
display: grid;
min-height: 12rem;
overflow: hidden;
position: relative;
touch-action: pan-y;
}
.message-attachment-carousel-viewport.has-landscape-media {
align-items: start;
min-height: 0;
}
.message-attachment-slide {
align-items: stretch;
display: grid;
min-height: 12rem;
}
.message-attachment-slide.has-landscape-media {
min-height: 0;
}
.message-attachment-arrow {
align-items: center;
border-radius: 999px;
cursor: pointer;
display: inline-flex;
font-size: 1.85rem;
height: 44px;
justify-content: center;
line-height: 1;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 44px;
z-index: 2;
}
.message-attachment-arrow[hidden] {
display: none;
}
.message-attachment-arrow:disabled {
cursor: default;
opacity: 0.28;
}
.message-attachment-arrow--prev {
left: 0.55rem;
}
.message-attachment-arrow--next {
right: 0.55rem;
}
.message-attachment-counter {
color: var(--text-secondary);
font-size: 0.78rem;
text-align: center;
}
.message-attachment-media-frame {
align-items: center;
background: var(--surface);
cursor: zoom-in;
display: grid;
min-height: 12rem;
overflow: hidden;
position: relative;
}
.message-attachment-media-frame.is-landscape {
min-height: 0;
}
.message-attachment-media {
display: block;
height: min(52vh, 20rem);
max-height: 20rem;
object-fit: contain;
width: 100%;
}
.message-attachment-media.is-landscape {
height: auto;
}
.message-attachment-video-info {
position: absolute;
top: 0.65rem;
right: 0.65rem;
z-index: 1;
max-width: calc(100% - 1.3rem);
padding: 0.3rem 0.55rem;
border-radius: 0.5rem;
background: rgb(0 0 0 / 70%);
color: #fff;
font-size: 0.75rem;
font-variant-numeric: tabular-nums;
line-height: 1.2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
pointer-events: none;
}
.message-attachment-play {
align-items: center;
background: var(--surface);
border: 1px solid var(--border-subtle);
border-radius: 999px;
color: var(--text-primary);
display: inline-flex;
font-size: 1.7rem;
height: 4rem;
justify-content: center;
left: 50%;
padding-left: 0.18rem;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
width: 4rem;
}
.message-attachment-media-frame:not(.is-loaded) { background: var(--surface-selected); animation: attachment-loading 1.2s ease-in-out infinite alternate; }
.message-attachment-media-frame.is-loaded { background: transparent; }
@keyframes attachment-loading { from { opacity: 1; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .message-attachment-media-frame:not(.is-loaded) { animation: none; } }
.message-attachment-file-card {
align-items: center;
background: var(--surface);
border: 1px solid var(--border-subtle);
border-radius: 0.8rem;
color: var(--text-primary);
cursor: pointer;
display: grid;
gap: 0.55rem;
grid-template-columns: auto minmax(0, 1fr);
min-height: 3.25rem;
padding: 0.55rem 0.7rem;
}
.message-attachment-file-ext {
align-items: center;
background: var(--accent);
border-radius: 999px;
color: var(--on-accent);
display: inline-flex;
font-size: 0.72rem;
font-weight: 800;
height: 1.7rem;
justify-content: center;
min-width: 3.25rem;
padding: 0 0.55rem;
}
.message-attachment-file-main {
display: grid;
gap: 0.08rem;
min-width: 0;
}
.message-attachment-file-main .message-attachment-meta {
color: var(--text-secondary);
}
.message-attachment-unavailable {
align-items: center;
background: var(--surface);
color: var(--danger);
display: flex;
flex-direction: column;
font-weight: 700;
justify-content: center;
min-height: 12rem;
padding: 1.25rem;
text-align: center;
}
.message-attachment-debug {
width: 100%;
margin: 10px 0 0;
padding: 8px;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-all;
border: 1px solid var(--border-subtle);
border-radius: 8px;
color: var(--text-secondary);
font-size: 11px;
font-weight: 500;
line-height: 1.35;
text-align: left;
}
.message-attachment-card {
align-items: center;
background: var(--surface);
border: 1px solid var(--border-subtle);
border-radius: 1rem;
color: var(--text-primary);
display: flex;
gap: 0.7rem;
padding: 0.75rem 0.85rem;
text-decoration: none;
}
.message-attachment-icon {
align-items: center;
background: var(--surface);
border-radius: 0.8rem;
color: var(--text-primary);
display: inline-flex;
flex: 0 0 auto;
height: 2.1rem;
justify-content: center;
width: 2.1rem;
}
.message-attachment-main {
display: grid;
min-width: 0;
}
.message-attachment-name {
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.message-attachment-meta {
color: var(--text-secondary);
font-size: 0.78rem;
overflow-wrap: anywhere;
}
@media (max-width: 640px) {
.message-attachment-carousel {
max-width: 100%;
}
.message-attachment-carousel-viewport,
.message-attachment-slide,
.message-attachment-media-frame,
.message-attachment-unavailable {
min-height: 10rem;
}
.message-attachment-media {
height: min(42vh, 16rem);
}
.message-attachment-file-card {
grid-template-columns: auto minmax(0, 1fr);
}
}
.ar-attachment-manager-root .modal { z-index: 120; }
.ar-attachment-manager-card {
max-width: min(92vw, 34rem);
gap: var(--space-3);
}
/* Пустые служебные блоки (сумма, превью, ошибка) не должны давать промежутков. */
.ar-attachment-manager-card :is(.ar-attachment-meta, .inline-error):empty,
.ar-attachment-manager-card [hidden] { display: none; }
.ar-attachment-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ar-attachment-manager-close { display: grid; place-items: center; width: 44px; min-width: 44px; padding: 0; color: var(--text-secondary); }
.ar-attachment-manager-close svg { width: 20px; height: 20px; }
.ar-attachment-note { margin: 0; font-size: .8125rem; line-height: 1.25rem; color: var(--text-secondary); }
.ar-attachment-alt-sources { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
.ar-attachment-link { min-height: 36px; padding: 0; justify-self: start; color: var(--action); background: transparent; font-size: var(--text-sm); font-weight: var(--weight-medium); }
/* Та же высота, что у поля ввода (44), кнопка внутри – как в переключателе (34). */
.ar-attachment-file-picker {
min-height: var(--control-height);
padding: 4px;
display: flex;
align-items: center;
gap: var(--space-3);
border: 1px dashed var(--border-control);
border-radius: 12px;
background: var(--surface);
cursor: pointer;
}
.ar-attachment-file-picker:active { border-color: var(--accent); }
@media (hover: hover) { .ar-attachment-file-picker:hover { border-color: var(--accent); } }
.ar-attachment-file-picker:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ar-attachment-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ar-attachment-file-btn {
flex-shrink: 0;
min-height: 34px;
padding: 0 14px;
display: inline-flex;
align-items: center;
border-radius: 8px;
font-size: var(--text-md);
color: var(--on-accent);
background: var(--accent);
font-weight: 600;
}
.ar-attachment-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: .875rem; }
.ar-attachment-summary { color: var(--text-primary); font-size: .875rem; }
.ar-attachment-ok { color: var(--success); font-weight: 600; }
.ar-attachment-details { color: var(--text-secondary); font-size: .8125rem; line-height: 1.25rem; }
.ar-attachment-details summary { min-height: 36px; display: flex; align-items: center; color: var(--accent); cursor: pointer; }
.ar-attachment-details > div { overflow-wrap: anywhere; }
.ar-attachment-manager-card--wide {
max-width: min(96vw, 58rem);
}
.ar-attachment-meta {
color: var(--text-secondary);
display: grid;
font-size: 0.86rem;
gap: 0.25rem;
overflow-wrap: anywhere;
}
.ar-attachment-wallet-select option { color: var(--text-primary); background: var(--surface); }
.ar-attachment-history-table-wrap {
max-height: 55vh;
overflow: auto;
}
.ar-attachment-history-table {
border-collapse: collapse;
font-size: 0.84rem;
min-width: 48rem;
width: 100%;
}
.ar-attachment-history-table th,
.ar-attachment-history-table td {
border-bottom: 1px solid var(--border-subtle);
padding: 0.55rem;
text-align: left;
vertical-align: top;
}
.ar-attachment-history-table th {
color: var(--text-secondary);
font-weight: 700;
}
.ar-attachment-history-tiles {
align-content: start;
box-sizing: border-box;
display: grid;
gap: 0.28rem;
grid-auto-rows: min-content;
max-height: 58vh;
max-width: 100%;
min-width: 0;
overflow-x: hidden;
overflow-y: auto;
padding: 0.35rem;
scrollbar-color: var(--border-control) var(--border-subtle);
scrollbar-width: thin;
width: 100%;
}
.ar-attachment-history-tiles::-webkit-scrollbar {
display: block;
height: 4px;
width: 4px;
}
.ar-attachment-history-tiles::-webkit-scrollbar-track {
background: var(--border-subtle);
}
.ar-attachment-history-tiles::-webkit-scrollbar-thumb {
background: var(--border-control);
border-radius: 999px;
}
.ar-attachment-history-tiles::-webkit-scrollbar-thumb:hover {
background: var(--border-control);
}
.ar-attachment-history-tile {
background: var(--surface);
border: 1px solid transparent;
border-radius: 0.52rem;
box-sizing: border-box;
color: var(--text-primary);
display: grid;
gap: 0.12rem;
max-width: 100%;
min-width: 0;
overflow: hidden;
padding: 0.28rem 0.42rem;
width: 100%;
}
.ar-attachment-history-tile.is-selected {
border-color: var(--success);
box-shadow: none;
}
.ar-attachment-history-tile--page {
box-shadow: none;
}
.ar-attachment-history-tile-head {
align-items: flex-start;
display: flex;
gap: 0.65rem;
justify-content: space-between;
}
.ar-attachment-history-name {
display: block;
font-size: 0.78rem;
line-height: 1.08;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ar-attachment-history-tile-head strong {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ar-attachment-history-meta-row {
align-items: center;
color: var(--text-secondary);
display: flex;
flex-wrap: wrap;
font-size: 0.6875rem;
gap: 0.22rem;
line-height: 1.05;
min-width: 0;
}
.ar-attachment-history-txid {
background: var(--border-subtle);
border-radius: 0.34rem;
color: var(--text-secondary);
font-size: 0.6875rem;
line-height: 1.05;
max-width: 100%;
min-width: 0;
overflow: hidden;
padding: 0.14rem 0.24rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.ar-attachment-status {
border-radius: 999px;
flex: 0 0 auto;
font-size: 0.6875rem;
font-weight: 800;
line-height: 1;
padding: 0.2rem 0.32rem;
}
.ar-attachment-status--available {
background: var(--surface-selected);
color: var(--success);
}
.ar-attachment-status--pending {
background: var(--surface-selected);
color: var(--warning);
}
.ar-attachment-status--unavailable {
background: var(--surface-selected);
color: var(--danger);
}
.ar-attachment-placement-flag {
background: var(--surface-selected);
border-radius: 999px;
color: var(--accent);
flex: 0 0 auto;
font-size: 0.6875rem;
font-weight: 800;
line-height: 1;
padding: 0.2rem 0.32rem;
}
/* ===== Public / Arweave attachment source picker ===== */
.public-attachment-manager-root {
position: fixed;
inset: 0;
z-index: 1200;
}
.public-attachment-manager {
position: fixed;
inset: 0;
display: grid;
place-items: center;
padding: 20px;
background: var(--scrim);
}
.public-attachment-manager__card {
width: min(620px, 100%);
max-height: min(820px, calc(100dvh - 40px));
overflow: auto;
}
.public-attachment-manager__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.public-attachment-manager__sources {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.public-attachment-manager__source {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 14px;
border: 1px solid var(--border-control);
border-radius: var(--radius-md);
background: var(--surface);
cursor: pointer;
}
.public-attachment-manager__source.is-selected {
border-color: var(--accent);
background: var(--accent-soft);
}
.public-attachment-manager__source input { margin-top: 3px; }
.public-attachment-manager__source span { display: grid; gap: 3px; }
.public-attachment-manager__source small { color: var(--text-secondary); line-height: 1.35; }
.public-attachment-manager__server,
.public-attachment-manager__arweave {
display: grid;
gap: 12px;
}
/* The two storage modes are mutually exclusive. Keep this explicit because
the author-level display:grid above otherwise overrides the browser's
default [hidden] rule in some engines. */
.public-attachment-manager__server[hidden],
.public-attachment-manager__arweave[hidden] {
display: none;
}
.public-attachment-manager__notice {
display: grid;
gap: 8px;
padding: 14px;
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
background: var(--quote-bg);
color: var(--text-secondary);
font-size: var(--text-sm);
line-height: var(--leading-sm);
}
.public-attachment-manager__notice strong { color: var(--text-primary); }
.public-attachment-manager__notice p { margin: 0; }
.public-attachment-manager__status { min-height: 1.25rem; }
.public-attachment-manager__error { min-height: 1.25rem; }
@media (max-width: 640px) {
.public-attachment-manager { padding: 10px; place-items: end center; }
.public-attachment-manager__card { width: 100%; max-height: calc(100dvh - 20px); }
.public-attachment-manager__sources { grid-template-columns: 1fr; }
}
/* Unified storage picker / balance dialogs */
.public-attachment-manager__file-picker { width: 100%; box-sizing: border-box; }
.public-attachment-manager__file-picker .ar-attachment-file-name { flex: 1; text-align: center; }
.ar-balance-modal { z-index: 1400; }
.ar-balance-modal__card { width: min(92vw, 32rem); }
.ar-balance-grid { display: grid; gap: 8px; }
.ar-balance-grid > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.ar-balance-grid span { color: var(--text-secondary); }
.ar-wallet-address { padding: 12px; border: 1px solid var(--border-control); border-radius: 10px; background: var(--quote-bg); overflow-wrap: anywhere; user-select: all; }
.ar-attachment-manager-card .form-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Arweave manager embedded inside the unified server / Arweave picker. */
.ar-attachment-manager-embedded-root { min-width: 0; }
.ar-attachment-manager-card--embedded {
width: 100%;
max-width: none;
margin: 0;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
}