From a8c842a3509c236190403278c12d40547438f32d Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sat, 2 Aug 2025 00:07:50 +0530 Subject: [PATCH] Refactor media gallery. --- frontend/src/assets/style.scss | 121 +++++++++++++++++++++++++++++++++ frontend/src/views/Media.vue | 103 ++++++++++++++-------------- 2 files changed, 174 insertions(+), 50 deletions(-) diff --git a/frontend/src/assets/style.scss b/frontend/src/assets/style.scss index a8e7e950..f2234612 100644 --- a/frontend/src/assets/style.scss +++ b/frontend/src/assets/style.scss @@ -968,6 +968,127 @@ section.analytics { .ext { text-transform: uppercase; } + + .grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 1.5rem; + padding: 1rem 0; + } + + .item { + background: white; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + overflow: hidden; + transition: transform 0.2s ease, box-shadow 0.2s ease; + + &:hover { + transform: translateY(-2px); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); + } + } + + .thumb { + position: relative; + aspect-ratio: 1; + overflow: hidden; + } + + .thumb-link { + display: block; + width: 100%; + height: 100%; + } + + .thumb-container { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: #f8f9fa; + } + + .thumb-image { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.2s ease; + + .item:hover & { + transform: scale(1.05); + } + } + + .thumb-placeholder { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + } + + .file-extension { + font-size: 1.2rem; + font-weight: 600; + text-transform: uppercase; + } + + .media-actions { + position: absolute; + top: 8px; + right: 8px; + opacity: 0; + transition: opacity 0.2s ease; + + .media-item:hover & { + opacity: 1; + } + } + + .delete-btn { + background: rgba(255, 255, 255, 0.9); + border-radius: 50%; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + transition: background 0.2s ease; + + &:hover { + background: rgba(255, 255, 255, 1); + } + } + + .info { + padding: 1rem; + } + + .filename { + font-weight: 600; + margin-bottom: 0.5rem; + color: #363636; + font-size: 0.9rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .date { + font-size: 0.8rem; + color: #7a7a7a; + margin-bottom: 0; + } + + .pagination-wrapper { + display: flex; + justify-content: center; + } + } /* Template form */ diff --git a/frontend/src/views/Media.vue b/frontend/src/views/Media.vue index b4773016..484c0320 100644 --- a/frontend/src/views/Media.vue +++ b/frontend/src/views/Media.vue @@ -38,61 +38,64 @@