Using vanilla javascript and the power of CSS3 Flexbox layout it is easy to build a responsive carousel/slider with minimum code required.
Changing flexbox property order: N
carousel items can be easily reordered achieving a smooth looping effect without the need to clone carousel items in DOM.
This demo shows how flexbox order works in live carousel example:
Vite
SCSS
JS