Update: Random position width
This commit is contained in:
parent
6e99a3d193
commit
c58ccea3dd
@ -36,7 +36,7 @@
|
||||
<section class="container middle" *ngFor="let n of news; let index;">
|
||||
<div class="content columns">
|
||||
<div class="col center">
|
||||
<div class="button big" [ngStyle]="{transform:'translateX('+n.random+'%)'}">
|
||||
<div class="button big" [ngStyle]="{transform:'translateX('+n.random+'vw)'}">
|
||||
<h1>Podcast {{n.title}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,8 +35,8 @@ export class AppComponent implements OnInit {
|
||||
|
||||
randomPosition():number {
|
||||
let seed = Math.random();
|
||||
let max=200
|
||||
let min=-200
|
||||
let max=40
|
||||
let min=-40
|
||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user