Using CSS keyframe animations on page load can add something extra to your design. Whether it be animating a border, a background change or section grow, using keyframes to change elements with just CSS can be a nice touch.
Here is how to grow text on page load, i am using a h1 element but you can use any typography element.
You can see in the CSS below the animation takes 3 seconds to make the font size 0 to 4rem. There are only 2 keyframes… 0% (the start) and 100% (end).
CSS:
.header-grow {
animation: growth 3s;
animation-fill-mode: backwards;
font-size: 4rem;
}
@keyframes growth {
0% {
font-size: 0;
}
100% {
font-size: 4rem;
}
} The h1 element:
<h1 class="header-grow">Some heading text</h1>
Gives this result
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…