282 lines
6.7 KiB
CSS
282 lines
6.7 KiB
CSS
/* Styles for PDF Builder View */
|
|
|
|
.pdf-builder-root {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--lumo-space-m);
|
|
width: 90%;
|
|
max-width: 90%;
|
|
margin: 10px auto 0 auto;
|
|
padding: 20px;
|
|
}
|
|
|
|
.pdf-builder-workspace {
|
|
display: flex;
|
|
gap: var(--lumo-space-l);
|
|
align-items: flex-start;
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.pdf-palette {
|
|
flex: 0 1 15%;
|
|
min-width: 10%;
|
|
max-width: 20%;
|
|
border: 1px solid var(--lumo-contrast-20pct);
|
|
border-radius: var(--lumo-border-radius-m);
|
|
background: var(--lumo-base-color);
|
|
box-shadow: var(--lumo-box-shadow-xs);
|
|
padding: var(--lumo-space-m);
|
|
}
|
|
|
|
.pdf-palette .palette-title {
|
|
font-weight: 600;
|
|
margin-bottom: var(--lumo-space-s);
|
|
}
|
|
|
|
.pdf-palette .tool-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--lumo-space-m);
|
|
padding: var(--lumo-space-s);
|
|
border: 1px dashed var(--lumo-contrast-20pct);
|
|
border-radius: var(--lumo-border-radius-s);
|
|
cursor: grab;
|
|
user-select: none;
|
|
}
|
|
|
|
.pdf-palette .tool-item + .tool-item { margin-top: var(--lumo-space-s); }
|
|
|
|
.pdf-palette .tool-item:hover {
|
|
background: var(--lumo-contrast-5pct);
|
|
}
|
|
|
|
.pdf-canvas-wrapper {
|
|
flex: 1 1 auto;
|
|
display: flex;
|
|
justify-content: center;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Inspector (right side) */
|
|
.pdf-inspector {
|
|
flex: 0 1 15%;
|
|
min-width: 10%;
|
|
max-width: 20%;
|
|
border: 1px solid var(--lumo-contrast-20pct);
|
|
border-radius: var(--lumo-border-radius-m);
|
|
background: var(--lumo-base-color);
|
|
box-shadow: var(--lumo-box-shadow-xs);
|
|
padding: var(--lumo-space-m);
|
|
max-height: calc(100vh - 220px);
|
|
overflow: auto;
|
|
}
|
|
|
|
.pdf-inspector .inspector-title {
|
|
font-weight: 600;
|
|
margin-bottom: var(--lumo-space-s);
|
|
}
|
|
|
|
.inspector-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--lumo-space-xs);
|
|
padding: var(--lumo-space-s) 0;
|
|
border-bottom: 1px dashed var(--lumo-contrast-10pct);
|
|
margin-bottom: var(--lumo-space-s);
|
|
}
|
|
|
|
.inspector-item:last-child {
|
|
border-bottom: none;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.inspector-item .item-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: var(--lumo-space-xs);
|
|
}
|
|
|
|
.inspector-item .item-label {
|
|
font-weight: 500;
|
|
font-size: var(--lumo-font-size-s);
|
|
color: var(--lumo-body-text-color);
|
|
margin: 0;
|
|
}
|
|
|
|
.inspector-item .field-collapse-button {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
padding: var(--lumo-space-xs);
|
|
border-radius: var(--lumo-border-radius-s);
|
|
color: var(--lumo-secondary-text-color);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.inspector-item .field-collapse-button:hover {
|
|
background: var(--lumo-contrast-10pct);
|
|
color: var(--lumo-body-text-color);
|
|
}
|
|
|
|
.inspector-item .item-fields {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--lumo-space-xs);
|
|
transition: opacity 0.3s ease, max-height 0.3s ease;
|
|
max-height: 1000px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.inspector-item.fields-collapsed .item-fields {
|
|
opacity: 0;
|
|
max-height: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.pdf-inspector vaadin-number-field {
|
|
width: 100%;
|
|
}
|
|
|
|
.pdf-canvas {
|
|
width: 100%;
|
|
aspect-ratio: 210 / 297; /* A4 */
|
|
position: relative;
|
|
background: white;
|
|
border: 1px solid var(--lumo-contrast-20pct);
|
|
box-shadow: var(--lumo-box-shadow-m);
|
|
background-image: linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
|
|
linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
|
|
background-size: 20px 20px;
|
|
}
|
|
|
|
.canvas-frame {
|
|
position: absolute;
|
|
border: 3px solid var(--lumo-contrast-30pct); /* inactive: light gray */
|
|
border-radius: var(--lumo-border-radius-s);
|
|
background: rgba(255,255,255,0.9);
|
|
resize: none;
|
|
overflow: auto;
|
|
min-width: 5%;
|
|
min-height: 5%;
|
|
cursor: default;
|
|
user-select: none;
|
|
}
|
|
|
|
.canvas-frame.active {
|
|
border: 3px solid var(--lumo-primary-color); /* active: blue */
|
|
box-shadow: none;
|
|
resize: both;
|
|
cursor: default;
|
|
}
|
|
|
|
.canvas-frame .text-editor {
|
|
width: 100%;
|
|
height: 100%;
|
|
cursor: text;
|
|
user-select: text;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.canvas-frame .text-toolbar {
|
|
position: absolute;
|
|
left: 0;
|
|
top: -40px;
|
|
display: none;
|
|
align-items: center;
|
|
gap: var(--lumo-space-xs);
|
|
background: var(--lumo-base-color);
|
|
border: 1px solid var(--lumo-contrast-20pct);
|
|
border-radius: var(--lumo-border-radius-s);
|
|
box-shadow: var(--lumo-box-shadow-xs);
|
|
padding: 2px 4px;
|
|
cursor: default;
|
|
user-select: none;
|
|
}
|
|
|
|
.canvas-frame.active .text-toolbar { display: flex; }
|
|
|
|
.canvas-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
|
|
|
|
.pdf-builder-actions { display: flex; justify-content: flex-end; }
|
|
|
|
/* Capturing mode: hide frame borders, handles, toolbars for save/export */
|
|
.pdf-canvas.capturing .canvas-frame,
|
|
.pdf-canvas.capturing .canvas-frame.active {
|
|
border-color: transparent !important; /* hide border but keep layout */
|
|
box-shadow: none !important;
|
|
resize: none !important;
|
|
}
|
|
.pdf-canvas.capturing .frame-handle-move,
|
|
.pdf-canvas.capturing .text-toolbar {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Export-only: make box backgrounds transparent */
|
|
.pdf-canvas.capturing-export .canvas-frame,
|
|
.pdf-canvas.capturing-export .text-editor {
|
|
background: transparent !important;
|
|
}
|
|
|
|
/* Image frames: no scrollbars */
|
|
.image-frame {
|
|
overflow: hidden; /* hide scrollbars */
|
|
-ms-overflow-style: none; /* IE/Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
}
|
|
.image-frame::-webkit-scrollbar { display: none; } /* WebKit */
|
|
|
|
/* Text frames: no scrolling allowed */
|
|
.text-frame {
|
|
overflow: hidden; /* disable scrolling */
|
|
-ms-overflow-style: none; /* IE/Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
}
|
|
.text-frame::-webkit-scrollbar { display: none; } /* WebKit */
|
|
|
|
/* Also disable scrolling inside the text editor */
|
|
.text-frame .text-editor {
|
|
overflow: hidden; /* disable scrolling */
|
|
-ms-overflow-style: none; /* IE/Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
}
|
|
.text-frame .text-editor::-webkit-scrollbar { display: none; } /* WebKit */
|
|
|
|
/* Move handle (top-left) visible only when active */
|
|
.frame-handle-move {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 16px;
|
|
height: 16px;
|
|
display: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 10px;
|
|
line-height: 1;
|
|
color: var(--lumo-primary-color);
|
|
background: #fff;
|
|
border: 1px solid var(--lumo-primary-color);
|
|
border-radius: 4px;
|
|
box-shadow: var(--lumo-box-shadow-xs);
|
|
cursor: grab;
|
|
z-index: 2;
|
|
user-select: none;
|
|
transform: translate(-50%, -50%); /* center the handle on the top-left corner */
|
|
}
|
|
|
|
.canvas-frame.active .frame-handle-move { display: flex; }
|
|
|
|
.frame-handle-move:active { cursor: grabbing; }
|
|
|
|
/* bottom-right visual icon removed; native CSS resize handle remains */
|