├── LICENSE.md ├── README.md ├── img.svg ├── index.html ├── waitMe.css ├── waitMe.js ├── waitMe.min.css └── waitMe.min.js /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 vadimsva 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | waitMe 2 | ====== 3 | 4 | jquery plugin for easy creating loading css3 animations
5 | Simple to use. Contains 14 animation effects and can use images. 6 | 7 | For work required only jQuery, other libraries are not required. 8 | Plugin works on all browsers and IE10+ (for css3 animation effects). 9 |
10 | 11 | Documentation 12 | ============= 13 | 14 | DOCUMENTATION & EXAMPLES 15 | 16 | 17 | License 18 | ======= 19 | 20 | The MIT License (MIT) 21 | -------------------------------------------------------------------------------- /img.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | waitMe 8 | 139 | 140 | 141 | 142 | 143 | 144 |
145 | 146 | 155 | 156 |
157 | 158 |
159 |
160 | 161 |
waitMe
162 | 163 |
Documentation
164 | 165 |
166 |
167 |
Basic
168 |
169 |

170 | 						

$('#elem').waitMe({}) - #elem is html object, click on which causes to show waitme.

171 |
172 |
173 | 174 |
175 |
176 |
Options
177 |
178 |

179 | 						

effect - animation effect. Use: 'bounce' - default, 'none', 'rotateplane', 'stretch', 'orbit', 'roundBounce', 'win8', 'win8_linear', 'ios', 'facebook', 'rotation', 'timer', 'pulse', 'progressBar', 'bouncePulse', 'img'.

180 |

text - place text under the effect. Use: 'text'.

181 |

bg - background for container. Use: 'rgba(255,255,255,0.7)' - default, false.

182 |

color - color for background animation and text. Use: '#000' - default, ['','',...] - you can use multicolor for effect.

183 |

maxSize - set max size for elem animation. Use: '' - default, 40.

184 |

waitTime - wait time im ms to close. Use: -1 - default, 3000.

185 |

textPos - change text position. Use: 'vertical' - default, 'horizontal'.

186 |

fontSize - change font size. Use: '' - default, '18px'.

187 |

source - url to image. Use: '' - default, 'url' - for effect: 'img'.

188 |

onClose - code execution after popup closed. Use: function(event, el){}.

189 |
190 |
191 | 192 |
193 |
194 |
Methods
195 |
196 |

197 | 						

hide - for close waitMe. Use: $(container).waitMe("hide");.

198 |
199 |
200 | 201 |
202 |
203 |
Triggers
204 |
205 |

206 | 						

close - execution after closed. Use: $(el).on('close', function() {});.

207 |
208 |
209 | 210 |
211 |
212 |
Notes
213 |
214 |
215 |

Don't use as element container non block elements such as table, input, textarea and etc. Use div, span or body (you may use html and it would be work as body).

216 |
217 |
218 | 219 | 220 | 221 |
Examples
222 | 223 | 224 |
225 |
226 |
default param
227 |
228 |
229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 |
237 |
238 |
239 |
To start click Submit button
240 | Effect 241 | 259 | 260 |
261 |
262 |

263 | 					

$('#container').waitMe({

264 |

effect : 'bounce',

265 |

text : '',

266 |

bg : rgba(255,255,255,0.7),

267 |

color : #000,

268 |

maxSize : '',

269 |

waitTime : -1,

270 |

textPos : 'vertical',

271 |

fontSize : '',

272 |

source : '',

273 |

onClose : function() {}

274 |

});

275 |
276 |
277 | 278 | 279 |
280 |
281 |
maxSize
282 | 283 | 284 |
285 |

286 | 					

$('#container').waitMe({

287 |

effect : 'bounce',

288 |

text : '',

289 |

bg : rgba(255,255,255,0.7),

290 |

color : #000,

291 |

maxSize : 30,

292 |

waitTime : -1,

293 |

textPos : 'vertical',

294 |

fontSize : '',

295 |

source : '',

296 |

onClose : function() {}

297 |

});

298 |
299 |
300 | 301 | 302 |
303 |
304 |
horizontal text position
305 |
Click to start
306 | 307 |
308 |

309 | 					

$('#container').waitMe({

310 |

effect : 'bounce',

311 |

text : '',

312 |

bg : rgba(255,255,255,0.7),

313 |

color : #000,

314 |

maxSize : '',

315 |

waitTime : -1,

316 |

textPos : 'horizontal',

317 |

fontSize : '',

318 |

source : '',

319 |

onClose : function() {}

320 |

});

321 |
322 |
323 | 324 | 325 |
326 |
327 |
Animation during the initial page load
328 | Effect 329 | 335 | 336 |
337 | 338 |
339 | 340 |
341 |
342 |
progress
343 |
344 |

345 | 					

<body class="waitMe_body">

346 |

<div class="waitMe_container progress" style="background:#fff">

347 |

<div style="background:#000"></div>

348 |

</div>

349 |

</body>

350 |
351 |
352 |
353 |
354 |
working
355 |
356 |

357 | 					

<body class="waitMe_body">

358 |

<div class="waitMe_container working" style="background:#fff">

359 |

<div style="background:#000"></div>

360 |

</div>

361 |

</body>

362 |
363 |
364 |
365 |
366 |
img
367 |
368 |

369 | 					

<body class="waitMe_body">

370 |

<div class="waitMe_container img" style="background:#fff">

371 |

<div style="background:url('img.png')"></div>

372 |

</div>

373 |

</body>

374 |
375 |
376 |
377 |
378 |
text
379 |
380 |

381 | 					

<body class="waitMe_body">

382 |

<div class="waitMe_container text" style="background:#fff">

383 |

<div style="color:#000">Loading</div>

384 |

</div>

385 |

</body>

386 |
387 |
388 | 389 |
390 | 391 |
392 | 393 |
394 | 395 | 401 | 402 | 403 | 404 | 405 | 505 | 506 | 507 | 508 | -------------------------------------------------------------------------------- /waitMe.css: -------------------------------------------------------------------------------- 1 | /* 2 | waitMe - 1.19 [31.10.17] 3 | Author: vadimsva 4 | Github: https://github.com/vadimsva/waitMe 5 | */ 6 | .waitMe_container:not(body) {transform:translateZ(0);backface-visibility:hidden} 7 | body.waitMe_container .waitMe {position:fixed;height:100vh;transform:translateZ(0);backface-visibility:hidden} 8 | body.waitMe_container .waitMe .waitMe_content {top:50%!important;transform:none!important} 9 | .waitMe_container .waitMe {position:absolute;top:0;left:0;right:0;bottom:0;z-index:9989;text-align:center;overflow:hidden;cursor:wait} 10 | .waitMe_container .waitMe * {font-family:inherit;font-size:inherit;font-weight:initial;font-style:initial;line-height:initial;color:initial;text-decoration:initial;text-transform:initial;padding:initial;margin:initial} 11 | .waitMe_container .waitMe .waitMe_content {position:absolute;left:0;right:0;top:50%;backface-visibility:hidden} 12 | .waitMe_container .waitMe .waitMe_content.horizontal > .waitMe_progress {display:inline-block;vertical-align:middle} 13 | .waitMe_container .waitMe .waitMe_content.horizontal > .waitMe_text {display:inline-block;margin:0 0 0 20px;vertical-align:middle} 14 | .waitMe_container .waitMe .waitMe_progress {position:relative;font-size:0;line-height:0} 15 | .waitMe_container .waitMe .waitMe_progress > div {animation-fill-mode:both;display:inline-block;transform:translateZ(0);backface-visibility:hidden} 16 | .waitMe_container .waitMe .waitMe_text {position:relative;margin:20px 0 0} 17 | 18 | /* before load animation */ 19 | body.waitMe_body {overflow:hidden;height:100%} 20 | body.waitMe_body.hideMe {transition:opacity .2s ease-in-out;opacity:0} 21 | body.waitMe_body .waitMe_container:not([data-waitme_id]) {position:fixed;z-index:9989;top:0;bottom:0;left:0;right:0;background:#fff} 22 | body.waitMe_body .waitMe_container:not([data-waitme_id]) > div {animation-fill-mode:both;position:absolute} 23 | body.waitMe_body .waitMe_container.progress > div {width:0;height:3px;top:0;left:0;background:#000;box-shadow:-5px 0 5px 2px rgba(0,0,0,.2);animation:progress_body 7s infinite ease-out} 24 | body.waitMe_body .waitMe_container.working > div {width:10%;height:3px;top:0;left:-10%;background:#000;box-shadow:-5px 0 5px 2px rgba(0,0,0,.2);animation:working_body 2s infinite linear} 25 | body.waitMe_body .waitMe_container.progress > div:after {content:'';position:absolute;top:0;bottom:60%;right:0;width:60px;border-radius:50%;opacity:.5;transform:rotate(3deg);box-shadow:#000 1px 0 6px 1px} 26 | body.waitMe_body .waitMe_container.img > div {width:100%;height:100%;text-align:center;background-position:center!important;background-repeat:no-repeat!important} 27 | body.waitMe_body .waitMe_container.text > div {width:100%;top:45%;text-align:center} 28 | @keyframes progress_body { 29 | 0% {width:0} 30 | 100% {width:100%} 31 | } 32 | @keyframes working_body { 33 | 0% {left:-10%} 34 | 100% {left:100%} 35 | } 36 | 37 | 38 | /* bounce */ 39 | .waitMe_container .waitMe_progress.bounce > div {width:20px;height:20px;border-radius:50%;animation:bounce 1.4s infinite ease-in-out} 40 | .waitMe_container .waitMe_progress.bounce .waitMe_progress_elem1 {animation-delay:-.32s} 41 | .waitMe_container .waitMe_progress.bounce .waitMe_progress_elem2 {animation-delay:-.16s} 42 | @keyframes bounce { 43 | 0%, 80%, 100% {transform:scale(0)} 44 | 40% {transform:scale(1)} 45 | } 46 | 47 | 48 | /* rotateplane */ 49 | .waitMe_container .waitMe_progress.rotateplane > div {width:30px;height:30px;animation:rotateplane 1.2s infinite ease-in-out;backface-visibility:visible} 50 | @keyframes rotateplane { 51 | 0% {transform:perspective(120px)} 52 | 50% {transform:perspective(120px) rotateY(180deg)} 53 | 100% {transform:perspective(120px) rotateY(180deg) rotateX(180deg)} 54 | } 55 | 56 | 57 | /* stretch */ 58 | .waitMe_container .waitMe_progress.stretch {height:60px} 59 | .waitMe_container .waitMe_progress.stretch > div {width:1px;height:100%;margin:0 4px;animation:stretch 1.2s infinite ease-in-out} 60 | .waitMe_container .waitMe_progress.stretch .waitMe_progress_elem2 {animation-delay:-1.1s} 61 | .waitMe_container .waitMe_progress.stretch .waitMe_progress_elem3 {animation-delay:-1s} 62 | .waitMe_container .waitMe_progress.stretch .waitMe_progress_elem4 {animation-delay:-.9s} 63 | .waitMe_container .waitMe_progress.stretch .waitMe_progress_elem5 {animation-delay:-.8s} 64 | @keyframes stretch { 65 | 0%, 40%, 100% {transform:scaleY(.4)} 66 | 20% {transform:scaleY(1)} 67 | } 68 | 69 | 70 | /* orbit */ 71 | .waitMe_container .waitMe_progress.orbit {width:40px;height:40px;margin:auto;position:relative} 72 | .waitMe_container .waitMe_progress.orbit > div {width:100%;height:100%;margin:auto;top:0;left:0;position:absolute;animation:orbit_rotate 2s infinite linear} 73 | .waitMe_container .waitMe_progress.orbit > div > div {width:50%;height:50%;border-radius:50%;top:10%;left:10%;position:absolute;animation:orbit 2s infinite ease-in-out} 74 | .waitMe_container .waitMe_progress.orbit .waitMe_progress_elem2 > div {top:auto;bottom:10%;left:auto;right:10%;animation-delay:-1s} 75 | @keyframes orbit_rotate { 76 | 0% {transform:rotate(0deg)} 77 | 100% {transform:rotate(360deg)} 78 | } 79 | @keyframes orbit { 80 | 0%, 100% {transform:scale(0)} 81 | 50% {transform:scale(1)} 82 | } 83 | 84 | 85 | /* roundBounce */ 86 | .waitMe_container .waitMe_progress.roundBounce {width:60px;height:60px;margin:auto} 87 | .waitMe_container .waitMe_progress.roundBounce > div {width:24%;height:24%;border-radius:50%;position:absolute;animation:roundBounce 1.2s infinite ease-in-out} 88 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem1 {top:0;left:0} 89 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem2 {top:0;right:0} 90 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem3 {bottom:0;right:0} 91 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem4 {bottom:0;left:0} 92 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem5 {top:-3%;left:50%;margin-top:-12%;margin-left:-12%} 93 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem6 {top:50%;right:-3%;margin-top:-12%;margin-right:-12%} 94 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem7 {bottom:-3%;left:50%;margin-bottom:-12%;margin-left:-12%} 95 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem8 {top:50%;left:-3%;margin-top:-12%;margin-left:-12%} 96 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem9 {top:0;right:0} 97 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem10 {bottom:0;right:0} 98 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem11 {bottom:0;left:0} 99 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem12 {top:0;left:0} 100 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem5 {animation-delay:-1.1s} 101 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem9 {animation-delay:-1s} 102 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem2 {animation-delay:-.9s} 103 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem6 {animation-delay:-.8s} 104 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem10 {animation-delay:-.7s} 105 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem3 {animation-delay:-.6s} 106 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem7 {animation-delay:-.5s} 107 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem11 {animation-delay:-.4s} 108 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem4 {animation-delay:-.3s} 109 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem8 {animation-delay:-.2s} 110 | .waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem12 {animation-delay:-.1s} 111 | @keyframes roundBounce { 112 | 0%, 80%, 100% {transform:scale(0)} 113 | 40% {transform:scale(1)} 114 | } 115 | 116 | 117 | /* win8 */ 118 | .waitMe_container .waitMe_progress.win8 {width:40px;height:40px;margin:auto} 119 | .waitMe_container .waitMe_progress.win8 > div {width:100%;height:100%;opacity:0;position:absolute;margin:auto;left:0;right:0;transform:rotate(225deg);animation:win8 5.5s infinite} 120 | .waitMe_container .waitMe_progress.win8 > div > div {width:15%;height:15%;border-radius:50%;position:absolute} 121 | .waitMe_container .waitMe_progress.win8 .waitMe_progress_elem2 {animation-delay:.24s} 122 | .waitMe_container .waitMe_progress.win8 .waitMe_progress_elem3 {animation-delay:.48s} 123 | .waitMe_container .waitMe_progress.win8 .waitMe_progress_elem4 {animation-delay:.72s} 124 | .waitMe_container .waitMe_progress.win8 .waitMe_progress_elem5 {animation-delay:.96s} 125 | @keyframes win8 { 126 | 0% {transform:rotate(225deg);animation-timing-function:ease-out} 127 | 7% {opacity:1;transform:rotate(345deg);animation-timing-function:linear} 128 | 30% {transform:rotate(455deg);animation-timing-function:ease-in-out} 129 | 39% {transform:rotate(690deg);animation-timing-function:linear} 130 | 70% {opacity:1;transform:rotate(815deg);animation-timing-function:ease-out} 131 | 75% {transform:rotate(945deg);animation-timing-function:ease-out} 132 | 76% {opacity:0;transform:rotate(945deg)} 133 | 100% {opacity:0;transform:rotate(945deg)} 134 | } 135 | 136 | 137 | /* win8_linear */ 138 | .waitMe_container .waitMe_progress.win8_linear {margin:auto;width:150px;height:6px} 139 | .waitMe_container .waitMe_progress.win8_linear > div {width:100%;height:100%;left:0;opacity:0;position:absolute;animation:win8_linear 3s infinite} 140 | .waitMe_container .waitMe_progress.win8_linear > div > div {width:4%;height:100%;border-radius:50%} 141 | .waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem2 {animation-delay:.3s} 142 | .waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem3 {animation-delay:.6s} 143 | .waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem4 {animation-delay:.9s} 144 | .waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem5 {animation-delay:1.2s} 145 | @keyframes win8_linear { 146 | 0%, 100% {transform:translateX(0);animation-timing-function:ease-out} 147 | 10% {opacity:1;transform:translateX(33.333%);animation-timing-function:linear} 148 | 50% {opacity:1;transform:translateX(53.333%);animation-timing-function:ease-in-out} 149 | 60% {opacity:0;transform:translateX(86.666%)} 150 | } 151 | 152 | 153 | /* ios */ 154 | .waitMe_container .waitMe_progress.ios {margin:auto;width:40px;height:40px} 155 | .waitMe_container .waitMe_progress.ios > div {width:10%;height:26%;position:absolute;left:44.5%;top:37%;opacity:0;border-radius:50px;box-shadow:0 0 3px rgba(0,0,0,.2);animation:ios 1s infinite linear} 156 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem1 {transform:rotate(0deg) translate(0, -142%);animation-delay:0s} 157 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem2 {transform:rotate(30deg) translate(0, -142%);animation-delay:-.9167s} 158 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem3 {transform:rotate(60deg) translate(0, -142%);animation-delay:-.833s} 159 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem4 {transform:rotate(90deg) translate(0, -142%);animation-delay:-.75s} 160 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem5 {transform:rotate(120deg) translate(0, -142%);animation-delay:-.667s} 161 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem6 {transform:rotate(150deg) translate(0, -142%);animation-delay:-.5833s} 162 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem7 {transform:rotate(180deg) translate(0, -142%);animation-delay:-.5s} 163 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem8 {transform:rotate(210deg) translate(0, -142%);animation-delay:-.41667s} 164 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem9 {transform:rotate(240deg) translate(0, -142%);animation-delay:-.333s} 165 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem10 {transform:rotate(270deg) translate(0, -142%);animation-delay:-.25s} 166 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem11 {transform:rotate(300deg) translate(0, -142%);animation-delay:-.1667s} 167 | .waitMe_container .waitMe_progress.ios .waitMe_progress_elem12 {transform:rotate(330deg) translate(0, -142%);animation-delay:-.0833s} 168 | @keyframes ios { 169 | 0% {opacity:1} 170 | 100% {opacity:.25} 171 | } 172 | 173 | 174 | /* facebook */ 175 | .waitMe_container .waitMe_progress.facebook {margin:auto} 176 | .waitMe_container .waitMe_progress.facebook > div {width:6px;height:25px;margin-left:3px;border-radius:20px;transform:scaleY(.7);opacity:.1;animation:facebook 1.3s infinite ease-in-out} 177 | .waitMe_container .waitMe_progress.facebook > .waitMe_progress_elem1 {animation-delay:.2s;transform:scaleY(.7)} 178 | .waitMe_container .waitMe_progress.facebook > .waitMe_progress_elem2 {animation-delay:.4s;transform:scaleY(.85)} 179 | .waitMe_container .waitMe_progress.facebook > .waitMe_progress_elem3 {animation-delay:.6s;transform:scaleY(1)} 180 | @keyframes facebook { 181 | 0% {transform:scaleY(.7);opacity:.1} 182 | 50% {transform:scaleY(1);opacity:1} 183 | 100% {transform:scaleY(.7);opacity:.1} 184 | } 185 | 186 | 187 | /* rotation */ 188 | .waitMe_container .waitMe_progress.rotation > div {width:60px;height:60px;margin:auto;border-radius:100%;border-width:6px;border-style:solid;border-left-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important;animation:rotation 1s infinite linear} 189 | @keyframes rotation { 190 | 0% {transform:rotate(0deg)} 191 | 100% {transform:rotate(360deg)} 192 | } 193 | 194 | 195 | /* timer */ 196 | .waitMe_container .waitMe_progress.timer {width:40px;height:40px;margin:auto;border-width:2px;border-style:solid;border-radius:50%;box-sizing:border-box;position:relative;text-indent:-9999px} 197 | .waitMe_container .waitMe_progress.timer > .waitMe_progress_elem1, 198 | .waitMe_container .waitMe_progress.timer > .waitMe_progress_elem2 {border-radius:3px;position:absolute;width:2px;height:48%;left:50%;top:50%;margin-left:-1px;margin-top:-1px;animation:timer 1.25s infinite linear;transform-origin:1px 1px} 199 | .waitMe_container .waitMe_progress.timer > .waitMe_progress_elem2 {height:40%;animation:timer 15s infinite linear} 200 | @keyframes timer { 201 | 0% {transform:rotate(0deg)} 202 | 100% {transform:rotate(360deg)} 203 | } 204 | 205 | 206 | /* pulse */ 207 | .waitMe_container .waitMe_progress.pulse {width:30px;height:30px;margin:auto;position:relative} 208 | .waitMe_container .waitMe_progress.pulse > div {margin:auto;top:0;left:0;right:0;bottom:0;border-width:3px;border-style:solid;border-radius:50%;position:absolute;opacity:0;animation:pulsate 1s infinite ease-out} 209 | @keyframes pulsate { 210 | 0% {transform:scale(.1);opacity:0} 211 | 50% {opacity:1} 212 | 100% {transform:scale(1.2);opacity:0} 213 | } 214 | 215 | 216 | /* progressBar */ 217 | .waitMe_container .waitMe_progress.progressBar {width:200px;height:20px;margin:auto;background:rgba(0,0,0,.1);padding:5px;border-radius:20px;line-height:0;max-width:100%} 218 | .waitMe_container .waitMe_progress.progressBar > div {width:100%;height:100%;overflow:hidden;border-radius:20px;background-size:50px 50px;box-shadow:inset 0 2px 9px rgba(255,255,255,.3), inset 0 -2px 6px rgba(0,0,0,.4);background-image:linear-gradient(-45deg, rgba(240,240,240,.4) 26%, transparent 25%, transparent 51%, rgba(240,240,240,.4) 50%, rgba(240,240,240,.4) 76%, transparent 75%, transparent);animation:progressBar 2s linear infinite} 219 | @keyframes progressBar { 220 | 0% {background-position:0 0} 221 | 100% {background-position:50px 50px} 222 | } 223 | 224 | 225 | /* bouncePulse */ 226 | .waitMe_container .waitMe_progress.bouncePulse > div {width:20px;height:20px;margin-right:1px;display:inline-block;border-radius:50%;transform:scale(.5);animation:bouncePulse 1.4s infinite ease-in-out} 227 | .waitMe_container .waitMe_progress.bouncePulse > .waitMe_progress_elem1, 228 | .waitMe_container .waitMe_progress.bouncePulse > .waitMe_progress_elem3 {animation-delay:.1s} 229 | .waitMe_container .waitMe_progress.bouncePulse > .waitMe_progress_elem2 {animation-delay:.4s} 230 | @keyframes bouncePulse { 231 | 0%, 80%, 100% {transform:scale(.5)} 232 | 40% {transform:scale(1)} 233 | } 234 | -------------------------------------------------------------------------------- /waitMe.js: -------------------------------------------------------------------------------- 1 | /* 2 | waitMe - 1.19 [31.10.17] 3 | Author: vadimsva 4 | Github: https://github.com/vadimsva/waitMe 5 | */ 6 | (function($) { 7 | $.fn.waitMe = function(method) { 8 | return this.each(function() { 9 | 10 | var elem = $(this), 11 | elemClass = 'waitMe', 12 | waitMe_text, 13 | effectObj, 14 | effectElemCount, 15 | createSubElem = false, 16 | specificAttr = 'background-color', 17 | addStyle = '', 18 | effectElemHTML = '', 19 | waitMeObj, 20 | _options, 21 | currentID; 22 | 23 | var methods = { 24 | init : function() { 25 | var _defaults = { 26 | effect: 'bounce', 27 | text: '', 28 | bg: 'rgba(255,255,255,0.7)', 29 | color: '#000', 30 | maxSize: '', 31 | waitTime: -1, 32 | textPos: 'vertical', 33 | fontSize: '', 34 | source: '', 35 | onClose: function() {} 36 | }; 37 | _options = $.extend(_defaults, method); 38 | 39 | currentID = new Date().getMilliseconds(); 40 | waitMeObj = $('
'); 41 | 42 | switch (_options.effect) { 43 | case 'none': 44 | effectElemCount = 0; 45 | break; 46 | case 'bounce': 47 | effectElemCount = 3; 48 | break; 49 | case 'rotateplane': 50 | effectElemCount = 1; 51 | break; 52 | case 'stretch': 53 | effectElemCount = 5; 54 | break; 55 | case 'orbit': 56 | effectElemCount = 2; 57 | createSubElem = true; 58 | break; 59 | case 'roundBounce': 60 | effectElemCount = 12; 61 | break; 62 | case 'win8': 63 | effectElemCount = 5; 64 | createSubElem = true; 65 | break; 66 | case 'win8_linear': 67 | effectElemCount = 5; 68 | createSubElem = true; 69 | break; 70 | case 'ios': 71 | effectElemCount = 12; 72 | break; 73 | case 'facebook': 74 | effectElemCount = 3; 75 | break; 76 | case 'rotation': 77 | effectElemCount = 1; 78 | specificAttr = 'border-color'; 79 | break; 80 | case 'timer': 81 | effectElemCount = 2; 82 | if ($.isArray(_options.color)) { 83 | var color = _options.color[0]; 84 | } else { 85 | var color = _options.color; 86 | } 87 | addStyle = 'border-color:' + color; 88 | break; 89 | case 'pulse': 90 | effectElemCount = 1; 91 | specificAttr = 'border-color'; 92 | break; 93 | case 'progressBar': 94 | effectElemCount = 1; 95 | break; 96 | case 'bouncePulse': 97 | effectElemCount = 3; 98 | break; 99 | case 'img': 100 | effectElemCount = 1; 101 | break; 102 | } 103 | 104 | if (addStyle !== '') { 105 | addStyle += ';'; 106 | } 107 | 108 | if (effectElemCount > 0) { 109 | if(_options.effect === 'img') { 110 | effectElemHTML = ''; 111 | } else { 112 | for (var i = 1; i <= effectElemCount; ++i) { 113 | if ($.isArray(_options.color)) { 114 | var color = _options.color[i]; 115 | if (color == undefined) { 116 | color = '#000'; 117 | } 118 | } else { 119 | var color = _options.color; 120 | } 121 | if (createSubElem) { 122 | effectElemHTML += '
'; 123 | } else { 124 | effectElemHTML += '
'; 125 | } 126 | } 127 | } 128 | effectObj = $('
' + effectElemHTML + '
'); 129 | } 130 | 131 | if (_options.text) { 132 | if ($.isArray(_options.color)) { 133 | var color = _options.color[0]; 134 | } else { 135 | var color = _options.color; 136 | } 137 | if (_options.fontSize != '') { 138 | var size = 'font-size:'+_options.fontSize; 139 | } else { 140 | var size = ''; 141 | } 142 | waitMe_text = $('
' + _options.text + '
'); 143 | } 144 | var elemObj = elem.find('> .' + elemClass); 145 | 146 | if (elemObj) { 147 | elemObj.remove(); 148 | } 149 | var waitMeDivObj = $('
'); 150 | waitMeDivObj.append(effectObj, waitMe_text); 151 | waitMeObj.append(waitMeDivObj); 152 | if (elem[0].tagName == 'HTML') { 153 | elem = $('body'); 154 | } 155 | elem.addClass(elemClass + '_container').attr('data-waitme_id', currentID).append(waitMeObj); 156 | elemObj = elem.find('> .' + elemClass); 157 | var elemContentObj = elem.find('.' + elemClass + '_content'); 158 | elemObj.css({background: _options.bg}); 159 | 160 | if (_options.maxSize !== '' && _options.effect != 'none') { 161 | var elemH = effectObj.outerHeight(); 162 | var elemW = effectObj.outerWidth(); 163 | var elemMax = elemH; 164 | if (_options.effect === 'img') { 165 | effectObj.css({height: _options.maxSize + 'px'}); 166 | effectObj.find('>img').css({maxHeight: '100%'}); 167 | elemContentObj.css({marginTop: - elemContentObj.outerHeight() / 2 + 'px'}); 168 | } else { 169 | if (_options.maxSize < elemMax) { 170 | if (_options.effect == 'stretch') { 171 | effectObj.css({height:_options.maxSize + 'px', width:_options.maxSize + 'px'}); 172 | effectObj.find('> div').css({margin: '0 5%'}); 173 | } else { 174 | var zoom = _options.maxSize / elemMax - 0.2; 175 | var offset = '-50%'; 176 | if (_options.effect == 'roundBounce') { 177 | offset = '-75%'; 178 | if (_options.text) { 179 | offset = '75%'; 180 | } 181 | } else if (_options.effect == 'win8' || _options.effect == 'timer' || _options.effect == 'orbit') { 182 | offset = '-20%'; 183 | if (_options.text) { 184 | offset = '20%'; 185 | } 186 | } else if (_options.effect == 'ios') { 187 | offset = '-15%'; 188 | if (_options.text) { 189 | offset = '15%'; 190 | } 191 | } 192 | if (_options.effect == 'rotation') { 193 | if (_options.text) { 194 | offset = '75%'; 195 | } 196 | } 197 | effectObj.css({transform: 'scale('+zoom+') translateX('+offset+')', whiteSpace:'nowrap'}); 198 | } 199 | 200 | } 201 | } 202 | } 203 | elemContentObj.css({marginTop: - elemContentObj.outerHeight() / 2 + 'px'}); 204 | 205 | function setElTop(getTop) { 206 | elemContentObj.css({top: 'auto', transform: 'translateY(' + getTop + 'px) translateZ(0)'}); 207 | } 208 | if (elem.outerHeight() > $(window).height()) { 209 | var sTop = $(window).scrollTop(), 210 | elH = elemContentObj.outerHeight(), 211 | elTop = elem.offset().top, 212 | cH = elem.outerHeight(), 213 | getTop = sTop - elTop + $(window).height()/2; 214 | if (getTop < 0) { 215 | getTop = Math.abs(getTop); 216 | } 217 | if (getTop - elH >= 0 && getTop + elH <= cH) { 218 | if (elTop - sTop > $(window).height()/2) { 219 | getTop = elH; 220 | } 221 | setElTop(getTop); 222 | } else { 223 | if (sTop > elTop + cH - elH) { 224 | getTop = sTop - elTop - elH; 225 | } else { 226 | getTop = sTop - elTop + elH; 227 | } 228 | setElTop(getTop); 229 | } 230 | $(document).scroll(function() { 231 | var sTop = $(window).scrollTop(), 232 | getTop = sTop - elTop + $(window).height()/2; 233 | if (getTop - elH >= 0 && getTop + elH <= cH) { 234 | setElTop(getTop); 235 | } 236 | }); 237 | } 238 | 239 | if (_options.waitTime > 0) { 240 | setTimeout(function(){ 241 | waitMeClose(); 242 | }, _options.waitTime); 243 | } 244 | 245 | elemObj.on('destroyed', function() { 246 | if (_options.onClose && $.isFunction(_options.onClose)) { 247 | _options.onClose(elem); 248 | } 249 | elemObj.trigger('close', {el: elem}); 250 | }); 251 | 252 | $.event.special.destroyed = { 253 | remove: function(o) { 254 | if (o.handler) { 255 | o.handler(); 256 | } 257 | } 258 | }; 259 | 260 | return elemObj; 261 | }, 262 | hide : function() { 263 | waitMeClose(); 264 | } 265 | }; 266 | 267 | function waitMeClose() { 268 | var currentID = elem.attr('data-waitme_id'); 269 | elem.removeClass(elemClass + '_container').removeAttr('data-waitme_id'); 270 | elem.find('.' + elemClass + '[data-waitme_id="' + currentID + '"]').remove(); 271 | } 272 | 273 | if (methods[method]) { 274 | return methods[method].apply( this, Array.prototype.slice.call(arguments, 1)); 275 | } else if (typeof method === 'object' || ! method) { 276 | return methods.init.apply(this, arguments); 277 | } 278 | 279 | }); 280 | 281 | }; 282 | $(window).on('load', function(){ 283 | $('body.waitMe_body').addClass('hideMe'); 284 | setTimeout(function(){ 285 | $('body.waitMe_body').find('.waitMe_container:not([data-waitme_id])').remove(); 286 | $('body.waitMe_body').removeClass('waitMe_body hideMe'); 287 | },200); 288 | }); 289 | })(jQuery); 290 | -------------------------------------------------------------------------------- /waitMe.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | waitMe - 1.19 [31.10.17] 3 | Author: vadimsva 4 | Github: https://github.com/vadimsva/waitMe 5 | */ 6 | .waitMe_container:not(body),body.waitMe_container .waitMe{transform:translateZ(0);backface-visibility:hidden}body.waitMe_container .waitMe{position:fixed;height:100vh}body.waitMe_container .waitMe .waitMe_content{top:50%!important;transform:none!important}.waitMe_container .waitMe{position:absolute;top:0;left:0;right:0;bottom:0;z-index:9989;text-align:center;overflow:hidden;cursor:wait}.waitMe_container .waitMe *{font-family:inherit;font-size:inherit;font-weight:initial;font-style:initial;line-height:initial;color:initial;text-decoration:initial;text-transform:initial;padding:initial;margin:initial}.waitMe_container .waitMe .waitMe_content{position:absolute;left:0;right:0;top:50%;backface-visibility:hidden}.waitMe_container .waitMe .waitMe_content.horizontal>.waitMe_progress{display:inline-block;vertical-align:middle}.waitMe_container .waitMe .waitMe_content.horizontal>.waitMe_text{display:inline-block;margin:0 0 0 20px;vertical-align:middle}.waitMe_container .waitMe .waitMe_progress{position:relative;font-size:0;line-height:0}.waitMe_container .waitMe .waitMe_progress>div{animation-fill-mode:both;display:inline-block;transform:translateZ(0);backface-visibility:hidden}.waitMe_container .waitMe .waitMe_text{position:relative;margin:20px 0 0}body.waitMe_body{overflow:hidden;height:100%}body.waitMe_body.hideMe{transition:opacity .2s ease-in-out;opacity:0}body.waitMe_body .waitMe_container:not([data-waitme_id]){position:fixed;z-index:9989;top:0;bottom:0;left:0;right:0;background:#fff}body.waitMe_body .waitMe_container:not([data-waitme_id])>div{animation-fill-mode:both;position:absolute}body.waitMe_body .waitMe_container.progress>div{width:0;height:3px;top:0;left:0;background:#000;box-shadow:-5px 0 5px 2px rgba(0,0,0,.2);animation:progress_body 7s infinite ease-out}body.waitMe_body .waitMe_container.working>div{width:10%;height:3px;top:0;left:-10%;background:#000;box-shadow:-5px 0 5px 2px rgba(0,0,0,.2);animation:working_body 2s infinite linear}body.waitMe_body .waitMe_container.progress>div:after{content:'';position:absolute;top:0;bottom:60%;right:0;width:60px;border-radius:50%;opacity:.5;transform:rotate(3deg);box-shadow:#000 1px 0 6px 1px}body.waitMe_body .waitMe_container.img>div{width:100%;height:100%;text-align:center;background-position:center!important;background-repeat:no-repeat!important}body.waitMe_body .waitMe_container.text>div{width:100%;top:45%;text-align:center}@keyframes progress_body{0%{width:0}100%{width:100%}}@keyframes working_body{0%{left:-10%}100%{left:100%}}.waitMe_container .waitMe_progress.bounce>div{width:20px;height:20px;border-radius:50%;animation:bounce 1.4s infinite ease-in-out}.waitMe_container .waitMe_progress.bounce .waitMe_progress_elem1{animation-delay:-.32s}.waitMe_container .waitMe_progress.bounce .waitMe_progress_elem2{animation-delay:-.16s}@keyframes bounce{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.waitMe_container .waitMe_progress.rotateplane>div{width:30px;height:30px;animation:rotateplane 1.2s infinite ease-in-out;backface-visibility:visible}@keyframes rotateplane{0%{transform:perspective(120px)}50%{transform:perspective(120px) rotateY(180deg)}100%{transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}.waitMe_container .waitMe_progress.stretch{height:60px}.waitMe_container .waitMe_progress.stretch>div{width:1px;height:100%;margin:0 4px;animation:stretch 1.2s infinite ease-in-out}.waitMe_container .waitMe_progress.stretch .waitMe_progress_elem2{animation-delay:-1.1s}.waitMe_container .waitMe_progress.stretch .waitMe_progress_elem3{animation-delay:-1s}.waitMe_container .waitMe_progress.stretch .waitMe_progress_elem4{animation-delay:-.9s}.waitMe_container .waitMe_progress.stretch .waitMe_progress_elem5{animation-delay:-.8s}@keyframes stretch{0%,100%,40%{transform:scaleY(.4)}20%{transform:scaleY(1)}}.waitMe_container .waitMe_progress.orbit{width:40px;height:40px;margin:auto;position:relative}.waitMe_container .waitMe_progress.orbit>div{width:100%;height:100%;margin:auto;top:0;left:0;position:absolute;animation:orbit_rotate 2s infinite linear}.waitMe_container .waitMe_progress.orbit>div>div{width:50%;height:50%;border-radius:50%;top:10%;left:10%;position:absolute;animation:orbit 2s infinite ease-in-out}.waitMe_container .waitMe_progress.orbit .waitMe_progress_elem2>div{top:auto;bottom:10%;left:auto;right:10%;animation-delay:-1s}@keyframes orbit_rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes orbit{0%,100%{transform:scale(0)}50%{transform:scale(1)}}.waitMe_container .waitMe_progress.roundBounce{width:60px;height:60px;margin:auto}.waitMe_container .waitMe_progress.roundBounce>div{width:24%;height:24%;border-radius:50%;position:absolute;animation:roundBounce 1.2s infinite ease-in-out}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem1{top:0;left:0}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem2{top:0;right:0}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem3{bottom:0;right:0}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem4{bottom:0;left:0}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem5{top:-3%;left:50%;margin-top:-12%;margin-left:-12%;animation-delay:-1.1s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem6{top:50%;right:-3%;margin-top:-12%;margin-right:-12%}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem7{bottom:-3%;left:50%;margin-bottom:-12%;margin-left:-12%}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem8{top:50%;left:-3%;margin-top:-12%;margin-left:-12%}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem9{top:0;right:0;animation-delay:-1s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem2{animation-delay:-.9s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem6{animation-delay:-.8s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem10{bottom:0;right:0;animation-delay:-.7s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem3{animation-delay:-.6s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem7{animation-delay:-.5s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem11{bottom:0;left:0;animation-delay:-.4s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem4{animation-delay:-.3s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem8{animation-delay:-.2s}.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem12{top:0;left:0;animation-delay:-.1s}@keyframes roundBounce{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.waitMe_container .waitMe_progress.win8{width:40px;height:40px;margin:auto}.waitMe_container .waitMe_progress.win8>div{width:100%;height:100%;opacity:0;position:absolute;margin:auto;left:0;right:0;transform:rotate(225deg);animation:win8 5.5s infinite}.waitMe_container .waitMe_progress.win8>div>div{width:15%;height:15%;border-radius:50%;position:absolute}.waitMe_container .waitMe_progress.win8 .waitMe_progress_elem2{animation-delay:.24s}.waitMe_container .waitMe_progress.win8 .waitMe_progress_elem3{animation-delay:.48s}.waitMe_container .waitMe_progress.win8 .waitMe_progress_elem4{animation-delay:.72s}.waitMe_container .waitMe_progress.win8 .waitMe_progress_elem5{animation-delay:.96s}@keyframes win8{0%{transform:rotate(225deg);animation-timing-function:ease-out}7%{opacity:1;transform:rotate(345deg);animation-timing-function:linear}30%{transform:rotate(455deg);animation-timing-function:ease-in-out}39%{transform:rotate(690deg);animation-timing-function:linear}70%{opacity:1;transform:rotate(815deg);animation-timing-function:ease-out}75%{transform:rotate(945deg);animation-timing-function:ease-out}100%,76%{opacity:0;transform:rotate(945deg)}}.waitMe_container .waitMe_progress.win8_linear{margin:auto;width:150px;height:6px}.waitMe_container .waitMe_progress.win8_linear>div{width:100%;height:100%;left:0;opacity:0;position:absolute;animation:win8_linear 3s infinite}.waitMe_container .waitMe_progress.win8_linear>div>div{width:4%;height:100%;border-radius:50%}.waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem2{animation-delay:.3s}.waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem3{animation-delay:.6s}.waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem4{animation-delay:.9s}.waitMe_container .waitMe_progress.win8_linear .waitMe_progress_elem5{animation-delay:1.2s}@keyframes win8_linear{0%,100%{transform:translateX(0);animation-timing-function:ease-out}10%{opacity:1;transform:translateX(33.333%);animation-timing-function:linear}50%{opacity:1;transform:translateX(53.333%);animation-timing-function:ease-in-out}60%{opacity:0;transform:translateX(86.666%)}}.waitMe_container .waitMe_progress.ios{margin:auto;width:40px;height:40px}.waitMe_container .waitMe_progress.ios>div{width:10%;height:26%;position:absolute;left:44.5%;top:37%;opacity:0;border-radius:50px;box-shadow:0 0 3px rgba(0,0,0,.2);animation:ios 1s infinite linear}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem1{transform:rotate(0) translate(0,-142%);animation-delay:0s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem2{transform:rotate(30deg) translate(0,-142%);animation-delay:-.9167s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem3{transform:rotate(60deg) translate(0,-142%);animation-delay:-.833s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem4{transform:rotate(90deg) translate(0,-142%);animation-delay:-.75s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem5{transform:rotate(120deg) translate(0,-142%);animation-delay:-.667s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem6{transform:rotate(150deg) translate(0,-142%);animation-delay:-.5833s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem7{transform:rotate(180deg) translate(0,-142%);animation-delay:-.5s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem8{transform:rotate(210deg) translate(0,-142%);animation-delay:-.41667s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem9{transform:rotate(240deg) translate(0,-142%);animation-delay:-.333s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem10{transform:rotate(270deg) translate(0,-142%);animation-delay:-.25s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem11{transform:rotate(300deg) translate(0,-142%);animation-delay:-.1667s}.waitMe_container .waitMe_progress.ios .waitMe_progress_elem12{transform:rotate(330deg) translate(0,-142%);animation-delay:-.0833s}@keyframes ios{0%{opacity:1}100%{opacity:.25}}.waitMe_container .waitMe_progress.facebook{margin:auto}.waitMe_container .waitMe_progress.facebook>div{width:6px;height:25px;margin-left:3px;border-radius:20px;transform:scaleY(.7);opacity:.1;animation:facebook 1.3s infinite ease-in-out}.waitMe_container .waitMe_progress.facebook>.waitMe_progress_elem1{animation-delay:.2s;transform:scaleY(.7)}.waitMe_container .waitMe_progress.facebook>.waitMe_progress_elem2{animation-delay:.4s;transform:scaleY(.85)}.waitMe_container .waitMe_progress.facebook>.waitMe_progress_elem3{animation-delay:.6s;transform:scaleY(1)}@keyframes facebook{0%,100%{transform:scaleY(.7);opacity:.1}50%{transform:scaleY(1);opacity:1}}.waitMe_container .waitMe_progress.rotation>div{width:60px;height:60px;margin:auto;border-radius:100%;border-width:6px;border-style:solid;border-left-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important;animation:rotation 1s infinite linear}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.waitMe_container .waitMe_progress.timer{width:40px;height:40px;margin:auto;border-width:2px;border-style:solid;border-radius:50%;box-sizing:border-box;position:relative;text-indent:-9999px}.waitMe_container .waitMe_progress.timer>.waitMe_progress_elem1,.waitMe_container .waitMe_progress.timer>.waitMe_progress_elem2{border-radius:3px;position:absolute;width:2px;height:48%;left:50%;top:50%;margin-left:-1px;margin-top:-1px;animation:timer 1.25s infinite linear;transform-origin:1px 1px}.waitMe_container .waitMe_progress.timer>.waitMe_progress_elem2{height:40%;animation:timer 15s infinite linear}@keyframes timer{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.waitMe_container .waitMe_progress.pulse{width:30px;height:30px;margin:auto;position:relative}.waitMe_container .waitMe_progress.pulse>div{margin:auto;top:0;left:0;right:0;bottom:0;border-width:3px;border-style:solid;border-radius:50%;position:absolute;opacity:0;animation:pulsate 1s infinite ease-out}@keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}.waitMe_container .waitMe_progress.progressBar{width:200px;height:20px;margin:auto;background:rgba(0,0,0,.1);padding:5px;border-radius:20px;line-height:0;max-width:100%}.waitMe_container .waitMe_progress.progressBar>div{width:100%;height:100%;overflow:hidden;border-radius:20px;background-size:50px 50px;box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);background-image:linear-gradient(-45deg,rgba(240,240,240,.4) 26%,transparent 25%,transparent 51%,rgba(240,240,240,.4) 50%,rgba(240,240,240,.4) 76%,transparent 75%,transparent);animation:progressBar 2s linear infinite}@keyframes progressBar{0%{background-position:0 0}100%{background-position:50px 50px}}.waitMe_container .waitMe_progress.bouncePulse>div{width:20px;height:20px;margin-right:1px;display:inline-block;border-radius:50%;transform:scale(.5);animation:bouncePulse 1.4s infinite ease-in-out}.waitMe_container .waitMe_progress.bouncePulse>.waitMe_progress_elem1,.waitMe_container .waitMe_progress.bouncePulse>.waitMe_progress_elem3{animation-delay:.1s}.waitMe_container .waitMe_progress.bouncePulse>.waitMe_progress_elem2{animation-delay:.4s}@keyframes bouncePulse{0%,100%,80%{transform:scale(.5)}40%{transform:scale(1)}} 7 | -------------------------------------------------------------------------------- /waitMe.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | waitMe - 1.19 [31.10.17] 3 | Author: vadimsva 4 | Github: https://github.com/vadimsva/waitMe 5 | */ 6 | (function(b){b.fn.waitMe=function(p){return this.each(function(){function y(){var a=f.attr("data-waitme_id");f.removeClass("waitMe_container").removeAttr("data-waitme_id");f.find('.waitMe[data-waitme_id="'+a+'"]').remove()}var f=b(this),z,g,e,r=!1,t="background-color",u="",q="",v,a,w,n={init:function(){function n(a){l.css({top:"auto",transform:"translateY("+a+"px) translateZ(0)"})}a=b.extend({effect:"bounce",text:"",bg:"rgba(255,255,255,0.7)",color:"#000",maxSize:"",waitTime:-1,textPos:"vertical", 7 | fontSize:"",source:"",onClose:function(){}},p);w=(new Date).getMilliseconds();v=b('
');switch(a.effect){case "none":e=0;break;case "bounce":e=3;break;case "rotateplane":e=1;break;case "stretch":e=5;break;case "orbit":e=2;r=!0;break;case "roundBounce":e=12;break;case "win8":e=5;r=!0;break;case "win8_linear":e=5;r=!0;break;case "ios":e=12;break;case "facebook":e=3;break;case "rotation":e=1;t="border-color";break;case "timer":e=2;var c=b.isArray(a.color)? 8 | a.color[0]:a.color;u="border-color:"+c;break;case "pulse":e=1;t="border-color";break;case "progressBar":e=1;break;case "bouncePulse":e=3;break;case "img":e=1}""!==u&&(u+=";");if(0';else for(var d=1;d<=e;++d)b.isArray(a.color)?(c=a.color[d],void 0==c&&(c="#000")):c=a.color,q=r?q+('
'):q+('
');g=b('
'+q+"
")}a.text&&(c=b.isArray(a.color)?a.color[0]:a.color,z=b('
'+a.text+"
"));var k=f.find("> .waitMe");k&&k.remove();c=b('
');c.append(g,z);v.append(c);"HTML"==f[0].tagName&&(f=b("body"));f.addClass("waitMe_container").attr("data-waitme_id",w).append(v);k=f.find("> .waitMe");var l=f.find(".waitMe_content");k.css({background:a.bg}); 10 | ""!==a.maxSize&&"none"!=a.effect&&(c=g.outerHeight(),g.outerWidth(),"img"===a.effect?(g.css({height:a.maxSize+"px"}),g.find(">img").css({maxHeight:"100%"}),l.css({marginTop:-l.outerHeight()/2+"px"})):a.maxSize div").css({margin:"0 5%"})):(c=a.maxSize/c-.2,d="-50%","roundBounce"==a.effect?(d="-75%",a.text&&(d="75%")):"win8"==a.effect||"timer"==a.effect||"orbit"==a.effect?(d="-20%",a.text&&(d="20%")):"ios"==a.effect&& 11 | (d="-15%",a.text&&(d="15%")),"rotation"==a.effect&&a.text&&(d="75%"),g.css({transform:"scale("+c+") translateX("+d+")",whiteSpace:"nowrap"}))));l.css({marginTop:-l.outerHeight()/2+"px"});if(f.outerHeight()>b(window).height()){c=b(window).scrollTop();var h=l.outerHeight(),m=f.offset().top,x=f.outerHeight();d=c-m+b(window).height()/2;0>d&&(d=Math.abs(d));0<=d-h&&d+h<=x?m-c>b(window).height()/2&&(d=h):d=c>m+x-h?c-m-h:c-m+h;n(d);b(document).scroll(function(){var a=b(window).scrollTop()-m+b(window).height()/ 12 | 2;0<=a-h&&a+h<=x&&n(a)})}0