Files
Oxicloud/static/css/views/inlineViewer.css
T
DioCrafts 81a93a489b feat: photo/video capture-date pipeline + premium UI/UX overhaul
Backend — Photos timeline now groups by real capture date instead of upload time. New MediaMetadataService (FileLifecycleHook) extracts EXIF DateTimeOriginal from images and container creation_time from videos (mov/mp4/mkv) via nom-exif, timezone-correct (OffsetTimeOriginal), persisting captured_at so the existing media_sort_date trigger takes over. Adds POST /admin/photos/metadata/reextract to backfill existing media. Falls back to upload date when no embedded date exists.

Frontend — premium grid cards: combined metadata line (relative date · size, owner avatar when shared), custom selection checkbox with a clear checked state, uniform full-width 4:3 thumbnail tiles independent of filename length, centered file-type icons, and a hit-test fix so checkbox/star/kebab clicks reach the controls (the decorative thumbnail no longer captures pointer events). Notification messages internationalised across all 16 locales. Broader polish: design tokens, a11y/focus-visible states, brand + PWA assets.

Chore — bump semver-compatible dependencies (cargo upgrade); add nom-exif 3.6.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 00:24:27 +02:00

346 lines
7.8 KiB
CSS

/* OxiCloud Inline Viewer Styles */
.inline-viewer-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
background-color: var(--color-overlay-heavy);
display: none;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
}
.inline-viewer-modal.active {
display: flex !important;
opacity: 1;
align-items: center;
justify-content: center;
pointer-events: all;
}
.inline-viewer-content {
width: 90%;
height: 90%;
max-width: 1200px;
background-color: var(--color-bg-surface);
border-radius: var(--radius-lg);
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0 4px 20px var(--color-shadow-3xl);
}
.inline-viewer-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--space-3) var(--space-4);
background-color: var(--color-bg-subtle);
border-bottom: 1px solid var(--color-border);
}
.inline-viewer-title {
font-size: var(--text-lg);
font-weight: var(--weight-medium);
color: var(--color-text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.inline-viewer-close {
background: none;
border: none;
font-size: var(--text-lg);
cursor: pointer;
color: var(--color-text-muted);
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s;
}
.inline-viewer-close:hover {
background-color: var(--color-border);
color: var(--color-text-secondary);
}
.inline-viewer-container {
flex-grow: 1;
overflow: auto;
background-color: var(--color-bg-muted);
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.inline-viewer-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--space-3) var(--space-4);
background-color: var(--color-bg-subtle);
border-top: 1px solid var(--color-border);
}
.inline-viewer-download {
background-color: var(--color-accent);
color: var(--color-danger-text);
border: none;
border-radius: var(--radius-sm);
padding: var(--space-2) var(--space-4);
font-size: var(--text-base);
font-weight: var(--weight-medium);
cursor: pointer;
display: flex;
align-items: center;
gap: var(--space-2);
transition: background-color 0.2s;
}
.inline-viewer-download:hover {
background-color: var(--color-danger-alt);
}
.inline-viewer-controls {
display: flex;
gap: var(--space-2);
}
.inline-viewer-controls button {
background-color: var(--color-border-light);
border: 1px solid var(--color-border-medium);
border-radius: var(--radius-sm);
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--color-text-subtle);
transition: all 0.2s;
}
.inline-viewer-controls button:hover {
background-color: var(--color-border);
color: var(--color-text-dark);
}
/* Image viewer */
.inline-viewer-image {
max-width: 100%;
max-height: 100%;
/* The image is a flex item; without min-* = 0 the flexbox `min-width: auto`
default keeps it at its natural size, so `max-width: 100%` is ignored and
wide images overflow → a stray horizontal scrollbar and the picture only
partly visible (looked like it "repeated" while scrolling). */
min-width: 0;
min-height: 0;
object-fit: contain;
transform-origin: center;
transition: transform 0.2s ease;
}
/* Subtle, thin scrollbar inside the viewer (shown only when zoomed in to pan) —
replaces the heavy global accent scrollbar. */
.inline-viewer-container {
scrollbar-width: thin;
scrollbar-color: var(--color-border-medium) transparent;
}
.inline-viewer-container::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.inline-viewer-container::-webkit-scrollbar-thumb {
background: var(--color-border-medium);
border-radius: var(--radius-full);
}
.inline-viewer-container::-webkit-scrollbar-track {
background: transparent;
}
/* PDF viewer */
.inline-viewer-pdf,
.inline-viewer-pdf-fallback {
width: 100%;
height: 100%;
border: none;
}
/* Only show fallback if object fails */
.inline-viewer-pdf + .inline-viewer-pdf-fallback {
display: none;
}
.inline-viewer-pdf:not([data]),
.inline-viewer-pdf[data=""] + .inline-viewer-pdf-fallback {
display: block;
}
/* Loading indicator */
.inline-viewer-loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 36px;
color: var(--color-text-subtle);
}
/* Download progress container */
.inline-viewer-progress {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-3);
padding: var(--space-5);
background: var(--color-progress-overlay);
border-radius: var(--radius-lg);
box-shadow: 0 2px 8px var(--color-shadow);
}
/* Progress bar track */
.inline-viewer-progress-bar {
width: 200px;
height: 8px;
background: var(--color-border);
border-radius: var(--radius-sm);
overflow: hidden;
}
/* Progress bar fill */
.inline-viewer-progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--color-info-blue), var(--color-admin-blue));
border-radius: var(--radius-sm);
transition: width 0.2s ease;
}
/* Progress percentage text */
.inline-viewer-progress-text {
font-size: var(--text-base);
font-weight: var(--weight-semibold);
color: var(--color-text-secondary);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* Error and unsupported message */
.inline-viewer-message {
padding: var(--space-8);
text-align: center;
max-width: 400px;
}
.inline-viewer-icon {
font-size: 64px;
color: var(--color-text-dark);
margin-bottom: var(--space-6);
}
.inline-viewer-text {
color: var(--color-text-subtle);
line-height: 1.6;
}
.inline-viewer-text p {
margin: 0 0 var(--space-4);
}
/* Text viewer */
.inline-viewer-text-content {
width: 100%;
height: 100%;
margin: 0;
padding: var(--space-4) var(--space-6);
font-family: "Courier New", Consolas, Monaco, monospace;
font-size: var(--text-base);
line-height: 1.6;
color: var(--color-text);
background-color: var(--color-bg-surface);
overflow: auto;
white-space: pre-wrap;
word-wrap: break-word;
box-sizing: border-box;
text-align: left;
tab-size: 4;
}
/* Video viewer */
.inline-viewer-video {
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: var(--radius-sm);
background-color: var(--color-black);
}
/* Audio viewer */
.inline-viewer-audio-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-6);
padding: var(--space-12) var(--space-8);
max-width: 500px;
width: 100%;
}
.inline-viewer-audio-icon {
font-size: 80px;
color: var(--color-text-faint);
animation: audio-pulse 2s ease-in-out infinite;
}
@keyframes audio-pulse {
0%,
100% {
opacity: 0.6;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.05);
}
}
.inline-viewer-audio-name {
font-size: var(--text-md);
font-weight: var(--weight-medium);
color: var(--color-text-secondary);
text-align: center;
word-break: break-word;
max-width: 100%;
}
.inline-viewer-audio {
width: 100%;
max-width: 460px;
border-radius: var(--radius-lg);
outline: none;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.inline-viewer-content {
width: 100%;
height: 100%;
border-radius: 0;
}
.inline-viewer-controls {
display: none;
}
}