This is insanely helpful. However, I'm trying to add two more functions to this. I'd like the images to be in a random order, and I'd like to see a fade animation in between. I know that this drastically increases the complexity of the project. But perhaps you have an idea how to manage this.
Hej! I'm sorry that I could not answer the comment earlier. I believe what to wanna achieve can easily be done and it won't drastically increase the complexity of the project. You just need to add the face animation to the img element one the images is shown, and remove it from the img element before you show the second image, and the add it again. So it is a kind of toggle that can easily be done via classList.toggle()