function replayType() {
if (mutable animation_id !== null) cancelAnimationFrame(mutable animation_id)
let progress = 0;
let lookup = offsets.slice()
function step(timestamp) {
if (lookup.length === 1) {
if (progress > lookup[0][1]) {
let splice = lookup.splice(0, 1)
mutable text = display(splice[0][0])
}
} else {
for (let i = 0; i < lookup.length; i++) {
let time = lookup[i][1]
if (time > progress) {
let end = i;
if (end > 0) {
let splice = lookup.splice(0, end)
let last = splice[splice.length - 1]
mutable text = display(last[0])
}
break;
}
}
}
if (lookup.length > 0) {
mutable animation_id = requestAnimationFrame(step);
}
progress += frame / milli * speed
}
mutable animation_id = requestAnimationFrame(step);
}