carousel1.html assumes there is always exactly 3 items. Simple and minimal code, but not very extensible. Carousel 1 is complete per the requirements.
carousel2.html uses some 3D transforms to lay out the carousel items in 3D space, and will automatically accommodate 3+ items in the markup without any JS changes.