Skip to content

Printable 5 × 7 QR flyer + PWA install invitation - #21

Merged
DLinacre merged 1 commit into
mainfrom
arena/a01ba5fb-pokeguru
Nov 14, 2026
Merged

DLinacre merged 1 commit into
mainfrom
arena/a01ba5fb-pokeguru

Conversation

@DLinacre

Copy link
Copy Markdown
Owner

What

🎴 Download PokeGuru Flyer — a print-ready, single-page PDF (PokeGuru-5x7-QR-Flyer.pdf) generated in the browser on demand:

  • Exactly 5 × 7 in portrait (127 × 177.8 mm, 360 × 504 pt), MediaBox = CropBox, one page.
  • Fully vector: standard Helvetica faces, native paths for the artwork, one rectangle per QR module.
  • QR: EC level Q, 4-module quiet zone, black on white, large plate, hostname printed underneath, in the PokeGuru palette with original wrapper/card motifs. Copy: “Discover. Collect. Open.”, “Scan to explore PokeGuru”, “Free to explore · unlimited virtual pack openings”, plus the unofficial-fan-project disclaimer. No official artwork, no partnership claims.
  • Production URL enforced: VITE_PUBLIC_SITE_URL, else the served origin — only when https, no path/query/hash, and not localhost/127.x/*.local/*.e2b.app/Vercel preview or branch hosts. Otherwise a clear configuration warning and no PDF.
  • Print flyer opens the same PDF for the browser print dialogue (falls back to a download when pop-ups are blocked).
  • Surfaces: footer, homepage “Share PokeGuru” panel (with live vector preview) and the About page.

PWA install invitation — “Take PokeGuru with you!” card:

  • Appears ~7 s after load; beforeinstallprompt is captured (default prevented) and prompt() is only called after Install PokeGuru is clicked.
  • iOS gets honest Safari “Add to Home Screen” steps instead of a fake one-tap prompt; unsupported browsers never see the card.
  • Maybe later/dismissal remembered for 60 days; hidden entirely in standalone display mode.

Verification

  • npx tsc --noEmit, npx eslint ., npm run build — clean.
  • npx vitest run — 150 passed (18 new).
  • tests/flyer.test.ts re-opens the generated PDF (page count 1, 360 × 504 pt, portrait) and decodes the QR with the independent jsqr decoder, asserting the payload is https://pokeguru.vercel.app.

Docs

README: flyer section (sizes, printing at 100%, URL configuration, QR verification) and the install-invitation behaviour; .env.example notes that VITE_PUBLIC_SITE_URL also drives the printed QR code.

Flyer
- src/services/flyer: declarative vector scene (360 x 504 pt = 5 x 7 in),
  QR generation with a 4-module quiet zone (EC level Q) and a lazy pdf-lib
  renderer that emits a single print-ready page with MediaBox = CropBox.
- The QR code may only encode the production site: VITE_PUBLIC_SITE_URL wins,
  otherwise the served origin is used only when it is a real https production
  address (localhost, 127.x, *.local, e2b previews and Vercel preview/branch
  hosts are rejected). Otherwise the UI shows a configuration warning and
  generates nothing - no dummy URL, no fake download.
- Download PokeGuru Flyer (exact filename PokeGuru-5x7-QR-Flyer.pdf) and Print
  flyer actions, plus a live vector preview, surfaced in the footer, the
  homepage 'Share PokeGuru' panel and the About page.

PWA install invitation
- InstallPrompt: 'Take PokeGuru with you!' shown ~7s after load, only when the
  browser fired beforeinstallprompt or on iOS (share-sheet instructions).
  prompt() is called only after Install is chosen; dismissals are remembered
  for 60 days; hidden when already running standalone.

Tests: PDF page count/box, QR decoded with the independent jsqr decoder,
origin resolution rules, install-prompt behaviour. Docs: README + .env.example.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@DLinacre
DLinacre merged commit 716370b into main Nov 14, 2026
2 checks passed
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