MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / type

Function type

public/src/js/military.js:297–315  ·  view source on GitHub ↗
(id, txt, callback)

Source from the content-addressed store, hash-verified

295createGlobe()
296
297function 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
317function animateValue(id, start, end, duration) {
318 // assumes integer values for start and end

Callers 1

deploymentButtonFunFunction · 0.85

Calls 1

typeWriterFunction · 0.85

Tested by

no test coverage detected