The idea came to me on working on this restaurant project
I wanted to implement the idea of an infinite carousel that I see on most of the shopping websites (and I can't deny that it is pretty cool), but I couldn't implement the logic myself . I searched and found this great article but the problem was that the implementation of the carousel logic was a bit hard to me .
So I spent one week trying to understand it, along with searching, asking ChatGPT about explanations and reading in MDN docs . I thought that sharing my journey may guide someone through their understanding, since I provided in the code the problems that faced me and their solutions with thorough explanation .
Writing any comments about the code is highly encouraged as it will help everyone . So feel free to do that .