creationRoutine = {
let videoIndex = 1;
setTimeout(
() =>
setInterval(() => {
$(`#image-${videoIndex - 1}`).remove();
$(`#sky-${videoIndex - 1}`).remove();
const videoSphere = $(`<a-sky id='sky-${videoIndex}'/>`);
videoSphere.attr("visible", true);
const randomNumber = videoIndex % wallpaper_images.length;
const video = $(`<img id='image-${videoIndex}' />`);
video.attr("crossorigin", "anonymous");
video.attr(
"src",
`https://cors-anywhere.herokuapp.com/${wallpaper_images[randomNumber]}`
);
console.log(video[0]);
$("#assets").append(video);
videoSphere.attr("src", `#image-${videoIndex}`);
videoIndex++;
$("#assets").append(video);
$("#scene").append(videoSphere);
}, 2000),
3000
);
}