-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(carousel): allow to display multiple items per one slide
- Loading branch information
1 parent
5a3afe3
commit f2cdab2
Showing
13 changed files
with
436 additions
and
21 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
13 changes: 13 additions & 0 deletions
13
demo/src/app/components/+carousel/demos/multilist-single-offset/multilist-single-offset.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div> | ||
There is ability to shift slider by one item not | ||
</div> | ||
<carousel [itemsPerSlide]="itemsPerSlide" | ||
[singleSlideOffset]="singleSlideOffset" | ||
[infinite]="infinite"> | ||
<slide *ngFor="let slide of slides; let index=index"> | ||
<img [src]="slide.image" alt="image slide" style="display: block; width: 100%;"> | ||
<div class="carousel-caption"> | ||
<h4>Slide {{index}}</h4> | ||
</div> | ||
</slide> | ||
</carousel> |
24 changes: 24 additions & 0 deletions
24
demo/src/app/components/+carousel/demos/multilist-single-offset/multilist-single-offset.ts
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,24 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-multilist-single-offset', | ||
templateUrl: './multilist-single-offset.html' | ||
}) | ||
export class DemoCarouselMultilistSingleOffsetComponent { | ||
itemsPerSlide = 5; | ||
singleSlideOffset = true; | ||
infinite = true; | ||
|
||
slides = [ | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'}, | ||
{image: 'assets/images/nature/3.jpg'}, | ||
{image: 'assets/images/nature/4.jpg'}, | ||
{image: 'assets/images/nature/5.jpg'}, | ||
{image: 'assets/images/nature/6.jpg'}, | ||
{image: 'assets/images/nature/7.jpg'}, | ||
{image: 'assets/images/nature/8.jpg'}, | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'} | ||
]; | ||
} |
20 changes: 20 additions & 0 deletions
20
demo/src/app/components/+carousel/demos/multilist/multilist.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<carousel [itemsPerSlide]="itemsPerSlide" | ||
[singleSlideOffset]="singleSlideOffset" | ||
[infinite]="infinite" | ||
[interval]="false"> | ||
<slide *ngFor="let slide of slides; let index=index"> | ||
<img [src]="slide.image" alt="image slide" style="display: block; width: 100%;"> | ||
<div class="carousel-caption"> | ||
<h4>Slide {{index}}</h4> | ||
</div> | ||
</slide> | ||
</carousel> | ||
|
||
<div class="container" [ngStyle]="{'marginTop': '20px'}"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox" [(ngModel)]="infinite"> | ||
Infinite | ||
</label> | ||
</div> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
demo/src/app/components/+carousel/demos/multilist/multilist.ts
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,24 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-multilist', | ||
templateUrl: './multilist.html' | ||
}) | ||
export class DemoCarouselMultilistComponent { | ||
itemsPerSlide = 3; | ||
singleSlideOffset = false; | ||
infinite = false; | ||
|
||
slides = [ | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'}, | ||
{image: 'assets/images/nature/3.jpg'}, | ||
{image: 'assets/images/nature/4.jpg'}, | ||
{image: 'assets/images/nature/5.jpg'}, | ||
{image: 'assets/images/nature/6.jpg'}, | ||
{image: 'assets/images/nature/7.jpg'}, | ||
{image: 'assets/images/nature/8.jpg'}, | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'} | ||
]; | ||
} |
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.