✨ [Amp story panning media] Support portrait images#36053
Merged
processprocess merged 9 commits intoampproject:mainfrom Sep 15, 2021
Merged
✨ [Amp story panning media] Support portrait images#36053processprocess merged 9 commits intoampproject:mainfrom
processprocess merged 9 commits intoampproject:mainfrom
Conversation
|
Hey @gmajoulet, @newmuis! These files were changed: |
gmajoulet
reviewed
Sep 13, 2021
extensions/amp-story-panning-media/0.1/amp-story-panning-media.js
Outdated
Show resolved
Hide resolved
gmajoulet
approved these changes
Sep 13, 2021
mszylkowski
approved these changes
Sep 13, 2021
Contributor
mszylkowski
left a comment
There was a problem hiding this comment.
Looks good.
Just a note that the image looks like the image follows the cover CSS logic for background images (in terms of cover vs contain), so we could explain that in the documentation. A visualization would help as well understand this behavior.
Contributor
Author
Good call. I'll update the docs with behavior and a diagram. |
caroqliu
pushed a commit
to caroqliu/amphtml
that referenced
this pull request
Sep 16, 2021
* Handle container aspect ratio. * Update template. * Measure element instead of page. * Remove whitespace. * Revert template change. * Update test
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.
Adds support for portrait images by checking if the aspect ratio of the container is less than the image.
Updates example template.
Demo
Fixes #31515