github.com/bosssauce/ponzu@v0.11.1-0.20200102001432-9bc41b703131/system/admin/static/editor/sass/components/_preloader.scss (about) 1 /* 2 @license 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 Code distributed by Google as part of the polymer project is also 8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 */ 10 11 /**************************/ 12 /* STYLES FOR THE SPINNER */ 13 /**************************/ 14 15 /* 16 * Constants: 17 * STROKEWIDTH = 3px 18 * ARCSIZE = 270 degrees (amount of circle the arc takes up) 19 * ARCTIME = 1333ms (time it takes to expand and contract arc) 20 * ARCSTARTROT = 216 degrees (how much the start location of the arc 21 * should rotate each time, 216 gives us a 22 * 5 pointed star shape (it's 360/5 * 3). 23 * For a 7 pointed star, we might do 24 * 360/7 * 3 = 154.286) 25 * CONTAINERWIDTH = 28px 26 * SHRINK_TIME = 400ms 27 */ 28 29 30 .preloader-wrapper { 31 display: inline-block; 32 position: relative; 33 width: 48px; 34 height: 48px; 35 36 &.small { 37 width: 36px; 38 height: 36px; 39 } 40 41 &.big { 42 width: 64px; 43 height: 64px; 44 } 45 46 &.active { 47 /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */ 48 -webkit-animation: container-rotate 1568ms linear infinite; 49 animation: container-rotate 1568ms linear infinite; 50 } 51 } 52 53 @-webkit-keyframes container-rotate { 54 to { -webkit-transform: rotate(360deg) } 55 } 56 57 @keyframes container-rotate { 58 to { transform: rotate(360deg) } 59 } 60 61 .spinner-layer { 62 position: absolute; 63 width: 100%; 64 height: 100%; 65 opacity: 0; 66 } 67 68 .spinner-blue, 69 .spinner-blue-only { 70 border-color: #4285f4; 71 } 72 73 .spinner-red, 74 .spinner-red-only { 75 border-color: #db4437; 76 } 77 78 .spinner-yellow, 79 .spinner-yellow-only { 80 border-color: #f4b400; 81 } 82 83 .spinner-green, 84 .spinner-green-only { 85 border-color: #0f9d58; 86 } 87 88 /** 89 * IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee): 90 * 91 * iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't 92 * guarantee that the animation will start _exactly_ after that value. So we avoid using 93 * animation-delay and instead set custom keyframes for each color (as redundant as it 94 * seems). 95 * 96 * We write out each animation in full (instead of separating animation-name, 97 * animation-duration, etc.) because under the polyfill, Safari does not recognize those 98 * specific properties properly, treats them as -webkit-animation, and overrides the 99 * other animation rules. See https://github.com/Polymer/platform/issues/53. 100 */ 101 .active .spinner-layer.spinner-blue { 102 /* durations: 4 * ARCTIME */ 103 -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 104 animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 105 } 106 107 .active .spinner-layer.spinner-red { 108 /* durations: 4 * ARCTIME */ 109 -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 110 animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 111 } 112 113 .active .spinner-layer.spinner-yellow { 114 /* durations: 4 * ARCTIME */ 115 -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 116 animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 117 } 118 119 .active .spinner-layer.spinner-green { 120 /* durations: 4 * ARCTIME */ 121 -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 122 animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 123 } 124 125 .active .spinner-layer.spinner-blue-only, 126 .active .spinner-layer.spinner-red-only, 127 .active .spinner-layer.spinner-yellow-only, 128 .active .spinner-layer.spinner-green-only { 129 /* durations: 4 * ARCTIME */ 130 opacity: 1; 131 -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 132 animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 133 } 134 135 @-webkit-keyframes fill-unfill-rotate { 136 12.5% { -webkit-transform: rotate(135deg); } /* 0.5 * ARCSIZE */ 137 25% { -webkit-transform: rotate(270deg); } /* 1 * ARCSIZE */ 138 37.5% { -webkit-transform: rotate(405deg); } /* 1.5 * ARCSIZE */ 139 50% { -webkit-transform: rotate(540deg); } /* 2 * ARCSIZE */ 140 62.5% { -webkit-transform: rotate(675deg); } /* 2.5 * ARCSIZE */ 141 75% { -webkit-transform: rotate(810deg); } /* 3 * ARCSIZE */ 142 87.5% { -webkit-transform: rotate(945deg); } /* 3.5 * ARCSIZE */ 143 to { -webkit-transform: rotate(1080deg); } /* 4 * ARCSIZE */ 144 } 145 146 @keyframes fill-unfill-rotate { 147 12.5% { transform: rotate(135deg); } /* 0.5 * ARCSIZE */ 148 25% { transform: rotate(270deg); } /* 1 * ARCSIZE */ 149 37.5% { transform: rotate(405deg); } /* 1.5 * ARCSIZE */ 150 50% { transform: rotate(540deg); } /* 2 * ARCSIZE */ 151 62.5% { transform: rotate(675deg); } /* 2.5 * ARCSIZE */ 152 75% { transform: rotate(810deg); } /* 3 * ARCSIZE */ 153 87.5% { transform: rotate(945deg); } /* 3.5 * ARCSIZE */ 154 to { transform: rotate(1080deg); } /* 4 * ARCSIZE */ 155 } 156 157 @-webkit-keyframes blue-fade-in-out { 158 from { opacity: 1; } 159 25% { opacity: 1; } 160 26% { opacity: 0; } 161 89% { opacity: 0; } 162 90% { opacity: 1; } 163 100% { opacity: 1; } 164 } 165 166 @keyframes blue-fade-in-out { 167 from { opacity: 1; } 168 25% { opacity: 1; } 169 26% { opacity: 0; } 170 89% { opacity: 0; } 171 90% { opacity: 1; } 172 100% { opacity: 1; } 173 } 174 175 @-webkit-keyframes red-fade-in-out { 176 from { opacity: 0; } 177 15% { opacity: 0; } 178 25% { opacity: 1; } 179 50% { opacity: 1; } 180 51% { opacity: 0; } 181 } 182 183 @keyframes red-fade-in-out { 184 from { opacity: 0; } 185 15% { opacity: 0; } 186 25% { opacity: 1; } 187 50% { opacity: 1; } 188 51% { opacity: 0; } 189 } 190 191 @-webkit-keyframes yellow-fade-in-out { 192 from { opacity: 0; } 193 40% { opacity: 0; } 194 50% { opacity: 1; } 195 75% { opacity: 1; } 196 76% { opacity: 0; } 197 } 198 199 @keyframes yellow-fade-in-out { 200 from { opacity: 0; } 201 40% { opacity: 0; } 202 50% { opacity: 1; } 203 75% { opacity: 1; } 204 76% { opacity: 0; } 205 } 206 207 @-webkit-keyframes green-fade-in-out { 208 from { opacity: 0; } 209 65% { opacity: 0; } 210 75% { opacity: 1; } 211 90% { opacity: 1; } 212 100% { opacity: 0; } 213 } 214 215 @keyframes green-fade-in-out { 216 from { opacity: 0; } 217 65% { opacity: 0; } 218 75% { opacity: 1; } 219 90% { opacity: 1; } 220 100% { opacity: 0; } 221 } 222 223 /** 224 * Patch the gap that appear between the two adjacent div.circle-clipper while the 225 * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11). 226 */ 227 .gap-patch { 228 position: absolute; 229 top: 0; 230 left: 45%; 231 width: 10%; 232 height: 100%; 233 overflow: hidden; 234 border-color: inherit; 235 } 236 237 .gap-patch .circle { 238 width: 1000%; 239 left: -450%; 240 } 241 242 .circle-clipper { 243 display: inline-block; 244 position: relative; 245 width: 50%; 246 height: 100%; 247 overflow: hidden; 248 border-color: inherit; 249 250 .circle { 251 width: 200%; 252 height: 100%; 253 border-width: 3px; /* STROKEWIDTH */ 254 border-style: solid; 255 border-color: inherit; 256 border-bottom-color: transparent !important; 257 border-radius: 50%; 258 -webkit-animation: none; 259 animation: none; 260 position: absolute; 261 top: 0; 262 right: 0; 263 bottom: 0; 264 } 265 266 &.left .circle { 267 left: 0; 268 border-right-color: transparent !important; 269 -webkit-transform: rotate(129deg); 270 transform: rotate(129deg); 271 } 272 &.right .circle { 273 left: -100%; 274 border-left-color: transparent !important; 275 -webkit-transform: rotate(-129deg); 276 transform: rotate(-129deg); 277 } 278 } 279 280 281 282 .active .circle-clipper.left .circle { 283 /* duration: ARCTIME */ 284 -webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 285 animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 286 } 287 288 .active .circle-clipper.right .circle { 289 /* duration: ARCTIME */ 290 -webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 291 animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both; 292 } 293 294 @-webkit-keyframes left-spin { 295 from { -webkit-transform: rotate(130deg); } 296 50% { -webkit-transform: rotate(-5deg); } 297 to { -webkit-transform: rotate(130deg); } 298 } 299 300 @keyframes left-spin { 301 from { transform: rotate(130deg); } 302 50% { transform: rotate(-5deg); } 303 to { transform: rotate(130deg); } 304 } 305 306 @-webkit-keyframes right-spin { 307 from { -webkit-transform: rotate(-130deg); } 308 50% { -webkit-transform: rotate(5deg); } 309 to { -webkit-transform: rotate(-130deg); } 310 } 311 312 @keyframes right-spin { 313 from { transform: rotate(-130deg); } 314 50% { transform: rotate(5deg); } 315 to { transform: rotate(-130deg); } 316 } 317 318 #spinnerContainer.cooldown { 319 /* duration: SHRINK_TIME */ 320 -webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1); 321 animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1); 322 } 323 324 @-webkit-keyframes fade-out { 325 from { opacity: 1; } 326 to { opacity: 0; } 327 } 328 329 @keyframes fade-out { 330 from { opacity: 1; } 331 to { opacity: 0; } 332 }