-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Let's provide a lightbox mode for amp-carousel to cope with carousel slides of varying sizes.
amp-carousel works great for image galleries - if images and captions have a uniform size. If image sizes vary (e.g. mixed portrait and landscape photos) with images having long and short caption texts, it becomes difficult to provide a good amp integration.
There are some good workarounds, however these require additional non-trivial work on the backend to estimate the amp-carousel size based on image and caption sizes. This makes migrating image galleries a pain point for many publishers.
The proposed solution would be a lightbox mode for amp-carousel. By default the carousel shows a placeholder image. On click or tap, the carousel expands to fill the viewport. Inside the lightbox, slides can have different sizes with the option to scroll the content vertically if it doesn't fit the viewport.
Example:
<amp-carousel
width=400 <= optional: can be derived from placeholder
height=300 <= optional: can be derived from placeholder
layout=responsive
type=lightbox>
<amp-img src="img1.jpg"
layout="fixed"
width=500
height=300
placeholder></amp-img>
<amp-img src="img2.jpg"
layout="fixed"
width=300
height=600></amp-img>
<amp-img src="img3.jpg"
layout="fixed"
width=100
height=500></amp-img>
</amp-carousel>// @adewale