I didn't like some transitions and animations so now they work a lot better. Should probably be refactored at some point
parent
b101524105
commit
35e2ba31b4
@ -1,18 +1,19 @@
|
||||
<ng-container *ngIf="template && slides">
|
||||
|
||||
<div class="carousel">
|
||||
<div class="window" [style.translate]="translation()" #carouselWindow [style.grid-template-columns]="templateColumns()">
|
||||
<div class="window" [style.translate]="translation()" #carouselWindow
|
||||
[@direction]="{value: this.animation, params: {directionTime: directionTime}}" [ngStyle]="style()" (@direction.done)="onAnimationEnd($event)" (@direction.start)="onAnimationStart($event)">
|
||||
|
||||
<span hidden>current: {{current}}</span>
|
||||
<ng-container *ngFor="let visible of visibleSlides">
|
||||
<div class="slide" #slideElement [attr.data-slideIndex]="visible.index" [style.grid-column-start]="visible.index + 1">
|
||||
|
||||
<div [class]="vertical ? 'slide-vertical' : 'slide'" #slideElement
|
||||
[attr.data-slideIndex]="visible.index"
|
||||
[ngStyle]="vertical ? {'grid-row-start':visible.index + 1} : {'grid-column-start':visible.index + 1}">
|
||||
<ng-container *ngTemplateOutlet="template!; context: { $implicit: slides[visible.index] }">
|
||||
</ng-container>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<button (click)="prev()"><=prev</button>
|
||||
<button (click)="next()">next></button>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
|
Loading…
Reference in new issue