2019-06-24 16:09:40 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'gif-slider',
|
|
|
|
template: `
|
2019-06-27 12:26:02 +02:00
|
|
|
<div tabindex="-1" [attr.uk-slider]="'velocity: ' + velocity +
|
|
|
|
';autoplay: '+ autoplay +
|
|
|
|
';autoplay-interval: ' + autoplayInterval +
|
|
|
|
';pause-on-hover: ' + pauseOnHover +
|
|
|
|
';center: ' + center">
|
2019-06-26 14:25:02 +02:00
|
|
|
<div class="uk-slider-container">
|
2019-07-01 15:57:42 +02:00
|
|
|
<ul class="uk-slider-items uk-child-width-1-1">
|
2019-06-26 12:00:24 +02:00
|
|
|
<li *ngFor="let gif of gifs">
|
2019-06-29 01:11:44 +02:00
|
|
|
<div class="uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s" uk-grid>
|
2019-06-26 12:00:24 +02:00
|
|
|
<div>
|
2019-06-27 16:42:49 +02:00
|
|
|
<img [attr.src]="gif.gif" class="uk-box-shadow-large uk-border-rounded">
|
2019-06-24 16:09:40 +02:00
|
|
|
</div>
|
2019-07-01 15:57:42 +02:00
|
|
|
<div [ngClass]="(gifRight)?'uk-flex-first':''" class="uk-margin-top">
|
|
|
|
<div>
|
|
|
|
<h1 class="uk-text-bold">{{gif.header}}</h1>
|
2019-06-27 20:44:45 +02:00
|
|
|
<div > {{gif.text}}</div>
|
|
|
|
</div>
|
2019-07-01 15:57:42 +02:00
|
|
|
<div *ngIf="link" class="uk-inline uk-margin-medium-top">
|
2019-06-24 21:21:31 +02:00
|
|
|
<a class="uk-button portal-button uk-text-uppercase" [routerLink]="route" routerLinkActive="router-link-active">{{linkTitle}}</a>
|
2019-06-24 16:09:40 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2019-06-26 14:25:02 +02:00
|
|
|
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin"></ul>
|
|
|
|
</div>
|
2019-06-24 16:09:40 +02:00
|
|
|
</div>`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class GifSliderComponent {
|
2019-06-24 21:21:31 +02:00
|
|
|
@Input() gifs: {"gif": string, "header": string, "text"}[] = [];
|
|
|
|
@Input() link = false;
|
|
|
|
@Input() route = null;
|
|
|
|
@Input() linkTitle = null;
|
2019-06-25 10:18:21 +02:00
|
|
|
@Input() gifRight = false;
|
2019-06-27 12:26:02 +02:00
|
|
|
@Input() velocity = 0;
|
|
|
|
@Input() autoplay = true;
|
|
|
|
@Input() autoplayInterval = 4000;
|
|
|
|
@Input() pauseOnHover = false;
|
|
|
|
@Input() center = true;
|
2019-06-26 14:25:02 +02:00
|
|
|
|
2019-06-24 16:09:40 +02:00
|
|
|
}
|