debkbanerji / lego-art-remix

Powerful computer vision assisted Lego mosaic creator ยท Over 1 million images created (so far!)
https://lego-art-remix.com
GNU General Public License v3.0
275 stars 66 forks source link

[Feature Request] Remove setTimeOut from steps #97

Open twjasa opened 1 year ago

twjasa commented 1 year ago

Hello,

amazing project!! ๐Ÿ™Œ I want to create a feature that can show to the user what is the best set available for the image selected, how many sets needed and which is the cheapest.

Is your feature request related to a problem? If so, please describe it. To create an algorithm to do that I had to fix the problem where the steps were before a setTimeOut, so here it is :)

Describe the solution you'd like I used the method ready() of the lib cropperjs to detect when the input is finally loaded, then create a flag to run (or not) run step1. then remove all setTimeOut.

Here is the PR

https://github.com/debkbanerji/lego-art-remix/pull/96