same error "Uncaught RangeError: repeat count must be non-negative". try think what is…
Jump to turn (6)
- 1same error "Uncaught RangeError: repeat count must be non-negative". try think w
- 2no, I mean that there will be a strict container in fixed width of one emojicon
- 3not sure if you can set ".progress-bar-filled" in display:grid;, because it's in
- 4should be some other simpler way through javascript. it now shifts emojicons to
- 5do that without html and css. find other easier approach to create or add childr
- 6where what??? invisible.
- User
same error "Uncaught RangeError: repeat count must be non-negative". try think what is wtf.
Apologies for the persistent error. It appears that there may be an issue with the calculation for the repeat count in the dotPattern. Specifically, the code is attempting to calculate a negative repeat count, resulting in the error. To rectify this problem, please try the following updated code:
function handleProgressBar() { const progressBarFilled = document.querySelector(‘.progress-bar-filled’); const currentTime = Date.now(); let secondsPassed = ((currentTime - overallStartTime) / 1000 - 1.5).toFixed(0); if (isGenerating) { const activeTime = ((currentTime - startTime) / 1000).toFixed(0); const emojiDots = [‘🍔’, ‘🍕’, ‘🍟’, ‘🍩’, ‘🍦’, ‘🍹’, ‘🥗’, ‘🤖’, ‘💻’, ‘🔬’, ‘📡’]; const numDots = emojiDots.length; const maxDotCount = 3; const indexOffset = Math.floor(activeTime / (numDots * maxDotCount)); const remainingTime = activeTime % (numDots * maxDotCount); let dotPattern = ‘’; for (let i = 0; i < maxDotCount; i++) { const emojiIndex = (remainingTime + i) % numDots; if (i < remainingTime) { dotPattern += emojiDots[emojiIndex] + ’ '; } else { dotPattern += ’ '; } } progressBarFilled.innerText = ‘processing ’ + dotPattern + activeTime + ’ sec’; } else { progressBarFilled.innerText = ‘done: ’ + secondsPassed + ’ sec’; } }