working on commercials

This commit is contained in:
Joachim 2018-09-01 17:34:54 +02:00
parent eb7ab4efd9
commit f4f87abb41
4 changed files with 46 additions and 4 deletions

View File

@ -7,6 +7,7 @@
"topmenu" "topmenu"
"content" "content"
"reclame"; "reclame";
grid-template-rows: auto 1fr 200px;
} }
app-reclamespinner { app-reclamespinner {

View File

@ -1,3 +1,7 @@
<div> <div id="reclamespinner">
KOOP MEER WORST <button id="goleftbutton" (click)="goLeft()">LEFT</button>
<div class="reclameitem" *ngFor="let image of images">
<img src="/assets/reclam/{{image}}"/>
</div>
<button id="gorightbutton" (click)="goRight()">RIGHT</button>
</div> </div>

View File

@ -3,3 +3,25 @@ div {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
#reclamespinner {
display: grid;
grid-template-rows: 1fr;
grid-auto-flow: column;
overflow: hidden;
}
.reclameitem {
height: 100%;
}
#goleftbutton, #gorightbutton {
position: absolute;
}
#goleftbutton {
left: 0px;
}
#gorightbutton {
right: 0px;
}

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
@Component({ @Component({
selector: 'app-reclamespinner', selector: 'app-reclamespinner',
@ -7,9 +7,24 @@ import { Component, OnInit } from '@angular/core';
}) })
export class ReclamespinnerComponent implements OnInit { export class ReclamespinnerComponent implements OnInit {
constructor() { } protected images: string[] = [];
constructor() {
this.images.push('Victoria.jpg');
this.images.push('basta.png');
}
ngOnInit() { ngOnInit() {
} }
goRight() {
let s = this.images.pop();
this.images.splice(0, 0, s);
}
goLeft() {
const string = this.images[0];
this.images.splice(0, 1);
this.images.push(string);
}
} }