I try to start the easiest to create, purely from scratch, that's how you see it.
For example, there are 10 thumbnails that link, they are in a block where there are only 5, and the rest with overflow: hidden.
Ask the unit with id pictures, and then using js to get the number of images and size.
Well then, at this size, it slides on the interval. Well, do that after the last picture, the slider came back.
If you really want to create from scratch and practice js, try.
From simple to complex. There is logic everywhere the same in essence.