Files
EnvelopeGenerator/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css
TekH 6024f5c040 Add PDF thumbnail sidebar to EnvelopeViewer
Introduced a PDF thumbnail sidebar in `EnvelopeViewer.razor` to enhance navigation between pages. Added a toggle button to show/hide the sidebar and implemented dynamic thumbnail rendering for all pages.

Updated `envelope-viewer.css` with styles for the sidebar, including hover/active states, transitions, and mobile responsiveness.

Enhanced `pdf-viewer.js` with a `renderThumbnail` method to render page previews on canvas elements. Added error handling for non-critical thumbnail rendering issues.

Improved user experience by providing an intuitive way to preview and navigate PDF pages.
2026-06-05 21:16:15 +02:00

525 lines
11 KiB
CSS

.envelope-viewer-layout {
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
}
.envelope-action-bar {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-bottom: 3px solid rgba(126, 34, 206, 0.3);
padding: 1.25rem 2rem;
flex-shrink: 0;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.envelope-action-bar__inner {
max-width: 1600px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 2rem;
}
.envelope-logo svg {
filter: drop-shadow(0 2px 4px rgba(126, 34, 206, 0.3));
color: #7e22ce;
}
.envelope-title {
font-size: 1.125rem;
font-weight: 700;
color: #1e293b;
letter-spacing: -0.025em;
}
.envelope-key {
font-size: 0.8125rem;
color: #64748b;
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
font-weight: 500;
margin-top: 0.25rem;
}
.envelope-content {
flex: 1;
min-height: 0;
padding: 1.5rem;
position: relative;
overflow: auto;
}
.pdf-viewer-container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
padding: 0;
gap: 1rem;
position: relative;
}
.pdf-thumbnails {
position: absolute;
left: -280px;
top: 0;
bottom: 0;
width: 260px;
background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(20px);
border-radius: 16px;
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.12),
0 0 0 1px rgba(126, 34, 206, 0.1);
border: 1px solid rgba(126, 34, 206, 0.15);
transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 100;
display: flex;
flex-direction: column;
overflow: hidden;
}
.pdf-thumbnails--visible {
left: 0;
}
.pdf-thumbnails__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.25rem;
border-bottom: 2px solid rgba(126, 34, 206, 0.1);
flex-shrink: 0;
}
.pdf-thumbnails__title {
font-size: 0.875rem;
font-weight: 700;
color: #1e293b;
letter-spacing: 0.025em;
text-transform: uppercase;
}
.pdf-thumbnails__close {
background: transparent;
border: none;
cursor: pointer;
padding: 0.375rem;
border-radius: 6px;
color: #64748b;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.pdf-thumbnails__close:hover {
background: rgba(126, 34, 206, 0.1);
color: #7e22ce;
}
.pdf-thumbnails__content {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.pdf-thumbnails__content::-webkit-scrollbar {
width: 6px;
}
.pdf-thumbnails__content::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 3px;
}
.pdf-thumbnails__content::-webkit-scrollbar-thumb {
background: linear-gradient(135deg, #7e22ce 0%, #2a5298 100%);
border-radius: 3px;
}
.pdf-thumbnails__content::-webkit-scrollbar-thumb:hover {
background: linear-gradient(135deg, #6b1cb0 0%, #1e3a72 100%);
}
.pdf-thumbnail {
cursor: pointer;
border-radius: 8px;
overflow: hidden;
background: white;
border: 2px solid transparent;
transition: all 0.2s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.pdf-thumbnail:hover {
border-color: rgba(126, 34, 206, 0.3);
box-shadow: 0 4px 16px rgba(126, 34, 206, 0.2);
transform: translateY(-2px);
}
.pdf-thumbnail--active {
border-color: #7e22ce;
box-shadow:
0 4px 16px rgba(126, 34, 206, 0.3),
0 0 0 3px rgba(126, 34, 206, 0.1);
}
.pdf-thumbnail__preview {
width: 100%;
aspect-ratio: 210 / 297;
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.pdf-thumbnail__canvas {
max-width: 100%;
max-height: 100%;
display: block;
}
.pdf-thumbnail__label {
padding: 0.5rem;
text-align: center;
font-size: 0.75rem;
font-weight: 600;
color: #64748b;
background: rgba(126, 34, 206, 0.03);
border-top: 1px solid rgba(126, 34, 206, 0.1);
}
.pdf-thumbnail--active .pdf-thumbnail__label {
background: linear-gradient(135deg, rgba(126, 34, 206, 0.1) 0%, rgba(42, 82, 152, 0.1) 100%);
color: #7e22ce;
font-weight: 700;
}
.pdf-toolbar__btn--toggle {
background: linear-gradient(135deg, rgba(126, 34, 206, 0.08) 0%, rgba(42, 82, 152, 0.08) 100%);
border-color: rgba(126, 34, 206, 0.25);
}
.pdf-toolbar__btn--toggle:hover:not(:disabled) {
background: linear-gradient(135deg, rgba(126, 34, 206, 0.15) 0%, rgba(42, 82, 152, 0.15) 100%);
border-color: rgba(126, 34, 206, 0.5);
}
.pdf-toolbar {
background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(20px);
border-radius: 12px;
padding: 0.75rem 1.25rem;
display: flex;
align-items: center;
gap: 1rem;
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.1),
0 0 0 1px rgba(126, 34, 206, 0.1);
border: 1px solid rgba(126, 34, 206, 0.15);
flex-shrink: 0;
max-width: 95%;
width: fit-content;
}
.pdf-toolbar__section {
display: flex;
align-items: center;
gap: 0.5rem;
}
.pdf-toolbar__zoom-section {
gap: 0.75rem;
}
.pdf-toolbar__divider {
width: 1px;
height: 32px;
background: linear-gradient(180deg, transparent 0%, rgba(126, 34, 206, 0.2) 50%, transparent 100%);
}
.pdf-toolbar__btn {
background: linear-gradient(135deg, rgba(126, 34, 206, 0.05) 0%, rgba(42, 82, 152, 0.05) 100%);
border: 1px solid rgba(126, 34, 206, 0.2);
border-radius: 8px;
padding: 0.5rem;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
color: #1e293b;
min-width: 34px;
min-height: 34px;
}
.pdf-toolbar__btn:hover:not(:disabled) {
background: linear-gradient(135deg, rgba(126, 34, 206, 0.1) 0%, rgba(42, 82, 152, 0.1) 100%);
border-color: rgba(126, 34, 206, 0.4);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(126, 34, 206, 0.2);
}
.pdf-toolbar__btn:active:not(:disabled) {
transform: translateY(0);
box-shadow: 0 2px 6px rgba(126, 34, 206, 0.15);
}
.pdf-toolbar__btn:disabled {
opacity: 0.4;
cursor: not-allowed;
background: rgba(0, 0, 0, 0.02);
border-color: rgba(0, 0, 0, 0.1);
}
.pdf-toolbar__btn--preset {
padding: 0.5rem 0.875rem;
font-size: 0.813rem;
font-weight: 600;
color: #475569;
min-width: auto;
white-space: nowrap;
}
.pdf-toolbar__btn--preset svg {
flex-shrink: 0;
}
.pdf-toolbar__page-input-group {
display: flex;
align-items: center;
gap: 0.375rem;
background: white;
border: 1px solid rgba(126, 34, 206, 0.2);
border-radius: 8px;
padding: 0.25rem 0.625rem;
}
.pdf-toolbar__page-input {
width: 48px;
border: none;
outline: none;
text-align: center;
font-size: 0.875rem;
font-weight: 600;
color: #1e293b;
background: transparent;
-moz-appearance: textfield;
}
.pdf-toolbar__page-input::-webkit-outer-spin-button,
.pdf-toolbar__page-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.pdf-toolbar__page-total {
font-size: 0.875rem;
font-weight: 500;
color: #64748b;
}
.pdf-toolbar__zoom-slider-container {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.25rem;
}
.pdf-toolbar__zoom-slider {
-webkit-appearance: none;
width: 140px;
height: 6px;
border-radius: 3px;
background: linear-gradient(90deg,
rgba(126, 34, 206, 0.1) 0%,
rgba(126, 34, 206, 0.2) 50%,
rgba(126, 34, 206, 0.1) 100%);
outline: none;
cursor: pointer;
}
.pdf-toolbar__zoom-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: linear-gradient(135deg, #7e22ce 0%, #2a5298 100%);
cursor: pointer;
box-shadow: 0 2px 8px rgba(126, 34, 206, 0.3);
transition: all 0.2s ease;
}
.pdf-toolbar__zoom-slider::-webkit-slider-thumb:hover {
transform: scale(1.15);
box-shadow: 0 4px 12px rgba(126, 34, 206, 0.4);
}
.pdf-toolbar__zoom-slider::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: linear-gradient(135deg, #7e22ce 0%, #2a5298 100%);
cursor: pointer;
border: none;
box-shadow: 0 2px 8px rgba(126, 34, 206, 0.3);
transition: all 0.2s ease;
}
.pdf-toolbar__zoom-slider::-moz-range-thumb:hover {
transform: scale(1.15);
box-shadow: 0 4px 12px rgba(126, 34, 206, 0.4);
}
.pdf-toolbar__zoom-label {
font-size: 0.75rem;
font-weight: 700;
color: #7e22ce;
letter-spacing: 0.025em;
min-width: 45px;
text-align: center;
}
.pdf-frame {
background: white;
border-radius: 16px;
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.25),
0 0 0 1px rgba(255, 255, 255, 0.1);
overflow: auto;
position: relative;
padding: 2rem;
flex: 1;
width: 90%;
max-width: 1200px;
text-align: center;
}
.pdf-frame::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, #7e22ce 0%, #2a5298 100%);
z-index: 1;
border-radius: 16px 16px 0 0;
}
.pdf-canvas {
display: inline-block;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
vertical-align: top;
}
.error-container {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 2rem;
}
.alert {
border-radius: 12px;
border: none;
padding: 2rem;
max-width: 600px;
}
.alert-danger {
background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
color: #be123c;
border-left: 4px solid #e11d48;
}
.alert-warning {
background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
color: #92400e;
border-left: 4px solid #f59e0b;
}
.spinner-border {
border-width: 0.35rem;
}
@media (max-width: 768px) {
.envelope-content {
padding: 0.75rem;
}
.pdf-thumbnails {
width: 200px;
left: -220px;
border-radius: 0 16px 16px 0;
}
.pdf-thumbnails__content {
padding: 0.75rem;
gap: 0.5rem;
}
.pdf-toolbar {
flex-wrap: wrap;
padding: 0.625rem 1rem;
gap: 0.625rem;
max-width: 98%;
}
.pdf-toolbar__divider {
display: none;
}
.pdf-toolbar__zoom-slider {
width: 100px;
}
.pdf-toolbar__btn--preset {
padding: 0.425rem 0.75rem;
font-size: 0.75rem;
}
.pdf-frame {
border-radius: 12px;
padding: 1rem;
width: 95%;
}
.envelope-action-bar {
padding: 1rem 1.25rem;
}
.envelope-action-bar__inner {
flex-wrap: wrap;
}
.envelope-title {
font-size: 1rem;
}
.envelope-key {
font-size: 0.75rem;
}
.envelope-logo svg {
width: 20px;
height: 20px;
}
.alert {
padding: 1.5rem;
}
}