Skip to content

feat: add embed mode for iframing pages into Parallel Squared - #94

Open
dr3 wants to merge 6 commits into
masterfrom
feat/embed-mode
Open

dr3 wants to merge 6 commits into
masterfrom
feat/embed-mode

Conversation

@dr3

@dr3 dr3 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Adds an ?embed mode so pages can be iframed seamlessly into Parallel Squared (e.g. /secret/6-11-maths-years).

  • ?embed hides the header, footer, beta banner, welcome and privacy modals (also on static and error pages)
  • Sidebar keeps only the level toggle and PG list (links point at /secret/:pid); on mobile it stacks below the content
  • New embed.js posts the content height to the parent (parallel:embed:height) on resize, content changes, image/font load; skips 0 so submit reloads don't collapse the frame
  • Links to other pages open in the top window; in-page anchors stay in the frame
  • Embed responses send frame-ancestors 'self' http://localhost:*; loading ?embed outside a frame redirects to the normal page (so the privacy modal can't be skipped)
  • Transparent, full-width article styling in embed mode; asset versions bumped
  • Password form keeps existing query params so embed survives
  • insideIframe detection now adds a class instead of overwriting body.className

No effect on normal page loads. Should deploy before the Parallel Squared /secret route.

dr3 added 6 commits November 16, 2026 15:17
?embed strips the page chrome and reports the content height to the parent window via postMessage so the host iframe can auto-size.
Keep embed on static and error pages, bump asset versions, restrict framing to same origin, drop embed when not framed, and open external links in the top window without breaking in-page anchors.
Hide only the intro, circles and account buttons; PG links point at /pg/:pid, and on mobile the picker stacks below the content.
Article keeps its white background and padding so the content reads as a card on the host page's background.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant