From 915ad80a64ef2b7155f7d6aafd4dcaa6c9f08320 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 17 May 2026 14:03:53 -0400 Subject: [PATCH] Add color/text layers, lock, duplicate, font picker, JPEG-via-PDF export Layer system: - New 'color' layer type: solid fill, color picker in selected-layer controls, full-fill of target section by default, locked by default - Text layer: replaced 'Name' field with a multi-line 'Text' textarea bound to layer.html (round-trips with the canvas's contentEditable edits) - Text layer: web-safe font family picker (15 options, each previewing its own font) and font-family applied across all 5 render sites - Layer locking: locked layers get pointer-events:none on the canvas and a LOCK badge in the layer list; selected-layer panel has a lock checkbox - Duplicate-layer button: clones the selected layer with new id, slight position offset, fresh z, and "copy" appended to the name - Move forward / Move back now step one position at a time (swap z with the immediate neighbor in the same target region) instead of jumping to the extremes Cover preview: - renderTemplatePreviewDOM now renders user layers (color/text/image) for cover-relevant targets, with correct coordinate translation from page (including bleed) into the trim-only preview viewport Print PDF: - print-color-adjust: exact added so color-layer backgrounds aren't stripped - Cover-mode page is now landscape Letter (11x8.5) with the sheet centered via position: fixed, dropping the old 90-degree rotation hack - Hide .modal in @media print so open modals don't bleed into the print Title/category save bug: - preferredDiscProjectTitle/imdb/category/language now fall back to state.meta values when both disc-slot metas are empty, instead of blanking state.meta.title each render in disc mode Close project: - closeTemplateProject and closeDiscDesignerProject now sync all input panels (slots, discs, jewel, combined, title fields) after resetting state, and also clear cover layers, jewel inserts, and both spine-label sets Welcome modal: minor regression-fix wiring (kept from prior commit) JPEG export via PDF: - New "Export JPEG" modal with a two-step flow: 1) Open the print dialog -> Save as PDF (page sized to artwork) 2) Pick that PDF -> PDF.js rasterizes page 1 -> JPEG download - Lazy-loads pdf.js from cdnjs on first use - Print "export mode": temporarily moves .sheet to a body-level #exportPrintContainer with explicit inline styles, sets @page to the trim area (cover: panelW*2+spineW x trimH, no bleed margin), hides everything else; restored on afterprint - Saved PDF filename is "-jpeg-source.pdf" so it's easy to tell apart from the print-ready PDF Co-Authored-By: Claude Sonnet 4.6 --- src/index.html | 595 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 531 insertions(+), 64 deletions(-) diff --git a/src/index.html b/src/index.html index 7917f82..967eee0 100644 --- a/src/index.html +++ b/src/index.html @@ -1439,9 +1439,12 @@ } - .modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display:none; z-index:1000; } + .modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; z-index:1000; } .modal.open { display:block; } .modalCard { width:min(900px,92vw); max-height:88vh; overflow:auto; margin:4vh auto; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:14px; } + .modalInner { width:92vw; max-height:88vh; overflow:auto; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:18px 20px; box-shadow:0 12px 36px rgba(0,0,0,.45); font-family:inherit; } + .modalInner h2 { font-family:inherit; } + .modalInner label, .modalInner p, .modalInner .hint { font-family:inherit; } .searchGrid{display:grid;grid-template-columns:1fr 140px 110px;gap:8px;align-items:end} .results{display:grid;gap:8px;margin-top:10px} .resultItem{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:8px;background:rgba(127,127,127,.07)} @@ -1585,7 +1588,7 @@ overflow: hidden !important; } - aside, .topbar, .printHelp, .nostrWidget { + aside, .topbar, .printHelp, .nostrWidget, .modal { display: none !important; } @@ -1670,6 +1673,29 @@ margin: 0 !important; } + /* "Export print" mode: isolate the sheet inside #exportPrintContainer + so it renders at exact artwork dimensions with no surrounding chrome */ + html:has(body.export-print), + body.export-print { + margin: 0 !important; + padding: 0 !important; + width: auto !important; + height: auto !important; + overflow: visible !important; + } + body.export-print > *:not(#exportPrintContainer) { + display: none !important; + } + #exportPrintContainer { + position: absolute !important; + top: 0 !important; + left: 0 !important; + margin: 0 !important; + padding: 0 !important; + overflow: hidden !important; + background: #ffffff !important; + } + .slot, .discSlot, .jewelSlot { border-color: transparent !important; } @@ -2543,6 +2569,31 @@ + +