wekan/client/components/cards/attachments.css
copilot-swe-agent[bot] 97dd5d2064 Resolve merge conflicts by accepting PR #6131 changes
Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-02-07 16:30:08 +00:00

314 lines
5.4 KiB
CSS

.hidden {
display: none;
}
.attachment-upload {
text-align: center;
font-weight: bold;
}
.attachment-gallery {
display: grid;
grid-auto-flow: row;
}
.attachment-item {
display: grid;
grid-template-columns: 10ch auto;
align-items: center;
grid-template-rows: repeat(auto-fit, minmax(1.5lh, auto));
justify-content: stretch;
gap: 2ch;
padding: 2ch;
border-radius: 0.6ch;
}
.attachment-item:hover {
background: #e0e0e0;
}
.attachment-details-container {
display: flex;
flex: 1;
}
.attachment-thumbnail-container {
display: flex;
flex: 1;
position: relative;
}
.attachment-thumbnail {
/* more deterministic outcome */
aspect-ratio: 1/1;
object-fit: cover;
max-width: 100%;
cursor: pointer;
border-radius: 0.4ch;
}
.attachment-thumbnail-text {
flex: 1;
text-align: center;
border-radius: 2px;
border: 1px solid #ccc;
}
.attachment-details {
display: flex;
flex: 1;
gap: 0.5ch;
align-items: center;
}
.attachment-actions {
display: flex;
flex-direction: row;
align-items: center;
gap: 1.5ch;
}
body.mobile-mode .attachment-actions {
flex-direction: column;
gap: 0;
}
.add-attachment {
border: 1px dashed #555;
border-radius: .5ch;
cursor: pointer;
aspect-ratio: 1/1;
height: 1.5lh;
display: flex;
align-items: center;
justify-content: center;
}
.icon {
font-size: 1.5em;
cursor: pointer;
}
.icon:hover {
color: #666;
}
#viewer-overlay {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 9999 !important;
background: rgba(13, 13, 13, 0.95);
}
#viewer-container {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 100%;
}
#viewer-top-bar {
display: grid;
grid-template-columns: 1fr auto;
justify-content: center;
justify-items: center;
font-size: 2rem;
padding: 0.3lh 0.5ch;
}
#attachment-name {
color: white;
text-overflow: ellipsis;
overflow: hidden;
}
#viewer-close {
color: white;
cursor: pointer;
position: absolute;
right: 50px;
top: 16px;
font-size: 2em;
}
/* Upload progress indicators for drag-and-drop uploads */
.minicard-upload-progress,
.card-details-upload-progress {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 0.4ch;
}
.upload-progress-header {
display: flex;
align-items: center;
font-weight: bold;
color: #495057;
}
.upload-progress-header i {
color: #007bff;
}
.upload-progress-item {
display: flex;
flex-direction: column;
background: white;
border-radius: 3px;
border: 1px solid #dee2e6;
}
.upload-progress-item.upload-error {
border-color: #dc3545;
background: #f8d7da;
}
.upload-progress-filename {
font-weight: 500;
color: #495057;
word-break: break-all;
}
.upload-progress-bar {
background: #e9ecef;
border-radius: 3px;
overflow: hidden;
}
.upload-progress-fill {
background: linear-gradient(90deg, #007bff, #0056b3);
transition: width 0.3s ease;
border-radius: 3px;
}
.upload-progress-item.upload-error .upload-progress-fill {
background: #dc3545;
}
.upload-progress-error,
.upload-progress-success {
display: flex;
align-items: center;
font-weight: 500;
}
.upload-progress-error {
color: #dc3545;
}
.upload-progress-success {
color: #28a745;
}
/* Drag over state for minicards */
.minicard.is-dragging-over {
border: 2px dashed #007bff !important;
background: rgba(0, 123, 255, 0.1) !important;
}
/* Drag over state for card details */
.js-card-details.is-dragging-over {
border: 2px dashed #007bff !important;
background: rgba(0, 123, 255, 0.05) !important;
}
.attachment-arrow {
font-size: 4em;
color: white;
cursor: pointer;
align-self: center;
}
#prev-attachment {
font-size: 4em;
color: white;
cursor: pointer;
align-self: center;
margin-left: 70px;
}
#next-attachment {
font-size: 4em;
color: white;
cursor: pointer;
align-self: center;
margin-right: 70px;
}
#viewer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: calc(100% - 50px);
}
#image-viewer {
background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% /
20px 20px; /* Checkerboard background for transparent images */
max-width: 100%;
max-height: 100%;
}
#video-viewer {
max-width: 100%;
max-height: 100%;
}
#audio-viewer {
max-width: 100%;
}
#pdf-viewer {
width: 40vw;
height: 100%;
}
#txt-viewer {
background-color: white;
width: 40vw;
height: 100%;
}
.pdf-preview-error {
margin-top: 20vh;
display: block;
font-size: 2em;
color: white;
}
@media screen and (max-width: 1600px) {
#pdf-viewer {
width: 60vw;
}
}
@media screen and (max-width: 800px) {
#viewer-container {
display: block;
}
.attachment-arrow {
position: absolute;
bottom: 2.2em;
font-size: 1.6em;
}
#prev-attachment {
left: 0;
position: absolute;
bottom: 2.2em;
font-size: 1.6em;
padding: 16px;
margin-left: 0;
}
#next-attachment {
right: 0;
position: absolute;
bottom: 2.2em;
font-size: 1.6em;
padding: 16px;
margin-right: 0;
}
#pdf-viewer {
width: 100%;
height: calc(
100vh - 155px
); /* Full height - height of top and bottom bars */
}
#txt-viewer {
width: 100%;
height: calc(
100vh - 155px
); /* Full height - height of top and bottom bars */
}
#audio-viewer {
margin-top: 20%;
width: 100%;
}
.attachment-details {
flex-direction: column;
}
.attachment-actions {
flex-direction: row;
}
}