HTML Explanation
01
It includes a container (<div class="loading-container">) that houses a div with the class bouncing-ball for the animation
02
and an <h1> element displaying "Loading...". The container aligns these elements vertically, with the ball on top and the text below.
CSS Explanation
01
the body is styled to ensure the loading animation is centered both vertically and horizontally on the screen.
02
This is achieved by setting the display to flex, and aligning both items horizontally and vertically using justify-content and align-items properties.
03
The background color is set to a light gray (#f0f0f0) to make the animation stand out.
04
The .loading-container is set up as a flex container, stacking its children vertically.
05
The .bouncing-ball is styled to appear as a small, circular element with a blue color (#3498db) and a border-radius of 50% to make it round.
06
The ball uses a bounce animation, defined in a keyframes rule, which animates the transform property to simulate a bouncing effect.
07
The animation alternates between its start and end states every second (1s) infinitely.
08
The keyframes for bounce define a vertical movement: at 0%, the ball is at its default position (translateY(0)), and at 100%, it moves up by 60px (translateY(-60px)), creating the illusion of a bounce.
09
The h1 element below the ball is styled simply with a larger font size and dark text color to complement the animation.