frankcollins3 / cAPPtcha

mine-nugget-ts (building captcha right now. want to make it an npm package)
1 stars 0 forks source link

setInterval going mad [5:30pm] #5

Closed frankcollins3 closed 11 months ago

frankcollins3 commented 11 months ago

attempting to do: cant even capture video of problem. Make a captcha during which an img changes and user is expected to click on an img with gold in it to prove human essence

error: 1000ms (1sec) interval works for a shuffle count of about 5-10 images. after that it changes 10s of times every second

 setInterval( () => {
         let randomImage:any = imagebucket[Math.floor(Math.random() * imagebucket.length)]
        setImg(randomImage)        
 }, 1000)

Screen Shot 2023-08-08 at 5 39 38 PM

proposed approach: its slightly more clunky but based the changing of the image on mouseBehavior (hover)