MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / typeNextChar

Function typeNextChar

web/src/components/IDEDemo.tsx:316–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

314 let index = 0
315
316 const typeNextChar = () => {
317 if (index < phrase.length) {
318 setTypingText(phrase.substring(0, index + 1))
319 index++
320
321 // Random typing speed between 50ms and 150ms for realistic effect
322 const typingSpeed = Math.floor(Math.random() * 100) + 50
323 setTimeout(typeNextChar, typingSpeed)
324 } else {
325 // Phrase is fully typed, wait before moving to next phrase
326 setTimeout(callback, 1500)
327 }
328 }
329
330 typeNextChar()
331 }

Callers 1

typePhraseFunction · 0.85

Calls 1

setTimeoutFunction · 0.85

Tested by

no test coverage detected