- Root folder cards with hero-style layout and SVG icons - Full-width thumbnails with aspect-ratio grid items - List view column headers (Name, Bitrate, Duration, Size) - Modernized breadcrumb with pill segments and overflow handling - Proper skeleton shimmer replacing emoji hourglass on thumbnails - Pagination shows "Showing X-Y of Z" item count - Refined hover effects, animations, and visual hierarchy - Download button revealed on row hover in list view - Type badges hidden by default, shown on hover - Localized new keys in en.json and ru.json
This commit is contained in:
@@ -83,13 +83,13 @@ function showRootFolders() {
|
||||
revokeBlobUrls(container);
|
||||
if (viewMode === 'list') {
|
||||
container.className = 'browser-list';
|
||||
} else if (viewMode === 'compact') {
|
||||
container.className = 'browser-grid browser-grid-compact';
|
||||
} else {
|
||||
container.className = 'browser-grid';
|
||||
container.className = 'browser-grid browser-root-grid';
|
||||
}
|
||||
container.innerHTML = '';
|
||||
|
||||
const folderSvg = '<svg viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>';
|
||||
|
||||
Object.entries(mediaFolders).forEach(([id, folder]) => {
|
||||
if (!folder.enabled) return;
|
||||
const unavailable = folder.available === false;
|
||||
@@ -105,13 +105,13 @@ function showRootFolders() {
|
||||
};
|
||||
}
|
||||
row.innerHTML = `
|
||||
<div class="browser-list-icon">\u{1F4C1}</div>
|
||||
<div class="browser-list-icon" style="color: var(--accent)">${folderSvg}</div>
|
||||
<div class="browser-list-name">${escapeHtml(folder.label)}${unavailable ? ' <span class="folder-unavailable-badge">' + t('browser.unavailable') + '</span>' : ''}</div>
|
||||
`;
|
||||
container.appendChild(row);
|
||||
} else {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'browser-item' + unavailableClass;
|
||||
card.className = 'browser-item browser-root-folder' + unavailableClass;
|
||||
if (!unavailable) {
|
||||
card.onclick = () => {
|
||||
currentFolderId = id;
|
||||
@@ -120,7 +120,7 @@ function showRootFolders() {
|
||||
}
|
||||
card.innerHTML = `
|
||||
<div class="browser-thumb-wrapper">
|
||||
<div class="browser-icon">\u{1F4C1}</div>
|
||||
<div class="browser-icon" style="color: var(--accent)">${folderSvg}</div>
|
||||
</div>
|
||||
<div class="browser-item-info">
|
||||
<div class="browser-item-name">${escapeHtml(folder.label)}</div>
|
||||
@@ -269,6 +269,19 @@ function renderBrowserList(items, container) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Column header row
|
||||
const header = document.createElement('div');
|
||||
header.className = 'browser-list-header';
|
||||
header.innerHTML = `
|
||||
<span></span>
|
||||
<span>${t('browser.list_header.name')}</span>
|
||||
<span>${t('browser.list_header.bitrate')}</span>
|
||||
<span>${t('browser.list_header.duration')}</span>
|
||||
<span>${t('browser.list_header.size')}</span>
|
||||
<span></span>
|
||||
`;
|
||||
container.appendChild(header);
|
||||
|
||||
items.forEach((item, idx) => {
|
||||
const row = document.createElement('div');
|
||||
row.className = 'browser-list-item';
|
||||
@@ -683,6 +696,7 @@ function renderPagination() {
|
||||
const nextBtn = document.getElementById('nextPage');
|
||||
const pageInput = document.getElementById('pageInput');
|
||||
const pageTotal = document.getElementById('pageTotal');
|
||||
const showingEl = document.getElementById('paginationShowing');
|
||||
|
||||
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
||||
const currentPage = Math.floor(currentOffset / itemsPerPage) + 1;
|
||||
@@ -697,6 +711,13 @@ function renderPagination() {
|
||||
pageInput.max = totalPages;
|
||||
pageTotal.textContent = `/ ${totalPages}`;
|
||||
|
||||
// "Showing X-Y of Z"
|
||||
if (showingEl) {
|
||||
const from = currentOffset + 1;
|
||||
const to = Math.min(currentOffset + itemsPerPage, totalItems);
|
||||
showingEl.textContent = t('browser.showing_items', { from, to, total: totalItems });
|
||||
}
|
||||
|
||||
prevBtn.disabled = currentPage === 1;
|
||||
nextBtn.disabled = currentPage === totalPages;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user