From 8a2c146408f00cb6748332757dc3d5fc2661ca77 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 22 May 2026 16:06:36 -0400 Subject: [PATCH] added pixel art editor --- docs/PIXEL_ART_FEATURE.md | 9 +- src/index.html | 257 +++++++++++++++++++++++++++++++++----- 2 files changed, 232 insertions(+), 34 deletions(-) diff --git a/docs/PIXEL_ART_FEATURE.md b/docs/PIXEL_ART_FEATURE.md index c029740..b5cdbb6 100644 --- a/docs/PIXEL_ART_FEATURE.md +++ b/docs/PIXEL_ART_FEATURE.md @@ -95,8 +95,13 @@ template, it is *any design*. Reachable via the **▦** tool-palette button ("Add Layer → Pixel Art") and an "Edit pixels" button / double-click on a selected pixel layer. Single static frame only. -- **Phase A2 — standalone Pixel Art design** (`templateMode: 'pixelart'`, - publish/fork as `casewrap-pixelart`, `pixel-art` category): not started. +- **Phase A2 — standalone Pixel Art design: built (pending in-browser + testing).** `templateMode: 'pixelart'` — a "Pixel Art" layout on the + Designer tab where the `#pixelEditorView` is the whole canvas area, + bound to `state.pixelArt`. Save / load / publish / fork as + `casewrap-pixelart`; appears in the community feed with a crisp + preview; the `pixel-art` category was added. Single static 32×32 grid + (grid resize is Phase B). - **Phases B / C / D:** not started. (Note: a `drawPixelArtToCanvas` export path is already wired, so pixel layers appear in PDF/JPEG export — Phase B's dedicated PNG export is still pending.) diff --git a/src/index.html b/src/index.html index 4361076..1c3e541 100644 --- a/src/index.html +++ b/src/index.html @@ -430,11 +430,13 @@ #designerLayoutFieldset { display: none; } body.app-designer #designerLayoutFieldset, body.template-customart #designerLayoutFieldset, - body.template-slide #designerLayoutFieldset { display: block; } - /* Custom Art and Slide Designer live on the Designer tab, so the - Template-tab Layout panel hides while either is active. */ + body.template-slide #designerLayoutFieldset, + body.template-pixelart #designerLayoutFieldset { display: block; } + /* Custom Art / Slide / Pixel Art live on the Designer tab, so the + Template-tab Layout panel hides while any is active. */ body.template-customart #layoutFieldset, - body.template-slide #layoutFieldset { display: none !important; } + body.template-slide #layoutFieldset, + body.template-pixelart #layoutFieldset { display: none !important; } /* Editing a deck's slide opens the slide editor; suppress the layout panels so the only way out is the "Back to deck" control. */ body.editing-deck-slide #designerLayoutFieldset, @@ -713,16 +715,19 @@ /* ---- Pixel Editor ---- */ #pixelEditorView { display: none; } - body.pixel-editing #pixelEditorView { + body.pixel-editing #pixelEditorView, + body.template-pixelart #pixelEditorView { display: flex; flex-direction: column; width: 100%; min-height: calc(100vh - 160px); } - body.pixel-editing #sheetWrap, - body.pixel-editing #discDesignerView, - body.pixel-editing #deckSorterView, - body.pixel-editing #toolPalette, - body.pixel-editing #toolOptions, - body.pixel-editing #canvasToolbar { display: none !important; } + body.pixel-editing #sheetWrap, body.template-pixelart #sheetWrap, + body.pixel-editing #discDesignerView, body.template-pixelart #discDesignerView, + body.pixel-editing #deckSorterView, body.template-pixelart #deckSorterView, + body.pixel-editing #toolPalette, body.template-pixelart #toolPalette, + body.pixel-editing #toolOptions, body.template-pixelart #toolOptions, + body.pixel-editing #canvasToolbar, body.template-pixelart #canvasToolbar { display: none !important; } + /* A standalone pixel design — the editor IS the project, so no "Done". */ + body.template-pixelart #pixelEditorDoneBtn { display: none; } .pixelEditorBar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); @@ -1154,6 +1159,15 @@ body.template-deck #exportFieldset, body.template-deck #layersFieldset, body.template-deck #printExportRow { display: none !important; } + /* Standalone Pixel Art: only Layout, Metadata and Print/Save apply. */ + body.template-pixelart #coverSizeFieldset, + body.template-pixelart #coverArtworkFieldset, + body.template-pixelart #discArtworkFieldset, + body.template-pixelart #jewelArtworkFieldset, + body.template-pixelart #customArtFieldset, + body.template-pixelart #exportFieldset, + body.template-pixelart #layersFieldset, + body.template-pixelart #printExportRow { display: none !important; } .templateLayerPanels { display: grid; @@ -1957,6 +1971,9 @@ @keyframes toastIn { from { transform:translateY(8px); opacity:0; } to { transform:translateY(0); opacity:1; } } .publishConfirmPreview { background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:10px; margin:0 0 12px; display:flex; justify-content:center; align-items:center; height:280px; overflow:hidden; } + /* Stop flexbox from horizontally shrinking the fixed-width mini-preview + (it would squish the design); fitMiniPreview scales it uniformly. */ + .publishConfirmPreview > * { flex: 0 0 auto; transform-origin: center center; } .publishConfirmMeta { margin:0 0 12px; font-size:.82rem; } .publishConfirmMetaRow { display:flex; gap:10px; padding:5px 0; border-bottom:1px solid var(--line); } .publishConfirmMetaRow:last-child { border-bottom:0; } @@ -2714,6 +2731,7 @@
+
@@ -3400,7 +3418,7 @@

Browse community templates or start your own.

-
+
@@ -3552,7 +3570,7 @@