UI: поправить экран загрузки файлов

This commit is contained in:
AidarKC
2026-07-31 16:59:04 +04:00
parent cd67176b41
commit bcae285ab3
5 changed files with 98 additions and 41 deletions
+4 -3
View File
@@ -9,7 +9,7 @@ import { formatBytes } from '../services/attachment-format.js';
import { toUserMessage } from '../services/ui-error-texts.js';
import { state } from '../state.js';
export const pageMeta = { id: 'arweave-uploads-view', title: 'Загрузить файлы в блокчейн' };
export const pageMeta = { id: 'arweave-uploads-view', title: 'Загрузка файлов' };
function setStatusBadge(node, status, label) {
if (!node) return;
@@ -60,8 +60,9 @@ export function render({ navigate }) {
controls.className = 'arweave-uploads-toolbar';
controls.innerHTML = `
<button class="secondary-btn arweave-uploads-back" type="button" data-action="back" aria-label="Назад">←</button>
<button class="primary-btn" type="button" data-action="upload">Добавить файл</button>
<button class="secondary-btn arweave-uploads-menu-btn" type="button" data-action="menu" aria-label="Меню"></button>
<div class="arweave-uploads-title">Загрузка файлов</div>
<button class="primary-btn arweave-uploads-add" type="button" data-action="upload" aria-label="Добавить файл">+</button>
<button class="secondary-btn arweave-uploads-menu-btn" type="button" data-action="menu" aria-label="Меню">⋮</button>
<div class="arweave-uploads-menu" data-menu="true" hidden>
<button class="text-btn" type="button" data-action="clear">Очистить историю</button>
<button class="text-btn" type="button" data-action="help">Справка</button>
+88 -36
View File
@@ -2500,26 +2500,47 @@ textarea.input {
.ar-attachment-history-tiles {
display: grid;
gap: 0.5rem;
gap: 0.36rem;
max-height: 58vh;
overflow-x: hidden;
overflow-y: auto;
padding-right: 0.1rem;
padding: 0.45rem;
scrollbar-color: rgba(212, 175, 55, 0.65) rgba(255, 255, 255, 0.06);
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: rgba(255, 255, 255, 0.04);
}
.ar-attachment-history-tiles::-webkit-scrollbar-thumb {
background: rgba(212, 175, 55, 0.7);
border-radius: 999px;
}
.ar-attachment-history-tiles::-webkit-scrollbar-thumb:hover {
background: rgba(240, 198, 76, 0.9);
}
.ar-attachment-history-tile {
background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(236, 253, 245, 0.96));
border: 1px solid rgba(20, 184, 166, 0.22);
border-radius: 0.8rem;
background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(22, 36, 53, 0.96));
border: 1px solid rgba(212, 175, 55, 0.2);
border-radius: 0.65rem;
box-sizing: border-box;
color: #0f172a;
color: #f8fafc;
display: grid;
gap: 0.32rem;
gap: 0.18rem;
max-width: 100%;
min-width: 0;
overflow: hidden;
padding: 0.62rem 0.7rem;
padding: 0.42rem 0.52rem;
width: 100%;
}
@@ -2529,7 +2550,7 @@ textarea.input {
}
.ar-attachment-history-tile--page {
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.ar-attachment-history-tile-head {
@@ -2541,8 +2562,8 @@ textarea.input {
.ar-attachment-history-name {
display: block;
font-size: 0.92rem;
line-height: 1.2;
font-size: 0.86rem;
line-height: 1.12;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
@@ -2558,21 +2579,22 @@ textarea.input {
.ar-attachment-history-meta-row {
align-items: center;
color: #64748b;
color: #cbd5e1;
display: flex;
flex-wrap: wrap;
font-size: 0.76rem;
gap: 0.35rem;
font-size: 0.68rem;
gap: 0.28rem;
min-width: 0;
}
.ar-attachment-history-txid {
background: rgba(15, 23, 42, 0.06);
border-radius: 0.5rem;
font-size: 0.62rem;
line-height: 1.25;
background: rgba(255, 255, 255, 0.06);
border-radius: 0.42rem;
color: rgba(226, 232, 240, 0.86);
font-size: 0.52rem;
line-height: 1.15;
overflow: hidden;
padding: 0.32rem 0.42rem;
padding: 0.22rem 0.32rem;
text-overflow: ellipsis;
white-space: nowrap;
}
@@ -2613,35 +2635,56 @@ textarea.input {
}
.arweave-uploads-screen {
min-height: calc(100vh - 1rem);
min-height: 100vh;
padding-top: 0;
}
.arweave-uploads-toolbar {
align-items: center;
background: rgba(248, 250, 252, 0.96);
border: 1px solid rgba(15, 23, 42, 0.08);
border-radius: 0.9rem;
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
display: flex;
gap: 0.5rem;
justify-content: space-between;
padding: 0.45rem;
background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
border-bottom: 1px solid rgba(212, 175, 55, 0.22);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
box-sizing: border-box;
display: grid;
gap: 0.42rem;
grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem 2.4rem;
justify-content: stretch;
margin: -1rem -1rem 0;
padding: max(0.35rem, env(safe-area-inset-top)) 0.45rem 0.45rem;
position: sticky;
top: 0.5rem;
top: 0;
z-index: 15;
}
.arweave-uploads-back,
.arweave-uploads-add,
.arweave-uploads-menu-btn {
min-width: 2.6rem;
padding-inline: 0.7rem;
align-items: center;
aspect-ratio: 1;
display: inline-flex;
font-size: 1.2rem;
height: 2.35rem;
justify-content: center;
min-width: 0;
padding: 0;
}
.arweave-uploads-title {
align-self: center;
color: #f8fafc;
font-weight: 800;
min-width: 0;
overflow: hidden;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}
.arweave-uploads-menu {
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.12);
background: rgba(15, 23, 42, 0.98);
border: 1px solid rgba(212, 175, 55, 0.24);
border-radius: 0.85rem;
box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
display: grid;
min-width: 13rem;
padding: 0.35rem;
@@ -2651,9 +2694,18 @@ textarea.input {
z-index: 20;
}
.arweave-uploads-menu[hidden] {
display: none;
}
.arweave-uploads-menu .text-btn {
color: #f8fafc;
text-align: left;
}
.arweave-uploads-list {
max-height: calc(100vh - 7.5rem);
min-height: calc(100vh - 7.5rem);
max-height: calc(100vh - 4.4rem);
min-height: calc(100vh - 4.4rem);
}
.mono-cell {