Анимированные индикаторы загрузки (Спиннеры) на CSS3 by Ouroboros Sass Project
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
/* Inspirated from http://www.alessioatzeni.com/wp-content/tutorials/html-css/CSS3-loading-animation-loop/index.html */ .ouro { position: relative; display:inline-block; height: 46px; width: 46px; margin: 1em; border-radius: 50%; background: none repeat scroll 0 0 #DDDDDD; overflow:hidden; box-shadow: 0 0 10px rgba(0, 0, 0, .1) inset, 0 0 25px rgba(0, 0, 255, 0.075); } .ouro:after { content:""; position: absolute; top: 9px; left: 9px; display: block; height: 28px; width: 28px; background: none repeat scroll 0 0 #F2F2F2; border-radius: 50%; box-shadow: 0 0 10px rgba(0, 0, 0, .1); } .ouro > span { position: absolute; height: 100%; width: 50%; overflow: hidden; } .left { left:0 } .right { left:50% } .anim { position: absolute; left: 100%; top: 0; height: 100%; width: 100%; border-radius: 999px; background: none repeat scroll 0 0 #508EC3; opacity: 0.8; -webkit-animation: ui-spinner-rotate-left 3s infinite; animation: ui-spinner-rotate-left 3s infinite; -webkit-transform-origin: 0 50% 0; transform-origin: 0 50% 0; } .left .anim { border-bottom-left-radius: 0; border-top-left-radius: 0; } .right .anim { border-bottom-right-radius: 0; border-top-right-radius: 0; left: -100%; -webkit-transform-origin: 100% 50% 0; transform-origin: 100% 50% 0; } /* v2 */ .ouro2 .anim { -webkit-animation-delay:0; animation-delay:0; } .ouro2 .right .anim { -webkit-animation-delay: 1.5s; animation-delay: 1.5s; } /* v3 */ .ouro3 .anim { -webkit-animation-delay: 0s; -webkit-animation-duration:3s; -webkit-animation-timing-function: linear; animation-delay: 0s; animation-duration:3s; animation-timing-function: linear; } .ouro3 .right .anim { -webkit-animation-name: ui-spinner-rotate-right; -webkit-animation-delay:0; -webkit-animation-delay: 1.5s; animation-name: ui-spinner-rotate-right; animation-delay:0; animation-delay: 1.5s; } /* round variation */ .round .ouro:after { display:none } /* double variation */ .double .ouro:after { height: 13px; width: 13px; left: 7px; top: 7px; border: 10px solid #ddd; background: transparent; box-shadow: none; } @keyframes ui-spinner-rotate-right { 0% { transform:rotate(0deg) } 25% { transform:rotate(180deg) } 50% { transform:rotate(180deg) } 75% { transform:rotate(360deg) } 100% { transform:rotate(360deg) } } @keyframes ui-spinner-rotate-left { 0% { transform:rotate(0deg) } 25% { transform:rotate(0deg) } 50% { transform:rotate(180deg) } 75% { transform:rotate(180deg) } 100% { transform:rotate(360deg) } } @-webkit-keyframes ui-spinner-rotate-right { 0% { -webkit-transform:rotate(0deg) } 25% { -webkit-transform:rotate(180deg) } 50% { -webkit-transform:rotate(180deg) } 75% { -webkit-transform:rotate(360deg) } 100% { -webkit-transform:rotate(360deg) } } @-webkit-keyframes ui-spinner-rotate-left { 0% { -webkit-transform:rotate(0deg) } 25% { -webkit-transform:rotate(0deg) } 50% { -webkit-transform:rotate(180deg) } 75% { -webkit-transform:rotate(180deg) } 100% { -webkit-transform:rotate(360deg) } } /* * Some bugs with Chrome (Android), Safari and Opera, I'll try to see how http://atomeye.com/projects/sass-css-spinner.html made his code. */ |
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 |
<div class="block"> <p class="circle"> <span class="ouro"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro2"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro3"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> </p> <p class="round"> <span class="ouro"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro2"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro3"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> </p> <p class="double"> <span class="ouro"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro2"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> <span class="ouro ouro3"> <span class="left"><span class="anim"></span></span> <span class="right"><span class="anim"></span></span> </span> </p> </div> |