From 21725b35ff42fb52b5b3aaf4bf99b4db0a44aa6f Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 1 Jun 2026 10:34:48 -0400 Subject: [PATCH] External embed: code generator dialog in preview pane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per docs/EXTERNAL_EMBED_FEATURE.md §13 / §18 Phase 6 — the embed- code generator now ships alongside Phase 1's viewer so authors can grab iframe snippets directly from the community preview. UX: - New "Embed ↗" button in the preview pane's action row, between the share-link button and Use/Fork. Hidden for private rows (embed refuses them anyway); shown for locked-premium rows so designs can be embedded as watermarked-preview teasers pre- purchase. - Click opens #embedCodeModal: a single-screen dialog with identifier selector, size preset, options checkboxes, live iframe preview, and the generated iframe HTML in a copy-ready textarea + Copy URL / Copy iframe code buttons. Controls: - Identifier: naddr (latest version, auto-updates) | nevent (snapshot, frozen to this exact event). naddr is the default but falls back to nevent when the row has no d-tag. - Size: responsive 16:9 (recommended) | square 320 / 480 | fixed 640×360 / 800×450 / 960×540 | custom WxH. - Options: controls / author chip / "Open in Artstr" link / credits row — each toggled via a query param (controls=0, attr=0, open=0, credits=1). The live-preview pane uses a pink/yellow checker background so transparency in the embedded design shows through visually (verifies that the iframe is actually transparent before the user pastes the snippet on their own site). Copy buttons use navigator.clipboard.writeText with a graceful fallback toast on permission denial. The URL extracted from the generated iframe's src=, so URL/iframe stay in sync. --- src/index.html | 228 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/src/index.html b/src/index.html index 8cb5d54..87db273 100644 --- a/src/index.html +++ b/src/index.html @@ -4640,6 +4640,56 @@ + +