Ajax Loader
×
HTML
  
1
  
2
 
3
<svg class="svg" width="162px" height="236px" viewBox="0 0 162 236" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
4
        <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
5
            <g id="Uppwork" sketch:type="MSLayerGroup">
6
                <path d="M9.39274297,8.94594823 L155.796198,18.2418709" id="a" stroke="#979797" sketch:type="MSShapeGroup"></path>
7
                <path d="M153.739957,20.1019573 L44.2631626,62.3315551" id="b" stroke="#979797" sketch:type="MSShapeGroup"></path>
8
                <path d="M39.8936506,66.5274591 L41.0976338,223.65403" id="d" stroke="#979797" sketch:type="MSShapeGroup"></path>
9
                <path d="M41.0784066,229.00206 L155.702567,20.8076628" id="e" stroke="#979797" sketch:type="MSShapeGroup"></path>
10
                <path d="M7.80997855,11.5635971 L40.1394074,62.8839444" id="c" stroke="#979797" sketch:type="MSShapeGroup"></path>
11
                <circle id="A" fill="#D8D8D8" sketch:type="MSShapeGroup" cx="8.5" cy="9.5" r="8.5"></circle>
12
                <circle id="B" fill="#D8D8D8" sketch:type="MSShapeGroup" cx="153.5" cy="18.5" r="8.5"></circle>
13
                <circle id="C" fill="#D8D8D8" sketch:type="MSShapeGroup" cx="41.5" cy="64.5" r="8.5"></circle>
14
                <circle id="D" fill="#D8D8D8" sketch:type="MSShapeGroup" cx="41.5" cy="227.5" r="8.5"></circle>
15
                <circle id="Coin" fill="#9F9F9F" sketch:type="MSShapeGroup" cx="9.5" cy="9.5" r="9.5"></circle>
16
            </g>
17
        </g>
18
    </svg>
19
 
20
      <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js"></script>
21
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
 
CSS
.svg{
1
.svg{
2
  display:block;
3
  margin:0 auto;
4
  margin-top:10%;
5
  visibility:hidden;
6
  padding:2%;
7
}
 
JavaScript
var main_tl = new TimelineMax({repeat: -1});
1
var main_tl = new TimelineMax({repeat: -1});
2
 
3
main_tl.from('svg', 1, {autoAlpha: 0})
4
  .add(animationOne())
5
 
6
  function animationOne() {
7
    
8
    var pathFirst = [{x:0, y:0}, {x:145, y:9 }];
9
    var path1 = [{x:0, y:0}, {x:145, y:9 }, {x:34, y:57}, {x:0, y:0}];
10
    var path2 = [{x:0, y:0}, {x:145, y:9 }, {x:34, y:57}, {x:0, y:0}, {x:34, y:57}, {x:34, y:217}, {x:145, y:9 } ];
11
    
12
    var tl = new TimelineMax();
13
    tl.from( "#A", 1, { opacity:0, ease:Power3.easeOut }, "first" )
14
    .from( "#B", 1, { opacity:0, ease:Power3.easeOut}, "second" )
15
    .from( "#a", 0.5, { opacity:0, ease:Power3.easeOut }, "third" )
16
    .from( "#Coin", 0.01, { opacity:0, ease:Power3.easeOut }, "fourth" )
17
    .to( "#Coin", 1, {bezier:{curviness:0.0, values: pathFirst} }, "fifth" )
18
    .to("#Coin", 0.1, { opacity:0, ease:Power3.easeOut }, "#six")
19
    .to( "#Coin", 0.01, { opacity:0, x:0, y:0 }, "six" )
20
    .add("six", "-=0.5")
21
    .from( "#C", 1, { opacity:0, ease:Power3.easeOut }, "six" )
22
    .from( "#b", 0.5, { opacity:0, ease:Power3.easeOut }, "seven" )
23
    .from( "#c", 0.5, { opacity:0, ease:Power3.easeOut }, "eight" )
24
    .to( "#Coin", 0.01, { opacity:1, ease:Power3.easeOut }, "nine" )
25
    .to( "#Coin", 2, {bezier:{curviness:0.0, values: path1} }, "nine" )
26
    .to( "#Coin", 0.01, { opacity:0 }, "tenOne" )
27
    .add("tenTwo", "-=1")
28
    .from( "#D", 1, { opacity:0, ease:Power3.easeOut }, "tenTwo" )
29
    .from( "#d", 0.5, { opacity:0, ease:Power3.easeOut }, "eleven" )
30
    .from( "#e", 0.5, { opacity:0, ease:Power3.easeOut }, "twelve" )
31
    .to( "#Coin", 0.01, { opacity:1 }, "twelwe" )
32
    .to( "#Coin", 3, {bezier:{curviness:0.0, values: path2}, ease:Power0.easeNone,}, "thirteenth" )
33
 
34
    return tl;
35
  }
 

Sample

CSSDeck G+