forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Implement amp-stream-gallery (ampproject#26710)
Implements amp-stream-gallery, which is a carousel for showing multiple items at once. This is useful for things like related products and articles. This differs from amp-base-carousel in the following ways: 1. Provides an API for specifying the min/max width per item. This determines how many items are visible at once based on the constraints and changes with the screen size. 2. Provides an API to configure the min/max visible slides at one time. 3. Allows configuration of inset/outset arrows. 4. Has different default styling for inset/outset arrows from amp-base-carousel. 5. Does not snap on slides by default. 6. Does not support automatic advancing of slides. Fixes: - Fix check for overlapping slide sometimes missing one slide (fix < to <=). - Pause layout internal to carousel implementation, rather than just pausing auto advance. For ampproject#20595
- Loading branch information
1 parent
6dd0400
commit 6e8f6c9
Showing
19 changed files
with
2,497 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright 2019 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@import "../../amp-base-carousel/0.1/carousel.css"; | ||
@import "arrows.css"; | ||
|
||
amp-stream-gallery .i-amphtml-carousel-content { | ||
display: flex; | ||
} | ||
|
||
.i-amphtml-stream-gallery-slides { | ||
order: 1; | ||
flex-grow: 1; | ||
min-width: 1px; | ||
} | ||
|
||
[i-amphtml-stream-gallery-extra-space="around"] { | ||
justify-content: center; | ||
} | ||
|
||
amp-stream-gallery .i-amphtml-carousel-slotted > .i-amphtml-replaced-content { | ||
/* | ||
* Apply contain object-fit to all replaced content to avoid distorted ratios. | ||
*/ | ||
object-fit: contain; | ||
} |
Oops, something went wrong.