Refresh the examples browser UI#257
Merged
Merged
Conversation
Modernize the examples browser with a dark PlayCanvas-branded theme and better navigation: - Dark theme built on CSS custom properties (#121212/#1a1a1a surfaces, #f60 accent), themed scrollbars, focus-visible outlines, dark QR dialog (QR kept on a white tile for scannability) and dark PWA colors - Search box that filters by example name or category (/ focuses, Esc clears, Enter loads the first match) - Sidebar grouped into 8 categories (Graphics, Animation, Physics, Sound, UI & Text, Gaussian Splatting, XR, Showcases); redundant name prefixes dropped now that headers give context - Add missing AR Hand Gestures and 2D Screen examples (27 total) - Fix back/forward desync: navigate the iframe via location.replace() so it no longer pushes interleaved history entries, and replaceState on the initial load so the first Back press is not dead - Fix mobile overlay: .sidebar-overlay had no CSS so tapping outside the drawer never closed it - Fix QR dialog attaching a new backdrop-click listener on every open - Arrow-key navigation now walks only visible (unfiltered) links Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A visual and functional refresh of the examples browser (
examples/index.html+css/browser.css+js/*.mjs):#121212/#1a1a1a), PlayCanvas orange (#f60) accent, themed scrollbars,:focus-visibleoutlines, dark QR dialog (the QR image sits on a white tile so it stays scannable), dark hamburger/drawer on mobile, and matching PWA manifest /theme-colormeta./focuses it from anywhere, Esc clears (then blurs), Enter loads the first match, empty categories hide, and a "No examples found" state covers zero matches.Bugs fixed along the way
iframe.srcpushed iframe navigations into the joint browser history, interleaved with thepushStatehash entries — so Back rewound the iframe while the sidebar/hash stayed put. The iframe now navigates vialocation.replace(), which keeps history to hash entries only; Back/Forward now keeps the URL, active row, and iframe in sync. The initial URL update also usesreplaceStateso the first Back press isn't dead..sidebar-overlayhad no CSS (zero-size div), so tapping outside the drawer couldn't close it. Now styled and functional.Notes for reviewers
#f60(~2.9:1 contrast, consistent with the previous UI and playcanvas.com). If AA contrast is preferred, the alternative is orange text on an orange tint.npm run lint.🤖 Generated with Claude Code