Repository navigation
feat(examples): turn explainer slides with a tap on either half of the screen - #856
Merged
Merged
Conversation
…e screen On a touchscreen, a tap on the right half of the stage now acts like → (finish the animation, or go to the next step), and a tap on the left half like ←. Taps on links and on the control bar keep their own meaning, and mouse clicks are unchanged. The READMEs and the in-app key lists say so. Taps are read from pointer events rather than click: iOS Safari treats a tap that makes hidden content appear (here, the faded-out control bar) as a hover and sends no click, so the first tap after the bar hid would only reveal it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
On a touchscreen, a tap on the right half of an explainer's stage now does what → does (finish the animation, or go to the next step), and a tap on the left half does what ← does. This applies to all three explainers: reprojection, MultiCOGLayer and antimeridian.
TOUCH_REVEAL_MS. A tap on the hidden control bar turns the slide, but it can't also press the button that appears under the finger.Taps are read from pointer events, not
click, because of how iOS Safari handles taps. Its content change observer starts watching at touchstart (source). It countsopacity: 0on an element, or on any of its four nearest ancestors, as hidden (source, which names YouTube's control bar as the case). When a tap makes clickable content visible, Safari treats it as a hover and sends noclick. Here, the first tap after the control bar fades out brings the bar back, so withclickthat tap would only show the bar. Chrome, for its part, does fireclickafter a 700 ms press.Closes #814
Testing
The tests sent real touch input (CDP
Input.dispatchTouchEvent) to headed Chrome 157 with mobile emulation, in landscape (844 x 390) and portrait (390 x 844), against each explainer's dev server. All 25 checks pass in each explainer. They cover:Unit tests, typecheck, Biome and
vite buildpass for all three.I haven't tried this on a physical phone. The iOS behavior above comes from reading WebKit's source, not from a device.
🤖 Written by Claude Code