-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: more flexible carousels and fix homepage alignment
Currently the carousels on the front page don't align with any other elements on the page which looks odd. This seems to be due to a limitation where the item size has to be passed in to the carousel. These changes reimplement the carousel, making it more flexible and allowing it to handle any size of items and any spacing. The new carousel is used on the frontpage to lay out the items in a way that aligns with the rest of the content.
- Loading branch information
Showing
7 changed files
with
181 additions
and
218 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
22 changes: 12 additions & 10 deletions
22
material.angular.io/src/app/shared/carousel/carousel.html
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
<button (click)="previous()" *ngIf="this.showPrevArrow" aria-hidden="true" tabindex="-1" | ||
class="docs-carousel-nav docs-carousel-nav-prev" mat-mini-fab aria-label="previous"> | ||
<mat-icon>navigate_before</mat-icon> | ||
</button> | ||
|
||
<div #contentWrapper (keyup)="onKeydown($event)" | ||
(window:resize)="onResize()" [style.minWidth]="shiftWidth + 'px'" class="docs-carousel-content-wrapper" role="region"> | ||
<button (click)="previous()" *ngIf="this.showPrevArrow" aria-hidden="true" tabindex="-1" | ||
class="docs-carousel-nav docs-carousel-nav-prev" mat-mini-fab aria-label="previous"> | ||
<mat-icon>navigate_before</mat-icon> | ||
</button> | ||
<div class= "docs-carousel-content" role="list" tabindex="0"> | ||
class="docs-carousel-content-wrapper" role="region"> | ||
<div class="docs-carousel-content" role="list" tabindex="0" #list> | ||
<ng-content></ng-content> | ||
</div> | ||
<button (click)="next()" *ngIf="this.showNextArrow" aria-hidden="true" tabindex="-1" | ||
class="docs-carousel-nav docs-carousel-nav-next" mat-mini-fab aria-label="next"> | ||
<mat-icon>navigate_next</mat-icon> | ||
</button> | ||
</div> | ||
|
||
<button (click)="next()" *ngIf="this.showNextArrow" aria-hidden="true" tabindex="-1" | ||
class="docs-carousel-nav docs-carousel-nav-next" mat-mini-fab aria-label="next"> | ||
<mat-icon>navigate_next</mat-icon> | ||
</button> |
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
Oops, something went wrong.