Files
EnvelopeGenerator/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css
TekH 76945c9051 Redesign PDF toolbar with enhanced functionality
The PDF toolbar in `EnvelopeViewer.razor` has been redesigned to improve usability and functionality. Key changes include:

- Added buttons for page navigation, zooming, and preset zoom levels.
- Introduced a zoom slider and page input field for direct control.
- Added "Fit to Width" and "Set Zoom to 100%" features.
- Updated `ZoomIn` and `ZoomOut` methods with boundary checks.
- Added new methods: `SetZoom`, `OnZoomSliderChanged`, `OnPageInputChanged`, and `FitToWidth`.

Styling updates in `envelope-viewer.css` include a modernized toolbar design with rounded corners, shadows, and responsive layouts for smaller screens.

`pdf-viewer.js` was updated with `setScale` and `fitToWidth` methods to support the new functionality. These changes enhance the interactivity, flexibility, and user experience of the PDF viewer.
2026-06-05 13:31:36 +02:00

361 lines
7.4 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;
}
.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-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;
}
}