cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="container">
<svg class="lineSVG" version="1.1" x="0px" y="0px" width="900px" height="600px" viewBox="0 0 900 600">
<defs>

<filter id="glow" width="400%" x="-50%" y="-50%" height="200%">
    <feGaussianBlur stdDeviation="2 2" result="coloredBlur"/>
    <feMerge>
        <feMergeNode in="coloredBlur"/>
        <feMergeNode in="SourceGraphic"/>
    </feMerge>
</filter> 
<filter id="heavyGlow" width="400%" x="-50%" y="-50%" height="200%">
    <feGaussianBlur stdDeviation="9 9" result="coloredBlur"/>
    <feMerge>
        <feMergeNode in="coloredBlur"/>
        <feMergeNode in="SourceGraphic"/>
    </feMerge>
</filter> 
  
</defs>
<line class="loadLineGhost" fill="none" stroke="#1E1E24" stroke-width="2" stroke-linecap="none" stroke-linejoin="none" stroke-miterlimit="10" x1="100" y1="340" x2="800" y2="340" opacity="0" />
  

  
<line class="loadLineTip" filter="url(#heavyGlow)" fill="none" stroke="#5CE2ED" stroke-width="2" stroke-linecap="none" stroke-linejoin="none" stroke-miterlimit="10" x1="100" y1="340" x2="800" y2="340" />
    
<g class="lineGroup" filter="url(#glow)" >
<line class="loadLine" fill="none" stroke="#5CE2ED" stroke-width="2" stroke-linecap="none" stroke-linejoin="none" stroke-miterlimit="10" x1="100" y1="340" x2="800" y2="340" />

<g class="refreshGroup" >
	
<path class="tick" fill="none" stroke="#5CE2ED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
	M53.5,11.4l-24,32.1l-14-9"/>
	
		<circle class="refreshCircle" fill="rgba(0,0,0,0)" stroke="#5CE2ED" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="30" cy="30" r="30"/>
</g>    
  </g>

</svg>
  <div class="downloading">Downloading</div> 
  <div class="refresh">Success!</div> 
</div>

            
          
!
            
              body{
  background-color:#35353F;
  overflow:hidden;
}
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}
html{
  font-family: 'Droid Sans', sans-serif;
}

.container{
  width:900px;
  height:600px;
}
svg{
  width:900px;
  height:600px;
}

.refreshCircle{
  cursor:pointer;
}
.downloading, .refresh{
  position:absolute;
  
  top:420px;
  text-align:center;
  width:900px;
  color:#ededed;
  font-size:15px;
}

.refresh{
  opacity:0;
  top:410px;
}

            
          
!
            
              var container = document.querySelector('.container');
var lineSVG = document.querySelector('.lineSVG');
var downloading = document.querySelector('.downloading');
var refresh = document.querySelector('.refresh');
var loadLine = document.querySelector('.loadLine');
var loadLineTip = document.querySelector('.loadLineTip');
var loadLineGhost = document.querySelector('.loadLineGhost');
var refreshCircle = document.querySelector('.refreshCircle');
var tick = document.querySelector('.tick');
var refreshGroup = document.querySelector('.refreshGroup');
var failAt = 100; //percent
var glowTipLengthPercent = 5;
var lineStart = Number(loadLine.getAttribute('x1'));
var lineEnd = Number(loadLine.getAttribute('x2'));
var lineLength =  lineEnd -  lineStart;
var failPercent = failAt/100; //percent
var refreshCircleRadius = Number(refreshCircle.getAttribute('r'));
var refreshCircleRadiusAsPercentOfLine = (refreshCircleRadius/lineLength) * 100;

TweenMax.set(container, {
		position: 'absolute',
		top: '50%',
		left: '50%',
		xPercent: -50,
		yPercent: -50
})

TweenMax.set([loadLine, loadLineTip], {
  drawSVG:'-0.5% 0%'
})

TweenMax.set([tick], {
  drawSVG:'0% 0%',
  alpha:0
})
TweenMax.set([refreshCircle], {
  drawSVG:'0% 0%',
  alpha:0
})
TweenMax.set([refreshGroup], {
  y:310
})

var tl = new TimelineMax({onComplete:playAgain});
tl.set(refreshGroup, {
  alpha:1,
  x:(failPercent * lineLength) + lineStart - (refreshCircleRadius*2)
})

.to(loadLineGhost, 1,{
  alpha:0.5
})
.to([loadLine,], 6, {
  drawSVG:failAt +'% 0%',
  ease:SteppedEase.config(40)
})

.to([loadLineTip,], 6, {
  drawSVG:failAt +'% ' + (failAt - glowTipLengthPercent)+'%',
  ease:SteppedEase.config(40)
},'-=6')
.from([loadLine, loadLineTip], 0.1,{
  immediateRender:false,
  stroke:'green',
  repeat:12, 
  yoyo:true
})
  
.set([ refreshCircle], {
  alpha:1
})
.to(loadLineTip, 1, {
  drawSVG:(failAt)+'% ' + (failAt)+'%'
})


 .to([ refreshCircle], 1, {
  drawSVG:'0% 88%'
},'-=1')
.to([loadLine, loadLineTip], 1, {
  drawSVG:(failAt)+'% ' + (failAt)+'%'
},'-=1')
.set([ tick], {
  alpha:1
})

.to([ tick], 1, {
  drawSVG:'95% 0%'
})

.to(refreshGroup, 2, {
  x:(lineLength/2) + (lineStart - (refreshCircleRadius)),
  rotation:-360,
  transformOrigin:'50% 50%',
  ease:Power3.easeInOut
}, '-=1')
.to([ refreshCircle], 1, {
  drawSVG:'0% 100%'
},'-=2')
.to([ tick], 1, {
  drawSVG:'95% 20%'
},'-=2')
.set([loadLine, loadLineTip], {
  alpha:0
})



.to(loadLineGhost, 2, {
  alpha:0,
  ease:Power3.easeInOut
}, '-=2')
.to(refresh, 0.5, {
  alpha:1,
  ease:Power2.easeInOut
})
.to(downloading, 0.5, {
  alpha:0,
  ease:Power2.easeInOut
},'-=0.5')
.to([downloading, refresh], 0.5, {
  top:'+=10',
  ease:Power2.easeInOut
}, '-=0.5')

.addPause()

.to(refreshGroup,0.3, {
  alpha:0
})
.to(refresh, 0.5, {
  alpha:0,
  ease:Power2.easeInOut
})
.to(downloading, 0.5, {
  alpha:1,
  ease:Power2.easeInOut
},'-=0.5')
.to([downloading, refresh], 0.5, {
  top:'-=10',
  ease:Power2.easeInOut
}, '-=0.5')

//end timeline

refreshCircle.onclick = fadeOut;

function fadeOut(){
  tl.resume();
}
function playAgain(){

  tl.play(0, true);

}


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console