MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / handleTextBox

Function handleTextBox

website/source/js/flyInAni.js:55–73  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

53 }
54
55 function handleTextBox(query) {
56 var textBox = box.querySelector(query);
57 const text = textBox.dataset.text; // Store the original text
58 textBox.textContent = ""; // Clear the box for typing effect
59 let index = 0;
60
61 // Function to type text slowly
62 function type() {
63 if (index < text.length) {
64 textBox.textContent += text.charAt(index); // Append the current character
65 index++;
66 setTimeout(type, 50); // Schedule the next character typing
67 } else {
68 isTyping = false; // Reset flag when typing is done
69 }
70 }
71
72 type(); // Start typing the text
73 }
74 for (let i = 0; i <= box.children.length; i++) {
75 handleTextBox("#expandText"+i.toString());
76 }

Callers 1

handleBoxIntersectionFunction · 0.85

Calls 1

typeFunction · 0.85

Tested by

no test coverage detected