October 2017
Intermediate to advanced
370 pages
8h 57m
English
In our email sign-up form, we added an animation spinner effect. Let's add a similar effect here. This time, we'll animate the icon on the search button to give the user some instant feedback that something is happening. First, add the loader element after the submit button:
<input name="keywords" type="search" placeholder="Search" required><input type="submit" value=""><div class="loader"></div>
The CSS is very similar to what we used earlier, making use of the exact same @keyframes animation as before (omitted here):
.loader:before { content: ''; width: 2.5rem; background-repeat: no-repeat; background-image: url('img/search-icon.svg'); background-size: 1.4rem 1.4rem; background-position: 50% 50%; animation: loader ...Read now
Unlock full access