update patch 1
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 vadimsva
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,20 @@
|
||||
waitMe
|
||||
======
|
||||
|
||||
jquery plugin for easy creating loading css3 animations<br>
|
||||
Simple to use. Contains 14 animation effects and can use images.
|
||||
|
||||
<i>For work required only jQuery, other libraries are not required.</i>
|
||||
<i>Plugin works on all browsers and IE10+ (for css3 animation effects).</i>
|
||||
<br>
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
<a href="http://vadimsva.github.io/waitMe/" target="_blank"><b>DOCUMENTATION & EXAMPLES</b></a>
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
The MIT License (MIT)
|
||||
@@ -0,0 +1 @@
|
||||
<svg width='48px' height='48px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(0 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(30 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.08333333333333333s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(60 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.16666666666666666s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(90 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.25s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(120 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.3333333333333333s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(150 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.4166666666666667s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(180 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.5s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(210 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.5833333333333334s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(240 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.6666666666666666s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(270 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.75s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(300 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.8333333333333334s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#00b2ff' transform='rotate(330 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.9166666666666666s' repeatCount='indefinite'/></rect></svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,507 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>waitMe</title>
|
||||
<style>
|
||||
* {margin:0;font-family:Roboto,sans-serif;outline:0;box-sizing:border-box;font-size:14px}
|
||||
body {background:#f1f1f1}
|
||||
|
||||
::-webkit-scrollbar {width:10px}
|
||||
::-webkit-scrollbar-track {background-color:#f1f1f1}
|
||||
::-webkit-scrollbar-thumb {background-color:#9699a2}
|
||||
::-webkit-scrollbar-thumb:hover {background-color:#555}
|
||||
|
||||
#page {margin:30px auto 60px;width:40%;min-width:800px;min-height:500px}
|
||||
#page_content {background:#fff;box-shadow:0 1px 5px #ccc;margin:20px 0 20px;border-radius:3px;position:relative;padding:30px 30px 60px}
|
||||
|
||||
.pageCaption {margin-bottom:40px;font-size:34px;line-height:40px}
|
||||
.blockCaption {margin-bottom:20px;font-size:24px;border-bottom:1px solid #ddd;line-height:40px}
|
||||
|
||||
#header {}
|
||||
.prjData {float:right;font-weight:500;line-height:24px;display:flex}
|
||||
.prjData > a {font-size:12px;display:inline-block;padding:0 10px;border-radius:3px;text-decoration:none;margin-left:5px;transition:all 0.2s ease-in-out}
|
||||
.prjData > a:hover {box-shadow:inset 0 0 0 30px rgba(0,0,0,0.2)}
|
||||
.prjData > .prjVer {background:transparent;color:#555;display:inline-block;padding:0 10px;margin-left:5px;font-size:12px}
|
||||
.prjData > .prjVer > span {margin-left:10px;font-size:12px;color:#999}
|
||||
.prjData > .prjDownloadLink {color:#fff;background:#0084ff}
|
||||
.prjData > .prjGitLink {color:#555;background:#ccc}
|
||||
.prjName {font-size:24px;font-weight:500;line-height:24px}
|
||||
.prjDesc {color:#777;margin-top:5px;font-size:90%}
|
||||
|
||||
#footer {}
|
||||
.prjCopyright {color:#777}
|
||||
.prjLicense {float:right;font-size:12px}
|
||||
.prjAuthor {font-size:12px}
|
||||
|
||||
|
||||
.exampleContainer {margin:-1px 0 50px}
|
||||
.exampleContainer:last-child {margin-bottom:0}
|
||||
.exampleContainer .exampleLive {padding:20px 0;font-size:14px}
|
||||
.exampleContainer .exampleLive:after {content:'';clear:both;display:table}
|
||||
.exampleContainer .exampleLive .exampleLiveTitle {padding-bottom:10px}
|
||||
.exampleContainer .exampleCode {background:#2b2f3b;padding:20px;overflow:auto;border-radius:4px}
|
||||
.exampleContainer .exampleCode pre {line-height:0}
|
||||
.exampleContainer .exampleCode code {white-space:pre-line}
|
||||
.exampleContainer .exampleCode code * {font-family:consolas;font-size:13px}
|
||||
.exampleContainer .exampleCode code > p {line-height:20px;color:#7993ad;display:inline-block}
|
||||
.exampleContainer .exampleCode code .tab {padding-left:15px}
|
||||
.exampleContainer .exampleCode code .tab2 {padding-left:30px}
|
||||
.exampleContainer .exampleCode code .tab3 {padding-left:45px}
|
||||
.exampleContainer .exampleCode code .tab4 {padding-left:60px}
|
||||
.exampleContainer .exampleCode code .tag {color:#97e0e9}
|
||||
.exampleContainer .exampleCode code .text {color:#fff}
|
||||
.exampleContainer .exampleCode code .key {color:#bf5c5b}
|
||||
.exampleContainer .exampleCode code .val {color:#fadf8c}
|
||||
.exampleContainer .exampleCode code .var {color:#aae997}
|
||||
.exampleContainer .exampleCode code .var2 {color:#b297e9}
|
||||
|
||||
.docContainer {margin-bottom:40px}
|
||||
.docContainer:last-child {margin-bottom:0}
|
||||
.docContainer > .docLive > .docTitle {padding-bottom:10px}
|
||||
.docContainer > .docLive > .docText {padding-bottom:10px;font-size:13px;color:#444}
|
||||
.docContainer > .docLive > p {margin-bottom:10px;line-height:22px}
|
||||
.docContainer > .docCode {background:#f7f7f9;padding:20px;overflow:auto;border-radius:4px}
|
||||
.docContainer > .docCode + .docLive {margin-top:20px}
|
||||
.docContainer > .docCode pre {line-height:0}
|
||||
.docContainer > .docCode code {white-space:pre-line}
|
||||
.docContainer > .docCode code * {font-family:consolas;font-size:13px}
|
||||
.docContainer > .docCode code > p {line-height:22px;color:#7993ad;display:inline-block}
|
||||
.docContainer > .docCode code .tab {padding-left:15px}
|
||||
.docContainer > .docCode code .tab2 {padding-left:30px}
|
||||
.docContainer > .docCode code .tab3 {padding-left:45px}
|
||||
.docContainer > .docCode code .tab4 {padding-left:60px}
|
||||
.docContainer > .docCode code .tag {color:#26bfef}
|
||||
.docContainer > .docCode code .text {color:#333}
|
||||
.docContainer > .docCode code .key {color:#f52222}
|
||||
.docContainer > .docCode code .val {color:#007b10}
|
||||
.docContainer > .docCode code .var {color:#1cc1d4}
|
||||
.docContainer > .docCode code .var2 {color:#7c46e8}
|
||||
.docContainer .code {background:#d9dee2;display:inline-block;padding:0 2px;border-radius:3px;line-height:18px;font-family:consolas;font-size:13px}
|
||||
|
||||
.containerBlock form {margin:0 25%;text-align:center;padding:30px;background:#fafafa;border:1px solid #ddd}
|
||||
.containerBlock form > label {display:block;padding-bottom:5px;text-align:left}
|
||||
.containerBlock form > input {width:100%;padding:6px 12px;margin-bottom:15px}
|
||||
.containerBlock form > button {margin-top:15px}
|
||||
.controlContainer {padding-top:50px;text-align:center}
|
||||
.controlContainer div {padding-bottom:10px}
|
||||
.controlContainer select {padding:6px 12px;height:34px}
|
||||
.controlContainer select + button {margin-left:20px}
|
||||
|
||||
|
||||
/* btn */
|
||||
.btn {display:inline-block;cursor:pointer;background:#fff;border:1px solid #bbb;height:34px;padding:6px 12px;font-size:14px;line-height:18px;transition:all 0.3s ease-in-out}
|
||||
.btn.btn-default {}
|
||||
.btn.btn-default:hover {background:#eee;border-color:#bbb}
|
||||
.btn.btn-default:focus {background:#ddd;border-color:#bbb}
|
||||
.btn.btn-primary {background-color:#0084ff;border-color:#0084ff;color:#fff}
|
||||
.btn.btn-primary:hover {background-color:#006dd2;border-color:#006dd2}
|
||||
.btn.btn-primary:focus {background-color:#0155a2;border-color:#0155a2;transform:translateY(1px)}
|
||||
.btn.btn-default[disabled] {background:#fafafa!important;border-color:#ccc!important;color:#aaa}
|
||||
.btn.btn-primary[disabled] {background:#3F9DD0!important;border-color:#537FA9!important;color:#ACD3E8;box-shadow:none!important}
|
||||
|
||||
.btn.btn-left {float:left;margin:0 5px 0 0!important}
|
||||
|
||||
|
||||
/* tabs */
|
||||
.tabs_container {position:fixed;left:calc(50% - 400px - 180px);width:160px;margin-top:-30px}
|
||||
.tabs_container:after {content:'';clear:both;display:table}
|
||||
.tabs_container > .tab {line-height:40px;cursor:pointer;color:#7d8798;margin:0 15px;font-size:14px}
|
||||
.tabs_container > .tab > span {position:relative;display:inline-block;line-height:24px}
|
||||
.tabs_container > .tab.active > span {color:#000}
|
||||
.tabs_container > .tab > span:before {content:'';position:absolute;height:2px;left:0;width:0;bottom:0;background:#0084ff;transition:.2s}
|
||||
.tabs_container > .tab.active > span:before,
|
||||
.tabs_container > .tab:hover > span:before {width:100%}
|
||||
.tabs_container > .tab:hover {color:#000}
|
||||
.tabs_container > .totop {position:fixed;bottom:30px;width:160px;padding:20px;line-height:20px;text-align:center;background:rgba(200, 200, 200, 0.2);font-size:25px;color:#7d8798;border-radius:3px;cursor:pointer;transition:all 0.3s ease-in-out}
|
||||
.tabs_container > .totop:hover {background:rgba(200, 200, 200, 0.4)}
|
||||
.page_container {position:relative}
|
||||
.page_container > .page {min-height:900px;padding-bottom:150px;position:relative}
|
||||
.page_container > .page:after {content:'';position:absolute;bottom:100px;border-bottom:1px solid #eee;margin:auto;left:-30px;right:-30px}
|
||||
.page_container > .page:last-child {padding-bottom:0}
|
||||
.page_container > .page:last-child:after {display:none}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 840px){
|
||||
#page {width:auto;min-width:0;margin:20px 20px 100px}
|
||||
}
|
||||
|
||||
@media (max-width: 460px){
|
||||
.containerBlock form {margin:0}
|
||||
}
|
||||
|
||||
#waitMe_ex2 {width:40px;margin-right:20px;vertical-align:top}
|
||||
#waitMe_ex3 {line-height:20px;width:50%;border:1px solid #eee;padding:7px 15px;display:inline-block;margin-right:20px;vertical-align:top}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,500">
|
||||
<link type="text/css" rel="stylesheet" href="waitMe.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="page">
|
||||
|
||||
<div id="header">
|
||||
<div class="prjData">
|
||||
<div class="prjVer" title="Current version/date">1.19<span>[31.10.17]</span></div>
|
||||
<a href="https://github.com/vadimsva/waitMe/releases" class="prjDownloadLink">Download</a>
|
||||
<a href="https://github.com/vadimsva/waitMe" class="prjGitLink">GitHub Repo</a>
|
||||
</div>
|
||||
<div class="prjName">waitMe</div>
|
||||
<div class="prjDesc">jquery plugin for easy creating loading css3/images animations</div>
|
||||
</div>
|
||||
|
||||
<div id="page_content">
|
||||
|
||||
<div class="page_container">
|
||||
<div class="page" data-page="waitMe">
|
||||
|
||||
<div class="pageCaption">waitMe</div>
|
||||
|
||||
<div class="blockCaption">Documentation</div>
|
||||
|
||||
<div class="docContainer">
|
||||
<div class="docLive">
|
||||
<div class="docTitle">Basic</div>
|
||||
</div>
|
||||
<div class="docCode"><pre><code>
|
||||
<p><span class="key">$(<span class="val">'#elem'</span>).waitMe(<span class="text">{}</span>)</span> - #elem is html object, click on which causes to show waitme.</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="docContainer">
|
||||
<div class="docLive">
|
||||
<div class="docTitle">Options</div>
|
||||
</div>
|
||||
<div class="docCode"><pre><code>
|
||||
<p><span class="key">effect</span> - animation effect. Use: <span class="val code">'bounce'</span> - default, <span class="val code">'none'</span>, <span class="val code">'rotateplane'</span>, <span class="val code">'stretch'</span>, <span class="val code">'orbit'</span>, <span class="val code">'roundBounce'</span>, <span class="val code">'win8'</span>, <span class="val code">'win8_linear'</span>, <span class="val code">'ios'</span>, <span class="val code">'facebook'</span>, <span class="val code">'rotation'</span>, <span class="val code">'timer'</span>, <span class="val code">'pulse'</span>, <span class="val code">'progressBar'</span>, <span class="val code">'bouncePulse'</span>, <span class="val code">'img'</span>.</p>
|
||||
<p><span class="key">text</span> - place text under the effect. Use: <span class="val code">'text'</span>.</p>
|
||||
<p><span class="key">bg</span> - background for container. Use: <span class="val code">'rgba(255,255,255,0.7)'</span> - default, <span class="val code">false</span>.</p>
|
||||
<p><span class="key">color</span> - color for background animation and text. Use: <span class="val code">'#000'</span> - default, <span class="val code">['','',...]</span> - you can use multicolor for effect.</p>
|
||||
<p><span class="key">maxSize</span> - set max size for elem animation. Use: <span class="val code">''</span> - default, <span class="val code">40</span>.</p>
|
||||
<p><span class="key">waitTime</span> - wait time im ms to close. Use: <span class="val code">-1</span> - default, <span class="val code">3000</span>.</p>
|
||||
<p><span class="key">textPos</span> - change text position. Use: <span class="val code">'vertical'</span> - default, <span class="val code">'horizontal'</span>.</p>
|
||||
<p><span class="key">fontSize</span> - change font size. Use: <span class="val code">''</span> - default, <span class="val code">'18px'</span>.</p>
|
||||
<p><span class="key">source</span> - url to image. Use: <span class="val code">''</span> - default, <span class="val code">'url'</span> - for <span class="val code">effect: 'img'</span>.</p>
|
||||
<p><span class="key">onClose</span> - code execution after popup closed. Use: <span class="val code">function(event, el){}</span>.</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="docContainer">
|
||||
<div class="docLive">
|
||||
<div class="docTitle">Methods</div>
|
||||
</div>
|
||||
<div class="docCode"><pre><code>
|
||||
<p><span class="key">hide</span> - for close waitMe. Use: <span class="val code">$(container).waitMe("hide");</span>.</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="docContainer">
|
||||
<div class="docLive">
|
||||
<div class="docTitle">Triggers</div>
|
||||
</div>
|
||||
<div class="docCode"><pre><code>
|
||||
<p><span class="key">close</span> - execution after closed. Use: <span class="val code">$(el).on('close', function() {});</span>.</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="docContainer">
|
||||
<div class="docLive">
|
||||
<div class="docTitle">Notes</div>
|
||||
</div>
|
||||
<div class="docLive">
|
||||
<p>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).</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="blockCaption">Examples</div>
|
||||
|
||||
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">default param</div>
|
||||
<div class="containerBlock">
|
||||
<form>
|
||||
<label>Name</label>
|
||||
<input type="text">
|
||||
<label>Email</label>
|
||||
<input type="text">
|
||||
<label>Phone</label>
|
||||
<input type="text">
|
||||
<button type="button" class="btn btn-primary" id="waitMe_ex">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="controlContainer">
|
||||
<div>To start click Submit button</div>
|
||||
Effect
|
||||
<select id="waitMe_ex_effect">
|
||||
<option>none</option>
|
||||
<option selected>bounce</option>
|
||||
<option>rotateplane</option>
|
||||
<option>stretch</option>
|
||||
<option>orbit</option>
|
||||
<option>roundBounce</option>
|
||||
<option>win8</option>
|
||||
<option>win8_linear</option>
|
||||
<option>ios</option>
|
||||
<option>facebook</option>
|
||||
<option>rotation</option>
|
||||
<option>timer</option>
|
||||
<option>pulse</option>
|
||||
<option>progressBar</option>
|
||||
<option>bouncePulse</option>
|
||||
<option>img</option>
|
||||
</select>
|
||||
<button class="btn btn-default waitMe_ex_close">STOP</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><span class="text">$('</span><span class="tag">#container</span><span class="text">').waitMe(</span>{</p>
|
||||
<p class="tab"><span class="key">effect</span> : <span class="val">'bounce'</span>,</p>
|
||||
<p class="tab"><span class="key">text</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">bg</span> : <span class="val">rgba(255,255,255,0.7)</span>,</p>
|
||||
<p class="tab"><span class="key">color</span> : <span class="val">#000</span>,</p>
|
||||
<p class="tab"><span class="key">maxSize</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">waitTime</span> : <span class="val">-1</span>,</p>
|
||||
<p class="tab"><span class="key">textPos</span> : <span class="val">'vertical'</span>,</p>
|
||||
<p class="tab"><span class="key">fontSize</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">source</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">onClose</span> : <span class="val">function() {}</span></p>
|
||||
<p>}<span class="text">)</span>;</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">maxSize</div>
|
||||
<button type="button" class="btn btn-primary" id="waitMe_ex2"></button>
|
||||
<button type="button" class="btn btn-default waitMe_ex_close">STOP</button>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><span class="text">$('</span><span class="tag">#container</span><span class="text">').waitMe(</span>{</p>
|
||||
<p class="tab"><span class="key">effect</span> : <span class="val">'bounce'</span>,</p>
|
||||
<p class="tab"><span class="key">text</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">bg</span> : <span class="val">rgba(255,255,255,0.7)</span>,</p>
|
||||
<p class="tab"><span class="key">color</span> : <span class="val">#000</span>,</p>
|
||||
<p class="tab"><span class="key">maxSize</span> : <span class="val">30</span>,</p>
|
||||
<p class="tab"><span class="key">waitTime</span> : <span class="val">-1</span>,</p>
|
||||
<p class="tab"><span class="key">textPos</span> : <span class="val">'vertical'</span>,</p>
|
||||
<p class="tab"><span class="key">fontSize</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">source</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">onClose</span> : <span class="val">function() {}</span></p>
|
||||
<p>}<span class="text">)</span>;</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">horizontal text position</div>
|
||||
<div id="waitMe_ex3">Click to start</div>
|
||||
<button type="button" class="btn btn-default waitMe_ex_close">STOP</button>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><span class="text">$('</span><span class="tag">#container</span><span class="text">').waitMe(</span>{</p>
|
||||
<p class="tab"><span class="key">effect</span> : <span class="val">'bounce'</span>,</p>
|
||||
<p class="tab"><span class="key">text</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">bg</span> : <span class="val">rgba(255,255,255,0.7)</span>,</p>
|
||||
<p class="tab"><span class="key">color</span> : <span class="val">#000</span>,</p>
|
||||
<p class="tab"><span class="key">maxSize</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">waitTime</span> : <span class="val">-1</span>,</p>
|
||||
<p class="tab"><span class="key">textPos</span> : <span class="val">'horizontal'</span>,</p>
|
||||
<p class="tab"><span class="key">fontSize</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">source</span> : <span class="val">''</span>,</p>
|
||||
<p class="tab"><span class="key">onClose</span> : <span class="val">function() {}</span></p>
|
||||
<p>}<span class="text">)</span>;</p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="containerBlock">
|
||||
<div class="controlContainer">
|
||||
<div>Animation during the initial page load</div>
|
||||
Effect
|
||||
<select id="waitMe_ex_body_effect">
|
||||
<option selected>progress</option>
|
||||
<option>working</option>
|
||||
<option>img</option>
|
||||
<option>text</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" id="waitMe_ex_body">EXAMPLE</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">progress</div>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><<span class="tag">body</span> <span class="key">class</span>=<span class="val">"waitMe_body"</span>></p>
|
||||
<p class="tab"><<span class="tag">div</span> <span class="key">class</span>=<span class="val">"waitMe_container progress"</span> <span class="key">style</span>=<span class="val">"background:#fff"</span>></p>
|
||||
<p class="tab2"><<span class="tag">div</span> <span class="key">style</span>=<span class="val">"background:#000"</span>></<span class="tag">div</span>></p>
|
||||
<p class="tab"></<span class="tag">div</span>></p>
|
||||
<p></<span class="tag">body</span>></p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">working</div>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><<span class="tag">body</span> <span class="key">class</span>=<span class="val">"waitMe_body"</span>></p>
|
||||
<p class="tab"><<span class="tag">div</span> <span class="key">class</span>=<span class="val">"waitMe_container working"</span> <span class="key">style</span>=<span class="val">"background:#fff"</span>></p>
|
||||
<p class="tab2"><<span class="tag">div</span> <span class="key">style</span>=<span class="val">"background:#000"</span>></<span class="tag">div</span>></p>
|
||||
<p class="tab"></<span class="tag">div</span>></p>
|
||||
<p></<span class="tag">body</span>></p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">img</div>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><<span class="tag">body</span> <span class="key">class</span>=<span class="val">"waitMe_body"</span>></p>
|
||||
<p class="tab"><<span class="tag">div</span> <span class="key">class</span>=<span class="val">"waitMe_container img"</span> <span class="key">style</span>=<span class="val">"background:#fff"</span>></p>
|
||||
<p class="tab2"><<span class="tag">div</span> <span class="key">style</span>=<span class="val">"background:url('img.png')"</span>></<span class="tag">div</span>></p>
|
||||
<p class="tab"></<span class="tag">div</span>></p>
|
||||
<p></<span class="tag">body</span>></p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="exampleContainer">
|
||||
<div class="exampleLive">
|
||||
<div class="exampleLiveTitle">text</div>
|
||||
</div>
|
||||
<div class="exampleCode"><pre><code>
|
||||
<p><<span class="tag">body</span> <span class="key">class</span>=<span class="val">"waitMe_body"</span>></p>
|
||||
<p class="tab"><<span class="tag">div</span> <span class="key">class</span>=<span class="val">"waitMe_container text"</span> <span class="key">style</span>=<span class="val">"background:#fff"</span>></p>
|
||||
<p class="tab2"><<span class="tag">div</span> <span class="key">style</span>=<span class="val">"color:#000"</span>>Loading</<span class="tag">div</span>></p>
|
||||
<p class="tab"></<span class="tag">div</span>></p>
|
||||
<p></<span class="tag">body</span>></p>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<div class="prjCopyright">
|
||||
<div class="prjLicense">MIT License</div>
|
||||
<div class="prjAuthor">Developed by vadimsva</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="waitMe.js"></script>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
var current_effect = $('#waitMe_ex_effect').val();
|
||||
|
||||
$('#waitMe_ex').click(function(){
|
||||
run_waitMe($('.containerBlock > form'), 1, current_effect);
|
||||
});
|
||||
$('.waitMe_ex_close').click(function(){
|
||||
$('.containerBlock > form').waitMe('hide');
|
||||
$('#waitMe_ex2').waitMe('hide');
|
||||
$('#waitMe_ex3').waitMe('hide');
|
||||
});
|
||||
|
||||
$('#waitMe_ex_effect').change(function(){
|
||||
current_effect = $(this).val();
|
||||
run_waitMe($('.containerBlock > form'), 1, current_effect);
|
||||
run_waitMe($('#waitMe_ex2'), 2, current_effect);
|
||||
run_waitMe($('#waitMe_ex3'), 3, current_effect);
|
||||
});
|
||||
|
||||
$('#waitMe_ex_effect').click(function(){
|
||||
current_effect = $(this).val();
|
||||
});
|
||||
|
||||
function run_waitMe(el, num, effect){
|
||||
text = 'Please wait...';
|
||||
fontSize = '';
|
||||
switch (num) {
|
||||
case 1:
|
||||
maxSize = '';
|
||||
textPos = 'vertical';
|
||||
break;
|
||||
case 2:
|
||||
text = '';
|
||||
maxSize = 30;
|
||||
textPos = 'vertical';
|
||||
break;
|
||||
case 3:
|
||||
maxSize = 30;
|
||||
textPos = 'horizontal';
|
||||
fontSize = '18px';
|
||||
break;
|
||||
}
|
||||
el.waitMe({
|
||||
effect: effect,
|
||||
text: text,
|
||||
bg: 'rgba(255,255,255,0.7)',
|
||||
color: '#000',
|
||||
maxSize: maxSize,
|
||||
waitTime: -1,
|
||||
source: 'img.svg',
|
||||
textPos: textPos,
|
||||
fontSize: fontSize,
|
||||
onClose: function(el) {}
|
||||
});
|
||||
}
|
||||
|
||||
$('#waitMe_ex2').click(function(){
|
||||
run_waitMe($(this), 2, current_effect);
|
||||
});
|
||||
|
||||
$('#waitMe_ex3').click(function(){
|
||||
run_waitMe($(this), 3, current_effect);
|
||||
});
|
||||
|
||||
var current_body_effect = $('#waitMe_ex_body_effect').val();
|
||||
|
||||
$('#waitMe_ex_body').click(function(){
|
||||
run_waitMe_body(current_body_effect);
|
||||
});
|
||||
|
||||
$('#waitMe_ex_body_effect').change(function(){
|
||||
current_body_effect = $(this).val();
|
||||
run_waitMe_body(current_body_effect);
|
||||
});
|
||||
|
||||
function run_waitMe_body(effect){
|
||||
$('body').addClass('waitMe_body');
|
||||
var img = '';
|
||||
var text = '';
|
||||
if(effect == 'img'){
|
||||
img = 'background:url(\'img.svg\')';
|
||||
} else if(effect == 'text'){
|
||||
text = 'Loading...';
|
||||
}
|
||||
var elem = $('<div class="waitMe_container ' + effect + '"><div style="' + img + '">' + text + '</div></div>');
|
||||
$('body').prepend(elem);
|
||||
|
||||
setTimeout(function(){
|
||||
$('body.waitMe_body').addClass('hideMe');
|
||||
setTimeout(function(){
|
||||
$('body.waitMe_body').find('.waitMe_container:not([data-waitme_id])').remove();
|
||||
$('body.waitMe_body').removeClass('waitMe_body hideMe');
|
||||
},200);
|
||||
},4000);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
waitMe - 1.19 [31.10.17]
|
||||
Author: vadimsva
|
||||
Github: https://github.com/vadimsva/waitMe
|
||||
*/
|
||||
.waitMe_container:not(body) {transform:translateZ(0);backface-visibility:hidden}
|
||||
body.waitMe_container .waitMe {position:fixed;height:100vh;transform:translateZ(0);backface-visibility:hidden}
|
||||
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}
|
||||
|
||||
/* before load animation */
|
||||
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%}
|
||||
}
|
||||
|
||||
|
||||
/* bounce */
|
||||
.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%, 80%, 100% {transform:scale(0)}
|
||||
40% {transform:scale(1)}
|
||||
}
|
||||
|
||||
|
||||
/* rotateplane */
|
||||
.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)}
|
||||
}
|
||||
|
||||
|
||||
/* stretch */
|
||||
.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%, 40%, 100% {transform:scaleY(.4)}
|
||||
20% {transform:scaleY(1)}
|
||||
}
|
||||
|
||||
|
||||
/* orbit */
|
||||
.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(0deg)}
|
||||
100% {transform:rotate(360deg)}
|
||||
}
|
||||
@keyframes orbit {
|
||||
0%, 100% {transform:scale(0)}
|
||||
50% {transform:scale(1)}
|
||||
}
|
||||
|
||||
|
||||
/* roundBounce */
|
||||
.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%}
|
||||
.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}
|
||||
.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem10 {bottom:0;right:0}
|
||||
.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem11 {bottom:0;left:0}
|
||||
.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem12 {top:0;left:0}
|
||||
.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem5 {animation-delay:-1.1s}
|
||||
.waitMe_container .waitMe_progress.roundBounce .waitMe_progress_elem9 {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 {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 {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 {animation-delay:-.1s}
|
||||
@keyframes roundBounce {
|
||||
0%, 80%, 100% {transform:scale(0)}
|
||||
40% {transform:scale(1)}
|
||||
}
|
||||
|
||||
|
||||
/* win8 */
|
||||
.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}
|
||||
76% {opacity:0;transform:rotate(945deg)}
|
||||
100% {opacity:0;transform:rotate(945deg)}
|
||||
}
|
||||
|
||||
|
||||
/* win8_linear */
|
||||
.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%)}
|
||||
}
|
||||
|
||||
|
||||
/* ios */
|
||||
.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(0deg) 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}
|
||||
}
|
||||
|
||||
|
||||
/* facebook */
|
||||
.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% {transform:scaleY(.7);opacity:.1}
|
||||
50% {transform:scaleY(1);opacity:1}
|
||||
100% {transform:scaleY(.7);opacity:.1}
|
||||
}
|
||||
|
||||
|
||||
/* rotation */
|
||||
.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(0deg)}
|
||||
100% {transform:rotate(360deg)}
|
||||
}
|
||||
|
||||
|
||||
/* timer */
|
||||
.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(0deg)}
|
||||
100% {transform:rotate(360deg)}
|
||||
}
|
||||
|
||||
|
||||
/* pulse */
|
||||
.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}
|
||||
}
|
||||
|
||||
|
||||
/* progressBar */
|
||||
.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}
|
||||
}
|
||||
|
||||
|
||||
/* bouncePulse */
|
||||
.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%, 80%, 100% {transform:scale(.5)}
|
||||
40% {transform:scale(1)}
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
waitMe - 1.19 [31.10.17]
|
||||
Author: vadimsva
|
||||
Github: https://github.com/vadimsva/waitMe
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.waitMe = function(method) {
|
||||
return this.each(function() {
|
||||
|
||||
var elem = $(this),
|
||||
elemClass = 'waitMe',
|
||||
waitMe_text,
|
||||
effectObj,
|
||||
effectElemCount,
|
||||
createSubElem = false,
|
||||
specificAttr = 'background-color',
|
||||
addStyle = '',
|
||||
effectElemHTML = '',
|
||||
waitMeObj,
|
||||
_options,
|
||||
currentID;
|
||||
|
||||
var methods = {
|
||||
init : function() {
|
||||
var _defaults = {
|
||||
effect: 'bounce',
|
||||
text: '',
|
||||
bg: 'rgba(255,255,255,0.7)',
|
||||
color: '#000',
|
||||
maxSize: '',
|
||||
waitTime: -1,
|
||||
textPos: 'vertical',
|
||||
fontSize: '',
|
||||
source: '',
|
||||
onClose: function() {}
|
||||
};
|
||||
_options = $.extend(_defaults, method);
|
||||
|
||||
currentID = new Date().getMilliseconds();
|
||||
waitMeObj = $('<div class="' + elemClass + '" data-waitme_id="' + currentID + '"></div>');
|
||||
|
||||
switch (_options.effect) {
|
||||
case 'none':
|
||||
effectElemCount = 0;
|
||||
break;
|
||||
case 'bounce':
|
||||
effectElemCount = 3;
|
||||
break;
|
||||
case 'rotateplane':
|
||||
effectElemCount = 1;
|
||||
break;
|
||||
case 'stretch':
|
||||
effectElemCount = 5;
|
||||
break;
|
||||
case 'orbit':
|
||||
effectElemCount = 2;
|
||||
createSubElem = true;
|
||||
break;
|
||||
case 'roundBounce':
|
||||
effectElemCount = 12;
|
||||
break;
|
||||
case 'win8':
|
||||
effectElemCount = 5;
|
||||
createSubElem = true;
|
||||
break;
|
||||
case 'win8_linear':
|
||||
effectElemCount = 5;
|
||||
createSubElem = true;
|
||||
break;
|
||||
case 'ios':
|
||||
effectElemCount = 12;
|
||||
break;
|
||||
case 'facebook':
|
||||
effectElemCount = 3;
|
||||
break;
|
||||
case 'rotation':
|
||||
effectElemCount = 1;
|
||||
specificAttr = 'border-color';
|
||||
break;
|
||||
case 'timer':
|
||||
effectElemCount = 2;
|
||||
if ($.isArray(_options.color)) {
|
||||
var color = _options.color[0];
|
||||
} else {
|
||||
var color = _options.color;
|
||||
}
|
||||
addStyle = 'border-color:' + color;
|
||||
break;
|
||||
case 'pulse':
|
||||
effectElemCount = 1;
|
||||
specificAttr = 'border-color';
|
||||
break;
|
||||
case 'progressBar':
|
||||
effectElemCount = 1;
|
||||
break;
|
||||
case 'bouncePulse':
|
||||
effectElemCount = 3;
|
||||
break;
|
||||
case 'img':
|
||||
effectElemCount = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (addStyle !== '') {
|
||||
addStyle += ';';
|
||||
}
|
||||
|
||||
if (effectElemCount > 0) {
|
||||
if(_options.effect === 'img') {
|
||||
effectElemHTML = '<img src="' + _options.source + '">';
|
||||
} else {
|
||||
for (var i = 1; i <= effectElemCount; ++i) {
|
||||
if ($.isArray(_options.color)) {
|
||||
var color = _options.color[i];
|
||||
if (color == undefined) {
|
||||
color = '#000';
|
||||
}
|
||||
} else {
|
||||
var color = _options.color;
|
||||
}
|
||||
if (createSubElem) {
|
||||
effectElemHTML += '<div class="' + elemClass + '_progress_elem' + i + '"><div style="' + specificAttr +':' + color + '"></div></div>';
|
||||
} else {
|
||||
effectElemHTML += '<div class="' + elemClass + '_progress_elem' + i + '" style="' + specificAttr + ':' + color + '"></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
effectObj = $('<div class="' + elemClass + '_progress ' + _options.effect + '" style="' + addStyle + '">' + effectElemHTML + '</div>');
|
||||
}
|
||||
|
||||
if (_options.text) {
|
||||
if ($.isArray(_options.color)) {
|
||||
var color = _options.color[0];
|
||||
} else {
|
||||
var color = _options.color;
|
||||
}
|
||||
if (_options.fontSize != '') {
|
||||
var size = 'font-size:'+_options.fontSize;
|
||||
} else {
|
||||
var size = '';
|
||||
}
|
||||
waitMe_text = $('<div class="' + elemClass + '_text" style="color:' + color + ';' + size + '">' + _options.text + '</div>');
|
||||
}
|
||||
var elemObj = elem.find('> .' + elemClass);
|
||||
|
||||
if (elemObj) {
|
||||
elemObj.remove();
|
||||
}
|
||||
var waitMeDivObj = $('<div class="' + elemClass + '_content ' + _options.textPos + '"></div>');
|
||||
waitMeDivObj.append(effectObj, waitMe_text);
|
||||
waitMeObj.append(waitMeDivObj);
|
||||
if (elem[0].tagName == 'HTML') {
|
||||
elem = $('body');
|
||||
}
|
||||
elem.addClass(elemClass + '_container').attr('data-waitme_id', currentID).append(waitMeObj);
|
||||
elemObj = elem.find('> .' + elemClass);
|
||||
var elemContentObj = elem.find('.' + elemClass + '_content');
|
||||
elemObj.css({background: _options.bg});
|
||||
|
||||
if (_options.maxSize !== '' && _options.effect != 'none') {
|
||||
var elemH = effectObj.outerHeight();
|
||||
var elemW = effectObj.outerWidth();
|
||||
var elemMax = elemH;
|
||||
if (_options.effect === 'img') {
|
||||
effectObj.css({height: _options.maxSize + 'px'});
|
||||
effectObj.find('>img').css({maxHeight: '100%'});
|
||||
elemContentObj.css({marginTop: - elemContentObj.outerHeight() / 2 + 'px'});
|
||||
} else {
|
||||
if (_options.maxSize < elemMax) {
|
||||
if (_options.effect == 'stretch') {
|
||||
effectObj.css({height:_options.maxSize + 'px', width:_options.maxSize + 'px'});
|
||||
effectObj.find('> div').css({margin: '0 5%'});
|
||||
} else {
|
||||
var zoom = _options.maxSize / elemMax - 0.2;
|
||||
var offset = '-50%';
|
||||
if (_options.effect == 'roundBounce') {
|
||||
offset = '-75%';
|
||||
if (_options.text) {
|
||||
offset = '75%';
|
||||
}
|
||||
} else if (_options.effect == 'win8' || _options.effect == 'timer' || _options.effect == 'orbit') {
|
||||
offset = '-20%';
|
||||
if (_options.text) {
|
||||
offset = '20%';
|
||||
}
|
||||
} else if (_options.effect == 'ios') {
|
||||
offset = '-15%';
|
||||
if (_options.text) {
|
||||
offset = '15%';
|
||||
}
|
||||
}
|
||||
if (_options.effect == 'rotation') {
|
||||
if (_options.text) {
|
||||
offset = '75%';
|
||||
}
|
||||
}
|
||||
effectObj.css({transform: 'scale('+zoom+') translateX('+offset+')', whiteSpace:'nowrap'});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
elemContentObj.css({marginTop: - elemContentObj.outerHeight() / 2 + 'px'});
|
||||
|
||||
function setElTop(getTop) {
|
||||
elemContentObj.css({top: 'auto', transform: 'translateY(' + getTop + 'px) translateZ(0)'});
|
||||
}
|
||||
if (elem.outerHeight() > $(window).height()) {
|
||||
var sTop = $(window).scrollTop(),
|
||||
elH = elemContentObj.outerHeight(),
|
||||
elTop = elem.offset().top,
|
||||
cH = elem.outerHeight(),
|
||||
getTop = sTop - elTop + $(window).height()/2;
|
||||
if (getTop < 0) {
|
||||
getTop = Math.abs(getTop);
|
||||
}
|
||||
if (getTop - elH >= 0 && getTop + elH <= cH) {
|
||||
if (elTop - sTop > $(window).height()/2) {
|
||||
getTop = elH;
|
||||
}
|
||||
setElTop(getTop);
|
||||
} else {
|
||||
if (sTop > elTop + cH - elH) {
|
||||
getTop = sTop - elTop - elH;
|
||||
} else {
|
||||
getTop = sTop - elTop + elH;
|
||||
}
|
||||
setElTop(getTop);
|
||||
}
|
||||
$(document).scroll(function() {
|
||||
var sTop = $(window).scrollTop(),
|
||||
getTop = sTop - elTop + $(window).height()/2;
|
||||
if (getTop - elH >= 0 && getTop + elH <= cH) {
|
||||
setElTop(getTop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_options.waitTime > 0) {
|
||||
setTimeout(function(){
|
||||
waitMeClose();
|
||||
}, _options.waitTime);
|
||||
}
|
||||
|
||||
elemObj.on('destroyed', function() {
|
||||
if (_options.onClose && $.isFunction(_options.onClose)) {
|
||||
_options.onClose(elem);
|
||||
}
|
||||
elemObj.trigger('close', {el: elem});
|
||||
});
|
||||
|
||||
$.event.special.destroyed = {
|
||||
remove: function(o) {
|
||||
if (o.handler) {
|
||||
o.handler();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return elemObj;
|
||||
},
|
||||
hide : function() {
|
||||
waitMeClose();
|
||||
}
|
||||
};
|
||||
|
||||
function waitMeClose() {
|
||||
var currentID = elem.attr('data-waitme_id');
|
||||
elem.removeClass(elemClass + '_container').removeAttr('data-waitme_id');
|
||||
elem.find('.' + elemClass + '[data-waitme_id="' + currentID + '"]').remove();
|
||||
}
|
||||
|
||||
if (methods[method]) {
|
||||
return methods[method].apply( this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || ! method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
$(window).on('load', function(){
|
||||
$('body.waitMe_body').addClass('hideMe');
|
||||
setTimeout(function(){
|
||||
$('body.waitMe_body').find('.waitMe_container:not([data-waitme_id])').remove();
|
||||
$('body.waitMe_body').removeClass('waitMe_body hideMe');
|
||||
},200);
|
||||
});
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
waitMe - 1.19 [31.10.17]
|
||||
Author: vadimsva
|
||||
Github: https://github.com/vadimsva/waitMe
|
||||
*/
|
||||
(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",
|
||||
fontSize:"",source:"",onClose:function(){}},p);w=(new Date).getMilliseconds();v=b('<div class="waitMe" data-waitme_id="'+w+'"></div>');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)?
|
||||
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<e){if("img"===a.effect)q='<img src="'+a.source+'">';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+('<div class="waitMe_progress_elem'+d+'"><div style="'+t+":"+c+'"></div></div>'):q+('<div class="waitMe_progress_elem'+d+'" style="'+t+":"+c+'"></div>');g=b('<div class="waitMe_progress '+
|
||||
a.effect+'" style="'+u+'">'+q+"</div>")}a.text&&(c=b.isArray(a.color)?a.color[0]:a.color,z=b('<div class="waitMe_text" style="color:'+c+";"+(""!=a.fontSize?"font-size:"+a.fontSize:"")+'">'+a.text+"</div>"));var k=f.find("> .waitMe");k&&k.remove();c=b('<div class="waitMe_content '+a.textPos+'"></div>');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});
|
||||
""!==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<c&&("stretch"==a.effect?(g.css({height:a.maxSize+"px",width:a.maxSize+"px"}),g.find("> 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&&
|
||||
(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()/
|
||||
2;0<=a-h&&a+h<=x&&n(a)})}0<a.waitTime&&setTimeout(function(){y()},a.waitTime);k.on("destroyed",function(){if(a.onClose&&b.isFunction(a.onClose))a.onClose(f);k.trigger("close",{el:f})});b.event.special.destroyed={remove:function(a){a.handler&&a.handler()}};return k},hide:function(){y()}};if(n[p])return n[p].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof p||!p)return n.init.apply(this,arguments)})};b(window).on("load",function(){b("body.waitMe_body").addClass("hideMe");setTimeout(function(){b("body.waitMe_body").find(".waitMe_container:not([data-waitme_id])").remove();
|
||||
b("body.waitMe_body").removeClass("waitMe_body hideMe")},200)})})(jQuery);
|
||||
Reference in New Issue
Block a user