The target is to add and animate a carousel using css.
Ok, so some base rules. We know bootstrap has a carousel. The carousel adds an .active class on an item when scolled to. The timeout of a default carousel is 5000 ms. For the images we use unsplash because they are awesome. Lets go.
So lets see what we are making.
The carousel slides, on every slide the title animates down. After that the buttons animate in.
For a slide i use an responsive embed so i can force it to an 16×9 frame.
Then we just add a title and some buttons.
So next we will need some animations. We will animate them on the .carousel-item.active
class so we can use the active carousel item as a base.
So in this example i fade in and slide down the title on the h3
elemen.
Next we animate the buttons.
Note, we also add an animation-delay
on the items, so they start after each other.
So what we end up with is a carousel and on every slide the animation starts over.
You can check out the example on the page for the final result.
You can of course create the most elaborate animation you can think of. Just go wild.