Files
thetool/public/plugins/vue/tt-components/css/tt-file-gallery.css
2025-08-26 17:18:58 +02:00

279 lines
5.7 KiB
CSS

/* tt-file-gallery.css */
.tt-file-gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 1rem;
}
.tt-file-gallery-item {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
cursor: pointer;
}
.tt-file-gallery-thumbnail-wrapper {
position: relative;
width: 100%;
height: 100px;
border-radius: 0.25rem;
overflow: hidden; /* Hide the scaled part of the image */
}
.tt-file-gallery-thumbnail {
width: 100%;
height: 100%;
object-fit: cover;
border: 1px solid #dee2e6;
transition: transform 0.2s;
}
.tt-file-gallery-item:hover .tt-file-gallery-thumbnail {
transform: scale(1.05);
}
.tt-file-gallery-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
color: white;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
border-radius: 0.25rem;
}
.tt-file-gallery-item:hover .tt-file-gallery-thumbnail-wrapper .tt-file-gallery-overlay {
opacity: 1;
}
.tt-file-gallery-icon-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #dee2e6;
border-radius: 0.25rem;
background-color: #f8f9fa;
text-decoration: none;
color: inherit;
transition: transform 0.2s;
}
.tt-file-gallery-item:hover .tt-file-gallery-icon-container {
transform: scale(1.05);
}
.tt-file-gallery-filename {
font-size: 0.8rem;
margin-top: 0.5rem;
width: 100%;
padding: 0 4px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 0 0.25rem;
line-height: 1.2;
}
.tt-file-gallery-filename > span {
flex: 1 1 auto;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tt-file-gallery-filename > i {
flex-shrink: 0;
}
/* --- Fullscreen Viewer Styles --- */
.tt-fullscreen-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9999;
outline: none;
}
.tt-fullscreen-toolbar {
position: absolute;
top: 0;
right: 0;
padding: 15px;
display: flex;
gap: 15px;
z-index: 10001;
}
.tt-fullscreen-btn {
background: rgba(0, 0, 0, 0.3);
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
width: 44px;
height: 44px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
transition: background-color 0.2s;
}
.tt-fullscreen-btn:hover {
background: rgba(0, 0, 0, 0.6);
}
.tt-fullscreen-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.tt-fullscreen-image-wrapper {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden; /* Important for panning */
}
.tt-fullscreen-image {
max-width: 95vw;
max-height: 95vh;
object-fit: contain;
will-change: transform; /* Performance hint for browser */
}
.tt-fullscreen-pdf {
width: calc(100vw - 40px);
height: calc(100vh - 40px);
max-width: 1600px; /* Optional: max width for very large screens */
border: none;
background-color: white;
}
.tt-fullscreen-pdf-standalone-container {
width: calc(100vw - 40px);
height: calc(100vh - 40px);
overflow: scroll; /* or 'auto' - This is the key change! */
background-color: #555; /* A background for the scroll area */
text-align: center; /* Helps center the canvas if it's smaller than the container */
}
.tt-fullscreen-pdf-standalone {
border: none;
box-shadow: 0 0 15px rgba(0,0,0,0.5);
margin: 20px 0; /* Add some vertical margin for spacing */
}
.tt-file-gallery-filename {
padding: 4px 8px 0;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
justify-content: space-between;
align-items: center;
}
.tt-file-gallery-description {
padding: 0 8px 4px;
font-size: 0.75rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #6c757d; /* Bootstrap's text-muted color */
}
.tt-fullscreen-nav-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.3);
border: none;
color: white;
font-size: 2rem;
cursor: pointer;
padding: 10px;
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
transition: background-color 0.2s;
}
.tt-fullscreen-nav-btn:hover {
background: rgba(0, 0, 0, 0.6);
}
.tt-fullscreen-nav-btn.left {
left: 15px;
}
.tt-fullscreen-nav-btn.right {
right: 15px;
}
/* Center the loader on the screen */
.tt-fullscreen-loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
}
/* Apply the animation to the SVG inside the loader */
.tt-fullscreen-loader svg {
animation: svg-spinner 1.2s linear infinite;
}
/* Define the keyframes for the spinning animation */
@keyframes svg-spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.tt-file-gallery-item.is-missing {
cursor: not-allowed;
opacity: 0.6;
}
.tt-file-gallery-item.is-missing .tt-file-gallery-overlay {
display: none; /* Hide the zoom icon overlay */
}