(stlHomeDir)
| 8415 | randomItem.classList.add('selected'); |
| 8416 | if (doScroll) { |
| 8417 | randomItem.scrollIntoView({ behavior: 'smooth', block: 'center' }); |
| 8418 | } |
| 8419 | previousItem = randomItem; |
| 8420 | return randomItem; |
| 8421 | }; |
| 8422 | |
| 8423 | // Spin animation without scrolling (to avoid white flashes) |
| 8424 | for (let i = 0; i < ROULETTE_SPINS; i++) { |
| 8425 | await new Promise(resolve => setTimeout(resolve, delay)); |
| 8426 | highlightRandom(); // no scrolling on intermediate spins |
| 8427 | delay += ROULETTE_DELAY_INCREMENT; // Gradually slow down |
| 8428 | } |
| 8429 | |
| 8430 | // Final selection with scrolling. |
| 8431 | const finalItem = highlightRandom(true); |
| 8432 | const filePath = finalItem.getAttribute('data-filepath'); |
| 8433 | |
| 8434 | // Add winning animation class |
no test coverage detected