Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨[amp-story-player] Adds swipe-to-next/previous story #27173

Merged
merged 4 commits into from
Mar 13, 2020

Conversation

Enriqe
Copy link
Contributor

@Enriqe Enriqe commented Mar 10, 2020

Adds swiping between stories.

Demo (mobile only)

Includes:

  • New handlers for touchstart, touchend, touchmove events sent by the AMP doc.
  • Tests (plus cleaning previous TODOs)

Does not include:

  • RTL support (will come in a follow-up)
  • Scroll issue [amp-story-player] Fix scrolling bug #27184 (swiping on the player will cause a horizontal scroll in the parent page when it has an overflow).
    • Main issue is that the touch event is "swallowed" by the iframe, and there's no way to preventDefault or stopPropagation on it. This can be verified in this demo, notice how the touchEvents are logged outside the iframe but not when they're inside.

Closes #26698
Tracker #26308

@Enriqe Enriqe marked this pull request as ready for review March 10, 2020 15:25
css/amp-story-player-iframe.css Outdated Show resolved Hide resolved
src/amp-story-player.js Outdated Show resolved Hide resolved
src/amp-story-player.js Outdated Show resolved Hide resolved
test/unit/test-amp-story-player.js Show resolved Hide resolved
src/amp-story-player.js Outdated Show resolved Hide resolved
@Enriqe Enriqe merged commit 2798117 into ampproject:master Mar 13, 2020
twintwox pushed a commit to twintwox/amphtml that referenced this pull request Mar 24, 2020
* adds swiping

* types

* wrap animations in rAF, add test, decrease animation duration

* fix tests
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.

[amp-story-player] Add swipe-to-next story
4 participants