September 24, 2016
CSS Loading Boxes Animation

Have seen that they’re a huge number of Javascript (jQuery) based loading animation for dynamic content out there, the CSS technology can do the same thing with much performance and less coding. In this post, I would like to share how to create CSS loading animation. Work a little with the CSS, there are several ways to customize your animation. If you want to change the rotating speed, for example, reduce the animation duration.
index.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>Loading_model_10</title> <style> body{ background-color: #7d1ad4; } .sa-box-grid{ width: 40px; height: 40px; margin: 300px auto; } .sa-box-grid .sa-box{ width: 33%; height: 33%; background-color:#FFF; float:left; -webkit-animation: sa-boxGridScaleDelay 1.3s infinite ease-in-out; animation: sa-boxGridScaleDelay 1.3s infinite ease-in-out; } .sa-box-grid .sa-box_1{ -webkit-animation-delay: 0.2s; animation-delay: 0.2s; } .sa-box-grid .sa-box_2{ -webkit-animation-delay: 0.3s; animation-delay: 0.3s; } .sa-box-grid .sa-box_3{ -webkit-animation-delay: 0.4s; animation-delay: 0.4s; } .sa-box-grid .sa-box_4{ -webkit-animation-delay: 0.1s; animation-delay: 0.1s; } .sa-box-grid .sa-box_5{ -webkit-animation-delay: 0.2s; animation-delay: 0.2s; } .sa-box-grid .sa-box_6{ -webkit-animation-delay: 0.3s; animation-delay: 0.3s; } .sa-box-grid .sa-box_7{ -webkit-animation-delay: 0s; animation-delay: 0s; } .sa-box-grid .sa-box_8{ -webkit-animation-delay: 0.1s; animation-delay: 0.1s; } .sa-box-grid .sa-box_9{ -webkit-animation-delay: 0.2s; animation-delay: 0.2s; } @keyframes sa-boxGridScaleDelay{ 0%, 70%, 100%{ -webkit-transform: scale3D(1, 1, 1); transform: scale3D(1, 1, 1); } 35%{ -webkit-transform:scale3D(0, 0, 1); transform:scale3D(0, 0, 1); } } @-webkit-keyframes sa-boxGridScaleDelay{ 0%, 70%, 100%{ -webkit-transform:scale3D(1, 1, 1); transform:scale3D(1, 1, 1); } 35%{ -webkit-transform: scale3D(0, 0, 1); transform: scale3D(0, 0, 1); } } </style> </head> <body> <div class="sa-box-grid"> <div class="sa-box sa-box-1"></div> <div class="sa-box sa-box-2"></div> <div class="sa-box sa-box-3"></div> <div class="sa-box sa-box-4"></div> <div class="sa-box sa-box-5"></div> <div class="sa-box sa-box-6"></div> <div class="sa-box sa-box-7"></div> <div class="sa-box sa-box-8"></div> <div class="sa-box sa-box-9"></div> </div> </body> </html> |
Download
Mraj
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: [email protected]