1 |
56184
|
k.triantaf
|
import {Component, Input} from '@angular/core';
|
2 |
|
|
|
3 |
|
|
@Component({
|
4 |
|
|
selector: 'gif-slider',
|
5 |
|
|
template: `
|
6 |
56251
|
argiro.kok
|
<div tabindex="-1" [attr.uk-slider]="'velocity: ' + velocity +
|
7 |
|
|
';autoplay: '+ autoplay +
|
8 |
|
|
';autoplay-interval: ' + autoplayInterval +
|
9 |
|
|
';pause-on-hover: ' + pauseOnHover +
|
10 |
|
|
';center: ' + center">
|
11 |
|
|
<div class="uk-slider-container">
|
12 |
|
|
<ul class="uk-slider-items uk-child-width-1-1">
|
13 |
|
|
<li *ngFor="let gif of gifs">
|
14 |
|
|
<div class="uk-flex uk-flex-top uk-padding uk-child-width-1-2@m uk-child-width-1-1@s" uk-grid>
|
15 |
|
|
<div>
|
16 |
|
|
<img [attr.src]="gif.gif" class="uk-box-shadow-large uk-border-rounded">
|
17 |
56184
|
k.triantaf
|
</div>
|
18 |
56251
|
argiro.kok
|
<div [ngClass]="(gifRight)?'uk-flex-first':''">
|
19 |
|
|
<h1>{{gif.header}}</h1>
|
20 |
|
|
<div > {{gif.text}}</div>
|
21 |
56188
|
k.triantaf
|
<div *ngIf="link" class="uk-inline uk-margin-large-top uk-margin-bottom">
|
22 |
|
|
<a class="uk-button portal-button uk-text-uppercase" [routerLink]="route" routerLinkActive="router-link-active">{{linkTitle}}</a>
|
23 |
56184
|
k.triantaf
|
</div>
|
24 |
|
|
</div>
|
25 |
|
|
</div>
|
26 |
|
|
</li>
|
27 |
|
|
</ul>
|
28 |
56251
|
argiro.kok
|
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin"></ul>
|
29 |
|
|
</div>
|
30 |
56184
|
k.triantaf
|
</div>`
|
31 |
|
|
})
|
32 |
|
|
|
33 |
|
|
export class GifSliderComponent {
|
34 |
56188
|
k.triantaf
|
@Input() gifs: {"gif": string, "header": string, "text"}[] = [];
|
35 |
|
|
@Input() link = false;
|
36 |
|
|
@Input() route = null;
|
37 |
|
|
@Input() linkTitle = null;
|
38 |
56191
|
k.triantaf
|
@Input() gifRight = false;
|
39 |
56251
|
argiro.kok
|
@Input() velocity = 0;
|
40 |
|
|
@Input() autoplay = true;
|
41 |
|
|
@Input() autoplayInterval = 4000;
|
42 |
|
|
@Input() pauseOnHover = false;
|
43 |
|
|
@Input() center = true;
|
44 |
|
|
|
45 |
56184
|
k.triantaf
|
}
|