(id, txt, callback)
| 295 | createGlobe() |
| 296 | |
| 297 | function type(id, txt, callback) { |
| 298 | var i = 0; |
| 299 | typeWriter(id, txt, function () { |
| 300 | callback() |
| 301 | }) |
| 302 | |
| 303 | function typeWriter(id, txt, callback) { |
| 304 | if (i < txt.length) { |
| 305 | let text = txt.charAt(i); |
| 306 | document.getElementById(id).innerHTML += text === "\n" ? "<br/>" : text; |
| 307 | i++; |
| 308 | setTimeout(function () { |
| 309 | typeWriter(id, txt, callback) |
| 310 | }, speed); |
| 311 | } else { |
| 312 | callback() |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | function animateValue(id, start, end, duration) { |
| 318 | // assumes integer values for start and end |
no test coverage detected