Update: Random position width

This commit is contained in:
Luca 2023-10-31 19:49:38 +01:00
parent 6e99a3d193
commit c58ccea3dd
Signed by: lrullo
GPG Key ID: A04E97D8E19A58A7
2 changed files with 3 additions and 3 deletions

View File

@ -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>

View File

@ -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)
}
}