mirror of
https://github.com/shrekbytes/advanced-pdf-export.git
synced 2026-07-22 07:25:03 +00:00
282 lines
5.8 KiB
CSS
282 lines
5.8 KiB
CSS
/* Advanced PDF Export — plugin styles */
|
|
|
|
/* Modal sizing */
|
|
|
|
.mpdf-modal {
|
|
width: 96vw;
|
|
max-width: 1800px;
|
|
height: 90vh;
|
|
max-height: 90vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.mpdf-modal .modal-content {
|
|
padding: 0;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Top bar — three-section flex layout: controls | title | actions */
|
|
.mpdf-topbar {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 12px;
|
|
height: 44px;
|
|
background: var(--background-secondary);
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
flex-shrink: 0;
|
|
gap: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Left group: style/size/zoom controls */
|
|
.mpdf-topbar-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
/* Centered note title */
|
|
.mpdf-topbar-title {
|
|
flex-shrink: 0;
|
|
max-width: 28%;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: var(--text-normal);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
padding: 0 16px;
|
|
text-align: center;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
/* Right group: page count + action buttons */
|
|
.mpdf-topbar-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex: 1;
|
|
min-width: 0;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
/* Control group (label + input) */
|
|
.mpdf-ctrl {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.mpdf-ctrl-label {
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.mpdf-select {
|
|
background: var(--background-primary);
|
|
color: var(--text-normal);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
padding: 3px 6px;
|
|
cursor: pointer;
|
|
outline: none;
|
|
}
|
|
|
|
.mpdf-select:hover {
|
|
border-color: var(--interactive-accent);
|
|
}
|
|
|
|
.mpdf-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
background: var(--background-primary);
|
|
color: var(--text-normal);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 5px;
|
|
font-size: 12px;
|
|
padding: 4px 10px;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition: all 0.12s;
|
|
}
|
|
|
|
.mpdf-btn:hover {
|
|
border-color: var(--interactive-accent);
|
|
color: var(--interactive-accent);
|
|
}
|
|
|
|
.mpdf-btn-primary {
|
|
background: var(--interactive-accent);
|
|
color: var(--text-on-accent);
|
|
border-color: transparent;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.mpdf-btn-primary:hover {
|
|
background: var(--interactive-accent-hover);
|
|
color: var(--text-on-accent);
|
|
}
|
|
|
|
.mpdf-btn-icon {
|
|
padding: 4px 6px;
|
|
}
|
|
|
|
.mpdf-btn-icon svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
/* Disabled state — used while rendering or exporting */
|
|
.mpdf-btn:disabled,
|
|
.mpdf-btn-primary:disabled {
|
|
opacity: 0.55;
|
|
cursor: not-allowed;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.mpdf-page-count {
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
white-space: nowrap;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Main layout */
|
|
.mpdf-main {
|
|
display: flex;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Editor panel */
|
|
.mpdf-editor-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 42%;
|
|
min-width: 200px;
|
|
border-right: 1px solid var(--background-modifier-border);
|
|
background: var(--background-primary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Editor textarea */
|
|
.mpdf-editor {
|
|
flex: 1;
|
|
background: transparent;
|
|
color: var(--text-normal);
|
|
border: none;
|
|
outline: none;
|
|
resize: none;
|
|
font-family: var(--font-monospace);
|
|
font-size: 13px;
|
|
line-height: 1.75;
|
|
padding: 16px 18px;
|
|
tab-size: 2;
|
|
}
|
|
|
|
.mpdf-editor::placeholder {
|
|
color: var(--text-faint);
|
|
}
|
|
|
|
/* Preview container — wraps the scrollable preview and the non-scrolling
|
|
loading overlay as siblings so the overlay never scrolls with the pages. */
|
|
.mpdf-preview-container {
|
|
flex: 1;
|
|
position: relative;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Preview panel */
|
|
.mpdf-preview {
|
|
flex: 1;
|
|
background: var(--background-secondary-alt, #2a2a30);
|
|
overflow-y: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 28px 20px 48px; /* extra bottom so last page label isn't clipped */
|
|
gap: 24px;
|
|
}
|
|
|
|
/* Loading overlay — sits on top of the preview, hidden by default.
|
|
Shown (display:flex) whenever a render or initial open is in progress. */
|
|
.mpdf-loading-overlay {
|
|
position: absolute;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.38);
|
|
backdrop-filter: blur(3px);
|
|
-webkit-backdrop-filter: blur(3px);
|
|
display: none; /* toggled to flex in JS */
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 14px;
|
|
z-index: 20;
|
|
pointer-events: none; /* let clicks through to cancel/settings while loading */
|
|
}
|
|
|
|
.mpdf-spinner {
|
|
width: 34px;
|
|
height: 34px;
|
|
border: 3px solid rgba(255, 255, 255, 0.12);
|
|
border-top-color: var(--interactive-accent);
|
|
border-radius: 50%;
|
|
animation: mpdf-spin 0.65s linear infinite;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
@keyframes mpdf-spin {
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
.mpdf-loading-text {
|
|
font-size: 12px;
|
|
color: rgba(255, 255, 255, 0.65);
|
|
font-family: var(--font-interface);
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
/* Page wrapper — width/height set inline to match the scaled page footprint */
|
|
.mpdf-page-wrap {
|
|
position: relative;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.mpdf-page-label {
|
|
position: absolute;
|
|
top: -18px;
|
|
left: 0;
|
|
font-size: 10px;
|
|
color: rgba(255, 255, 255, 0.3);
|
|
font-family: var(--font-monospace);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Clips the scaled shadow-host page to its visual footprint — width/height set inline */
|
|
.mpdf-page-scale {
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
/* .mpdf-page no longer exists as a light-DOM element.
|
|
Each preview page is now a Shadow DOM host; its background, box-shadow,
|
|
and dimensions are declared via :host {} inside the per-page shadow stylesheet
|
|
that drawPreview() generates from the active preset's values. */
|
|
|
|
/* Zoom slider in the topbar — width and accent colour kept in CSS so the
|
|
inline style can be dropped from main.ts. */
|
|
.mpdf-zoom-slider {
|
|
width: 64px;
|
|
accent-color: var(--interactive-accent);
|
|
}
|