Skip to content

feat: example credits, keybinds, and description overlay#8783

Merged
kpal81xd merged 22 commits into
mainfrom
feat/example-credits-keybinds
May 28, 2026
Merged

feat: example credits, keybinds, and description overlay#8783
kpal81xd merged 22 commits into
mainfrom
feat/example-credits-keybinds

Conversation

@kpal81xd
Copy link
Copy Markdown
Contributor

@kpal81xd kpal81xd commented May 26, 2026

Description

  • Adds @credit / @flag blocks to example @config comments, with schema validation.
  • Folds the legacy @keybinds directive into description prose using markdown-lite — authors write keybinds inline as `key` chips separated by ·. No more dedicated subpanel.
  • Renders the description as a centered top-of-canvas overlay (capped at 475px wide). Supports markdown-lite inline syntax — **bold**, *italic*, `code`, [text](url), and {accent:text} palette colors — parsed safely to React nodes (no raw HTML).
  • Renders credits as a separate bottom-right overlay, toggleable via a new © button in the top-left menu (highlighted orange when active, matching the MiniStats button). Replaces the previous desktop Info panel entirely.
  • Raises the mobile breakpoint to 967px so the desktop layout switches to mobile UI before the canvas would overflow the sidebar.
  • Drops backdrop-filter: blur from every overlay (Controls panel, mobile sheet, mobile dock, description, credits) — was burning GPU time per frame over the live canvas; bumped background opacity 0.64 → 0.85 to compensate.
  • Mobile flow unchanged: the info sheet (via mobile dock "Info" button) still hosts the combined description + credits.

Preview

Desktop: credits overlay bottom-right with © toggle in menu
Desktop: credits overlay in the bottom-right, toggled via the © button in the top-left menu
Mobile: credits inside the info sheet
Mobile: credits rendered inside the info sheet alongside the description

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

Manual tests

  • Verified credits overlay shows/hides via the © menu button across examples with and without @credit blocks (button is hidden when there are no credits).
  • Verified credits links (source, license) are clickable and show pointer cursor on hover; canvas drag/pan still works in the empty space behind the overlay.
  • Verified keybinds render inline inside the description across all 11 examples that previously used @keybinds.
  • Resized 1400 → 950 → 700px to confirm the 967px breakpoint handoff is clean and the credits overlay reflows to mobile sheet.

@kpal81xd kpal81xd force-pushed the feat/example-credits-keybinds branch from 2a912bb to 90f8e1e Compare May 27, 2026 15:30
backdrop-filter: blur(32px) over a live canvas forces the compositor
to re-sample and re-blur every frame the canvas redraws. Bump
background opacity 0.64 -> 0.85 to retain the dark-overlay look
without the per-frame GPU cost.
Remove the @keybinds config block and its dedicated Info subpanel.
Rewrite the 11 examples that declared @keybinds to instead express
keybinds as markdown-lite description prose: each key wrapped in
`code`, bindings joined by ` · `. Strips the now-redundant parser
branch, lint validation, renderer, and CSS.
Deprecate the desktop info panel. Credits now render as an absolutely-
positioned overlay in the bottom-right corner, styled to match the
description overlay. A new © toggle button in the top-left menu hides
or shows it (highlighted orange when active, mirroring the MiniStats
button). Mobile flow unchanged - the description sheet still hosts
credits via renderInfoContent.

Also pass pointer events through the empty space of #desktopPanelStack
so links in the credits overlay underneath remain clickable.
Remember the show/hide state of the desktop credits overlay across
page reloads, matching the convention used for sideBarCollapsed and
codePaneCollapsed. Default-true when the key is absent so attribution
is shown on first visit.
The centered top description overlay used to overlap the controls panel
at narrow canvas widths. Drive its layout off a container query against
the canvas container so it reacts to sidebar + code pane width changes,
not just the viewport:

- Canvas >= 1067px: centered, max-width 475 (unchanged).
- Canvas 892-1066px: stays centered but shrinks 475 -> 300 via calc()
  so it never extends into the controls panel column.
- Canvas < 892px: drops below the menu row, left-aligned, with width
  clamped to canvas - 304px (left margin + controls column + gap).
Add #exampleCredits and #showCreditsButton to the fullscreen display:
none group alongside the controls panel and sidebar. CSS-only so the
user's showCredits preference (sticky via localStorage) is preserved
across fullscreen toggles - credits and button restore on exit.
@kpal81xd kpal81xd merged commit 1cf00ab into main May 28, 2026
8 checks passed
@kpal81xd kpal81xd deleted the feat/example-credits-keybinds branch May 28, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant