I'm looking to create a website background 'screensaver' by looping through an array of background URLs with a delay between switches.
Currently, I have the array stored in my .ts file and I am using the NgFor directive in my HTML. However, there are two main issues - there is no delay between image changes (resulting in the last one being displayed) and it does not continuously loop through the array.
In my .ts file:
bgImgs = [
`url("/assets/img/friendship.jpeg")`,
`url("/assets/img/family.jpeg")`,
`url("/assets/img/health.jpeg")`,
`url("/assets/img/fatherson2.jpeg")`
In my .html file:
<div *ngFor="let bgImg of bgImgs">
<div [style.backgroundImage]="bgImg" id="home" class="pt-5">