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="wrapper">
			<ul id="logo">
		  		<li class="blue" id="js_blueRing"></li>
		  		<li class="blue alt" id="js_blueRingAlt"></li>
		  		<li class="yellow" id="js_yellowRing"></li>
		  		<li class="yellow alt" id="js_yellowRingAlt"></li>
		  		<li class="black" id="js_blackRing"></li>
		  		<li class="green" id="js_greenRing"></li>
		  		<li class="green alt" id="js_greenRingAlt"></li>
		  		<li class="red" id="js_redRing"></li>
		  		<li class="red alt" id="js_redRingAlt"></li>
			</ul>
      <button id="btn-replay">replay</button>
		</div><!--wrapper-->
            
          
!
            
                  #logo {
      list-style: none;
      font-size: 1em;
      margin: 0;
      padding: 0;
      width: 42em;
      height: 21em;
      position: relative;
      margin:0 auto;
    }
    
    #logo li {
      margin-top: 1em;
      margin-left: 1em;
    }
    
    #logo li, #logo li:before, #logo li:after {
      -webkit-border-radius: 6em;
      -moz-border-radius: 6em;
      border-radius: 6em;
      position: absolute;
    }
    
    #logo li {
      -webkit-border-radius: 6.2em;
      -moz-border-radius: 6.2em;
      border-radius: 6.2em;
    }
    
    #logo li:before {
      -webkit-border-radius: 4.9em;
      -moz-border-radius: 4.9em;
      border-radius: 4.9em;
    }
    
    #logo li {
      width: 12em;
      height: 12em;
      border: solid 0.40em white;
      left: 0;
      top: 0;
      font-size: 1em;
    }
  
    
    #logo li:before {
      display: block;
      content: "";
      top: 1.1em;
      left: 1.1em;
      bottom: 1.1em;
      right: 1.1em;
      border: solid 0.55em white;
    }
    
    #logo li:before, x:-moz-any-link, x:default  {
      border: solid 0.45em white;
    }
    
    #logo li:after {
      display: block;
      content: "";
      top: -0.1em;
      left: -0.1em;
      right: -0.1em;
      bottom: -0.1em;
      border: solid 1.4em black;
    }
    /*  */
    #logo .blue   { z-index: 10; left: 0;     top: 0; }
    #logo .yellow { z-index: 20; left: 6.8em; top: 5.7em; }
    #logo .black  { z-index: 21; left: 13.6em; top: 0; }
    #logo .green  { z-index: 20; left: 20.4em; top: 5.7em; }
    #logo .red    { z-index: 10; left: 27.2em; top: 0px; }
    
    /*  */
    #logo .blue:after   { border-color: #0085c7; }   
    #logo .yellow:after { border-color: #f4c300; } 
    #logo .black:after  { border-color: #000000; }
    #logo .green:after  { border-color: #009f3d; } 
    #logo .red:after    { border-color: #df0024; }
    
    #logo .blue.alt { z-index: 24; }
    #logo .blue.alt, 
    #logo .blue.alt:before, 
    #logo .blue.alt:after {
      border-top-color: transparent;
      border-left-color: transparent;
      border-bottom-color: transparent;
    }
    
    #logo .yellow.alt { z-index: 23; }
    #logo .yellow.alt, 
    #logo .yellow.alt:before, 
    #logo .yellow.alt:after {
      border-right-color: transparent;
      border-left-color: transparent;
      border-bottom-color: transparent;
    }    
    
    #logo .green.alt { z-index: 23; }
    #logo .green.alt,
    #logo .green.alt:before,
    #logo .green.alt:after {
      border-top-color: transparent;
      border-right-color: transparent;
      border-bottom-color: transparent;
    }
    
    #logo .red.alt { z-index: 23; }
    #logo .red.alt, 
    #logo .red.alt:before,
    #logo .red.alt:after {
      border-top-color: transparent;
      border-right-color: transparent;
      border-left-color: transparent;
    }

  #logo .blue.alt,
  #logo .yellow.alt,
  #logo .green.alt,
  #logo .red.alt{
    opacity:0;
  }

  /*wrapper positions the elements to the middle of the screen*/
  .wrapper{
    position: absolute;
    transform: translate(-50%,-50%);
    top: 50%;
    left: 50%;
  }

/*button*/
  #btn-replay{
    width: auto;
    display: block;
    background-color:#8a1844;
    border:2px solid #8a1844;
    box-sizing:border-box;
    padding:0.5em 1em;
    color: #FFF;
    cursor: pointer;
    margin: 0 auto;
    transition:0.3s;
    border-radius:0.25em;
  }

  #btn-replay:hover, #btn-replay:focus, #btn-replay:active{
    color: #8a1844;
    background-color:#FFF;
  }
            
          
!
            
              $(document).ready(function(){

//variables for the rings
  var blueRing = $('#js_blueRing');
  var blueRingAlt = $('#js_blueRingAlt');

  var yellowRing = $('#js_yellowRing');
  var yellowRingAlt = $('#js_yellowRingAlt');

  var blackRing = $('#js_blackRing');

  var greenRing = $('#js_greenRing');
  var greenRingAlt = $('#js_greenRingAlt');

  var redRing = $('#js_redRing');
  var redRingAlt = $('#js_redRingAlt');

function runit(){
  //create a new timeline
 var tl = new TimelineLite();
//animate
  tl
    .from(blueRing, 2, {y:-400, opacity:0, ease: Power4.easeIn}) 
    .add('ringyellow')
    .to(blueRing, 0.667, {transformOrigin: "50% 100%", scaleY:0.5, yoyo:true, repeat:1})
    .add('ringblack')
    .add('ringgreen')
    .add('ringred')
    .to(blueRing, 1.667, {y:-200, ease:Circ.easeOut, yoyo:true, repeat:1})
    .to(blueRing, 1, {transformOrigin: "50% 100%", scaleY:0.75, yoyo:true, repeat:1})

    //show the overlapping part of the blue ring
    .to(blueRingAlt, 0.6, {opacity:1})

    //yellow ring
    .from(yellowRing, 2, {y:-400, opacity:0, ease: Power4.easeIn}, 'ringyellow')
    .to(yellowRing, 0.667, {transformOrigin: "50% 100%", scaleY:0.5, yoyo:true, repeat:1}, 'ringyellow+=2')
    .to(yellowRing, 1.667, {y:-200, ease:Circ.easeOut, yoyo:true, repeat:1}, 'ringyellow+=3.334')
    .to(yellowRing, 1, {transformOrigin: "50% 100%", scaleY:0.75, yoyo:true, repeat:1}, 'ringyellow+=6.668')
    .to(yellowRingAlt, 0.6, {opacity:1}, 'ringyellow+=8.668')

    //black ring
    .from(blackRing, 2, {y:-400, opacity:0, ease: Power4.easeIn}, 'ringblack')
    .to(blackRing, 0.667, {transformOrigin: "50% 100%", scaleY:0.5, yoyo:true, repeat:1}, 'ringblack+=2')
    .to(blackRing, 1.667, {y:-200, ease:Circ.easeOut, yoyo:true, repeat:1}, 'ringblack+=3.334')
    .to(blackRing, 1, {transformOrigin: "50% 100%", scaleY:0.75, yoyo:true, repeat:1}, 'ringblack+=6.668')

    //green ring
    .from(greenRing, 2, {y:-400, opacity:0, ease: Power4.easeIn}, 'ringgreen+=0.667')
    .to(greenRing, 0.667, {transformOrigin: "50% 100%", scaleY:0.5, yoyo:true, repeat:1}, 'ringgreen+=2.667')
    .to(greenRing, 1.667, {y:-200, ease:Circ.easeOut, yoyo:true, repeat:1}, 'ringgreen+=4.001')
    .to(greenRing, 1, {transformOrigin: "50% 100%", scaleY:0.75, yoyo:true, repeat:1}, 'ringgreen+=7.335')
    .to(greenRingAlt, 0.6, {opacity:1}, 'ringgreen+=9.335')   

    //red ring
    .from(redRing, 2, {y:-400, opacity:0, ease: Power4.easeIn}, 'ringred+=1.334') 
    .to(redRing, 0.667, {transformOrigin: "50% 100%", scaleY:0.5, yoyo:true, repeat:1}, 'ringred+=3.334')
    .to(redRing, 1.667, {y:-200, ease:Circ.easeOut, yoyo:true, repeat:1}, 'ringred+=4.668')
    .to(redRing, 1, {transformOrigin: "50% 100%", scaleY:0.75, yoyo:true, repeat:1}, 'ringred+=8.002')
    .to(redRingAlt, 0.6, {opacity:1}, 'ringred+=10.002') 

  .timeScale(4);
  return tl;
  }
  
  var runAnimation = runit();

  $( "#btn-replay" ).click(function() {
    runAnimation.restart();
});

  $("#btn-replay").mouseup(function(){
    $(this).blur();
});
});
            
          
!
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