UI: добавить карусель вложений

This commit is contained in:
AidarKC
2026-07-31 12:49:24 +04:00
parent f961947e1e
commit c530627078
7 changed files with 541 additions and 35 deletions
+233
View File
@@ -2182,6 +2182,165 @@ textarea.input {
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: linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(20, 184, 166, 0.08));
border: 1px solid rgba(15, 23, 42, 0.1);
border-radius: 1.15rem;
display: grid;
min-height: 12rem;
overflow: hidden;
position: relative;
touch-action: pan-y;
}
.message-attachment-slide {
align-items: stretch;
display: grid;
min-height: 12rem;
}
.message-attachment-arrow {
align-items: center;
background: rgba(15, 23, 42, 0.62);
border: 1px solid rgba(255, 255, 255, 0.18);
border-radius: 999px;
color: #fff;
cursor: pointer;
display: inline-flex;
font-size: 1.85rem;
height: 2.35rem;
justify-content: center;
line-height: 1;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 2.35rem;
z-index: 2;
}
.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: #64748b;
font-size: 0.78rem;
text-align: center;
}
.message-attachment-media-frame {
align-items: center;
background: #0f172a;
cursor: zoom-in;
display: grid;
min-height: 12rem;
overflow: hidden;
position: relative;
}
.message-attachment-media {
display: block;
height: min(52vh, 20rem);
max-height: 20rem;
object-fit: contain;
width: 100%;
}
.message-attachment-play {
align-items: center;
background: rgba(15, 23, 42, 0.72);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 999px;
color: #fff;
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-download {
background: rgba(20, 184, 166, 0.95);
border-radius: 999px;
color: #fff;
font-size: 0.82rem;
font-weight: 700;
padding: 0.45rem 0.75rem;
position: relative;
text-decoration: none;
width: max-content;
z-index: 3;
}
.message-attachment-media-frame > .message-attachment-download {
bottom: 0.75rem;
position: absolute;
right: 0.75rem;
}
.message-attachment-file-card {
align-items: center;
background: linear-gradient(135deg, rgba(240, 253, 250, 0.95), rgba(239, 246, 255, 0.95));
color: #0f172a;
display: grid;
gap: 0.7rem;
grid-template-columns: auto minmax(0, 1fr) auto;
padding: 1rem;
}
.message-attachment-file-ext {
align-items: center;
background: #0f766e;
border-radius: 0.9rem;
color: #fff;
display: inline-flex;
font-size: 0.8rem;
font-weight: 800;
height: 3rem;
justify-content: center;
max-width: 4rem;
min-width: 3rem;
padding: 0 0.45rem;
}
.message-attachment-file-main {
display: grid;
min-width: 0;
}
.message-attachment-unavailable {
align-items: center;
background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 247, 237, 0.96));
color: #7f1d1d;
display: flex;
font-weight: 700;
justify-content: center;
min-height: 12rem;
padding: 1.25rem;
text-align: center;
}
.message-attachment-card {
align-items: center;
background: linear-gradient(135deg, rgba(240, 253, 250, 0.95), rgba(239, 246, 255, 0.95));
@@ -2224,6 +2383,80 @@ textarea.input {
overflow-wrap: anywhere;
}
.attachment-viewer-modal {
z-index: 80;
}
.attachment-viewer-card {
background: rgba(15, 23, 42, 0.96);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 1.2rem;
box-shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
color: #fff;
display: grid;
gap: 0.8rem;
max-height: 92vh;
max-width: min(94vw, 68rem);
padding: 0.9rem;
width: 100%;
}
.attachment-viewer-head,
.attachment-viewer-actions {
align-items: center;
display: flex;
gap: 0.8rem;
justify-content: space-between;
}
.attachment-viewer-title {
font-weight: 800;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.attachment-viewer-body {
align-items: center;
display: grid;
justify-items: center;
min-height: 12rem;
}
.attachment-viewer-media {
background: #020617;
border-radius: 0.8rem;
max-height: 76vh;
max-width: 100%;
object-fit: contain;
}
@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);
}
.message-attachment-file-card .message-attachment-download {
grid-column: 1 / -1;
}
}
.ar-attachment-manager-card {
max-width: min(92vw, 34rem);
}