json.dumps handles escaping. Manual replace was double-escaping
quotes causing \\\" in SVG attributes. Also strip <script>
tags from extracted preview HTML.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
34 templates copied and tokenized with --tp-* CSS variable contract.
Templates render inline in DOM (no iframes) so shader backgrounds
work behind them and CSS variables cascade naturally.
Removed deck-stage.js files (not needed for inline preview).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Templates render directly in the DOM via extracted preview_html.
Build script extracts first slide CSS + HTML, scopes with tp-{slug}
class prefix. No more iframes — shader canvases render behind
transparent template content, --tp-* variables cascade naturally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Templates render directly in the DOM via extracted preview_html.
Build script extracts first slide CSS + HTML, scopes with tp-{slug}
class prefix. No more iframes — shader canvases render behind
transparent template content, --tp-* variables cascade naturally.
Fine-tune overrides set --tp-* directly on the inline container
element instead of injecting styles into an iframe document.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copied 34 templates from beautiful-html-templates into repo.
tokenize-templates.py converts all hardcoded colors and fonts to
reference --tp-bg, --tp-fg, --tp-ac, --tp-mt, --tp-hf, --tp-bf tokens.
1240 color replacements across 34 templates.
Override functions simplified: just set --tp-* tokens, everything
cascades. No more luminance mapping or name heuristics needed.
--tp-bg-layer added for shader background swap support.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Variables named sun/ember/coral/accent/brand map to accent color.
Variables named paper/canvas/bg/cream map to background.
Variables named ink/text/fg/dark map to foreground.
Variables named mute/gray/line/border map to muted.
Fallback to luminance for unrecognized names.
Fixes biennale-yellow's bright yellow accent being mapped to bg.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Selecting palette index 0 clears the finetune-override style in the
template iframe, reverting to the template's native colors/fonts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These were hidden in a display:none div during the component view
restructuring. Restored as visible showcase sections with their
eyebrow labels. Palette and type lead text remain hidden (unused).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Clear override CSS before reading originals to prevent drift.
Cache by template slug so all iframes for the same template share
original values. Font var matching tightened to --f-* prefix only.
Removed border-radius override that was breaking template layouts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cache each iframe's original CSS variable values on first capture,
then always remap from originals to prevent luminance drift on
repeated option changes. Apply overrides to ALL template iframes
(hero + specimen grid). Helper functions extracted for reuse.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove .active from trans-overlay and .selected-exit from cards
in the embedded picker iframe when the back button is clicked.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace generic component cards with the template's actual slides
rendered as small preview thumbnails below the hero card. Each slide
loads in its own iframe, navigated to the correct slide index,
with contextual text injected. Shows up to 6 slides per template.
Removed slide cycling nav from hero card — first slide only.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 1 shows a static first-slide preview for each template.
No arrows, no slide counter, no navigation. Cleaner grid, fewer
bugs from slide system differences. Full slide cycling available
in Phase 2 after selecting a template.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
overflow:hidden clips scrollHeight so scrollTop can't reach later
slides. Instead, clip the container to 1080px height and use
transform:translateY to shift the slide stack. No scrolling needed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deck-stage (absolute positioned) uses visibility toggling.
All other templates (vertical stacks, flex scrolls) use scrollTop
positioning — slides stay visible, container scrolls to target.
Detect mode by checking if slides have position:absolute.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
scrollIntoView bubbles and scrolls the parent page when cycling
slides inside template iframes. Replace with direct scrollTop/
scrollLeft assignment on the container, body, and documentElement.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Many deck-stage templates use section classes like s-cover, s-manifesto
instead of .slide. Target deck-stage>section directly and use .active
class for visibility toggling. Clear all active classes before setting
the first one on load.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Apply palette (colors by luminance mapping), typography (font family
overrides for display/body CSS vars), corners (border-radius), and
background color to the template iframe on every option change.
Collects all CSS custom properties from template stylesheets and
remaps them based on the selected theme+palette+type+corners.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a palette is selected in Phase 2, inject CSS variable overrides
into the template iframe using luminance-based color mapping. Same
approach as the template picker's applyPal function.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Agents should include a 'Template Original' palette as the first entry
in pick-design.html PALETTES so users can revert to native template
colors after trying custom palettes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
renderPreview() skips scene grid rebuild if a template iframe is
present, preventing palette changes from replacing the selected
template with the static preview_frames architecture.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All templates now use scrollIntoView instead of visibility toggling.
Works universally for scroll-stacked, transform-based, and absolute
positioned slides. Lock body overflow to show one slide at a time.
Reset child opacity on the active slide to fix animation start states.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Non-active slides had children with opacity:0 from animation reset.
When cycling to them, only the container got visible — children stayed
invisible. Now reset all child opacity/visibility when activating a slide.
Also stop setting opacity:0 on hidden slides — visibility:hidden suffices.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace motion template thumbnail row with a full-width playable card
using <hyperframes-player>. Plays on hover, pauses and resets on leave.
First card: thesis composition restyled with biennale-yellow palette.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New top row shows HyperFrames video compositions as motion templates.
Each card has a thumbnail, name, and 'video' badge. Clicking sends
a templatePick message with motionTemplate:true flag. Data injected
via __MOTION_TEMPLATES_JSON__ placeholder.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The template picker matches replacement text to original word count.
Agents must generate pools with varied lengths so pickByLength has
good candidates for both short (2-word) and long (6+ word) slots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pickByLength() scans the pool for the closest word-count match
to the original text. A 2-word headline gets a 2-word replacement,
a 15-word paragraph gets a similar-length one. Prevents layout
overflow from mismatched text lengths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
deck-stage templates use <section class='s-cover'> not <section class='slide'>.
Query now falls back to section[class] when .slide finds nothing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Template picker passes PROMPT_TEXT and tone in the postMessage.
The bridge's iframe onload runs the same text injection logic
(display/headlines/body/stats/labels/smalls by font-size) so
the fine-tune preview shows contextual content, not placeholders.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scale 1→1.06 over first 45%, then 1.06→1.08 while fading out
over remaining 55%. Phase 2 triggers at 900ms mid-fade.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Background fades to black (0.5s), card scales up 6% and holds,
then card fades out after background is dark. No dramatic zoom.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Calculates offset from card center to viewport center and sets
transform-origin so the zoom always converges on the middle of
the screen regardless of card position.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace two-class transition with one keyframe animation.
scale(1)→scale(4) over 0.9s, opacity fades after 60%.
cubic-bezier(0.4,0,0,1) for smooth acceleration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Card scales to 3.5x (well beyond viewport) over 0.8s with
cubic-bezier easing. Background fades to black over 0.5s.
Card fades out at 0.4s delay. Phase 2 slides in over 0.6s.
Total transition ~900ms for cinematic feel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Click a template card: background fades to black, card scales up
and fades out over 450ms, then Phase 2 fades in with subtle slide-up.
Smooth handoff between browsing and configuring.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace moodboard HTML with iframe to template-picker.html. Tab says
'1. Template'. Clicking a template sends postMessage to parent which
triggers goToTune() — no page navigation, no flash. Template picker
and fine-tune live on the same page.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When pick-design.html is opened from the template picker bridge,
rewrite the Direction tab to show '← Template' and navigate back
to template-picker.html instead of showing the empty moodboard view.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When bridging from template picker, replace the static preview_frames
with a live iframe of the selected template. Includes slide cycling,
deck-stage fallback CSS, opacity reset for animation start states,
and scroll-mode detection for flex-scroll templates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Guard mood-title, mood-grid, pal-bar, mood-next-btn references so
pick-design.html works when Phase 1 is replaced by template picker.
Add handleTemplatePick bridge that reads sessionStorage/postMessage
and auto-advances to Phase 2 with selected template metadata.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>