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>
|
2021-07-14 13:19:57 +02:00
|
|
|
<img [attr.src]="gif.gif" class="uk-box-shadow-large uk-border-rounded" loading="lazy">
|
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>
|
2019-07-22 16:15:23 +02:00
|
|
|
<div class="uk-text-bold uk-h4">{{gif.header}}</div>
|
2019-07-02 17:20:02 +02:00
|
|
|
<div class="uk-margin-medium"> {{gif.text}}</div>
|
|
|
|
<div *ngIf="link" class="uk-inline">
|
|
|
|
<a class="uk-button portal-button uk-text-uppercase" [routerLink]="route" routerLinkActive="router-link-active">{{linkTitle}}</a>
|
|
|
|
</div>
|
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
|
|
|
}
|