I have this piece of code who kinda follows a pattern but I don't know how to make it a loop to simplify.
setTimeout(() => {
wrapper.classList.add("show-el-1");
wrapper.classList.add("hide-el-0");
}, 600);
setTimeout(() => {
wrapper.classList.add("show-el-2");
wrapper.classList.add("hide-el-1");
}, 1800);
setTimeout(() => {
wrapper.classList.add("show-el-3");
wrapper.classList.add("hide-el-2");
}, 3000);
setTimeout(() => {
wrapper.classList.add("show-el-4");
wrapper.classList.add("hide-el-3");
}, 4200);
It adds 1200 in every setTimeout duration, and changes the show-el-x and hide-el-y numbers.