Use a promise and requestAnimationFrame to insert HTML