From 20cbe78805d7e66f36b004cea27b0c2fa1a1fef1 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 17 May 2026 19:11:18 -0400 Subject: [PATCH] Mini-preview cards, fixed scaling, welcome close button, danger styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Template browser cards now render WYSIWYG mini-previews instead of just the background image. Each card shows the full layered composition (color fills, text, image layers, slot artwork) at thumbnail scale, with the design's natural silhouette preserved — discs stay circular, sheets stay rectangular, cover stays wide. Preview renderers (4 total): - Added a `compact` option to renderTemplatePreviewDOM, renderDiscSheetPreviewDOM, renderJewelPreviewDOM, renderDiscPreviewDOM. When compact: drop labels (BACK/SPINE/FRONT, Disc 1/2, FRONT/TRAY, sheet titles), drop shadow, drop border lines. - Compact mode renders each preview at a fixed natural pixel size (720 wide for sheets, 380 for disc-design); fitMiniPreview applies a CSS transform: scale() to fit the thumb. Everything — text, layer positions, slot art — scales together so the mini is a true miniature of what `Preview` shows. Disc-design preview specific fixes: - Was the only renderer not sorting layers by z, so they rendered in array order and a higher-z layer added earlier could be hidden behind a lower-z layer added later. Now sorted ascending and stacked in DOM. - Added explicit z-index values matching the disc-sheet renderer (bg img z:1, layers z:3+sortedIndex, hole z:12) to avoid stacking context surprises from the per-layer transform: rotate(). - Used Number(layer.x) etc. for defensive coercion of legacy payloads. - Made the center hole percentage-sized so it scales with the disc. Cover preview fix: - Dropped the unnecessary `row` wrapper that broke mini-preview sizing. preview is appended directly to container, same shape as the other three renderers. The `!hasArtwork` early-return now only fires in non-compact mode so empty covers still show their silhouette in the card thumb. UI polish: - Close button (×) in the top-right corner of the welcome modal. - Both "Close project" buttons (template-mode and disc-designer) now use the .danger class to match the styling of the other destructive buttons in their panels. Co-Authored-By: Claude Sonnet 4.6 --- src/index.html | 335 +++++++++++++++++++++++++++---------------------- 1 file changed, 187 insertions(+), 148 deletions(-) diff --git a/src/index.html b/src/index.html index 4978d7a..45a7939 100644 --- a/src/index.html +++ b/src/index.html @@ -1513,7 +1513,11 @@ .feedTrustBadge{font-size:.62rem;background:rgba(0,184,230,.12);color:var(--accent);border:1px solid rgba(0,184,230,.25);border-radius:4px;padding:1px 5px;margin-left:5px;white-space:nowrap;flex-shrink:0} body.dark .feedTrustBadge{background:rgba(0,217,255,.1);border-color:rgba(0,217,255,.2)} .feedCard.feedCardBlurred .feedCardThumb img, - .feedCard.feedCardBlurred .feedCardThumb canvas{filter:blur(14px) saturate(.5);transition:filter .15s} + .feedCard.feedCardBlurred .feedCardThumb canvas, + .feedCard.feedCardBlurred .miniPreviewWrap{filter:blur(14px) saturate(.5);transition:filter .15s} + .miniPreviewWrap{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;contain:layout style paint;z-index:2} + .miniPreviewWrap > *{margin:0!important;box-shadow:none!important;flex:0 0 auto;transform-origin:center center} + .feedCardThumb .miniPreviewWrap ~ .feedCardThumbLabel{display:none} .feedCard.feedCardBroken{opacity:.55} .feedCard.feedCardBroken .feedCardThumb{background:repeating-linear-gradient(45deg,#f1f5f9,#f1f5f9 10px,#e2e8f0 10px,#e2e8f0 20px)} .feedCardBrokenBadge{position:absolute;top:6px;right:6px;background:rgba(220,38,38,.92);color:#fff;font-size:.62rem;font-weight:700;border-radius:4px;padding:2px 6px;z-index:6;letter-spacing:.03em} @@ -1527,6 +1531,8 @@ body.dark .feedTypeBtn.active{color:#fff} .feedCategorySelect{width:auto;min-width:130px;padding:5px 8px;font-size:.78rem} .welcomeCard { max-width: 900px; width: min(900px, 92vw); } + .welcomeCloseBtn { position:absolute; top:8px; right:10px; width:32px; height:32px; border:0; background:transparent; color:var(--muted); font-size:24px; line-height:1; cursor:pointer; padding:0; border-radius:6px; display:flex; align-items:center; justify-content:center; } + .welcomeCloseBtn:hover { background:rgba(127,127,127,.15); color:var(--ink); } .welcomeSearchRow { display:grid; grid-template-columns: 1fr 160px 160px auto; gap:8px; align-items:end; margin-bottom:12px; } .welcomeTabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin:4px 0 10px; flex-wrap:wrap; } .welcomeTab { background:transparent; border:0; padding:8px 14px; cursor:pointer; font-weight:700; color:var(--muted); border-bottom:2px solid transparent; font-size:.85rem; } @@ -1917,7 +1923,7 @@
- +
Nostr @@ -2246,7 +2252,7 @@
- +
Nostr @@ -2369,7 +2375,8 @@