Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <svg version="1.1" id="ball" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<path fill="none" stroke="#000000" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
	M248.7,128c0,66.6-54,120.7-120.7,120.7S7.3,194.6,7.3,128S61.4,7.3,128,7.3S248.7,61.3,248.7,128z"/>
<path fill="none" stroke="#000000" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
	M57.4,222.4c3.7-4.1,3.3-3.1,6.4-7.8 M78.4,189.9c1.4-3,1.9-4.2,3.1-7.3 M90.1,148.6c0.7-4.4,0.8-6.7,1.1-11.3 M87.3,92
	c-1.2-4.8-2.5-9.5-4.1-14.1 M64.7,42.6c-2.9-3.9-6-7.6-9.2-11.1 M181.6,199.1c1.7,3.2,3.3,5.5,5.2,8.5 M167.9,163.1
	c0.8,3.3,1.2,4.9,2.1,8.1 M165.1,108.4c-0.7,5.1-1,9.1-1.1,14.3 M183.9,52.8c-2.1,3.6-4.1,7.2-5.9,11.1"/>
<path fill="none" stroke="#000000" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
	M68.5,207.6c1.9-3,3.6-5.3,5.2-8.5 M85.3,171.3c1-3.2,1.4-4.8,2.1-8.1 M91.4,122.8c-0.2-5.2-0.5-9.3-1.1-14.3 M77.4,63.9
	c-1.8-3.8-3.8-7.5-5.9-11.1 M191.5,214.5c3.1,4.7,2.8,3.7,6.4,7.8 M173.9,182.5c1.2,3.1,1.7,4.3,3.1,7.3 M164.2,137.4
	c0.3,4.6,0.4,6.8,1.1,11.3 M172.2,77.9c-1.6,4.6-3,9.3-4.1,14.1 M199.9,31.5c-3.3,3.5-6.3,7.2-9.2,11.1"/>
</svg>
<div class="info"></div>
<div class="controls">
  <button id="start">Play</button>
  <div class="checkbox-holder">
    <input type="checkbox" name="speedUp" id="speedUp">
    <label for="speedUp">Speed up?</label>
  </div>
</div>

              
            
!

CSS

              
                body, document
  font-family: verdana,arial
  color: #333
button, .checkbox-holder
  display: inline-block
.info
  margin: 10px 0
button
  font-size: 14px
  padding: 8px 20px
  background: #1c75bc
  border: none
  border-radius: 10px
  color: white
              
            
!

JS

              
                var tl = new TimelineMax({paused: true}),
    speedUp = false;

tl.to('#ball', 0.75, {css:{directionalRotation:"360_cw"},repeat: 15, ease: Linear.easeNone});

function playBall() {
  if(speedUp) {
    TweenMax.fromTo(tl,tl.duration(),{timeScale:0.1},{timeScale:4});
  } else {
    TweenMax.fromTo(tl,tl.duration(),{timeScale:4},{timeScale:0.1});
  }
  tl.seek(0);
  tl.play();
}


$('button#start').on("click", function(){
  speedUp = $('#speedUp:checked').length == 1 ? true : false;
  if(speedUp) {
    $('.info').html('Speeding up');
  } else {
    $('.info').html('Slowing down');
  }
  playBall();
});
              
            
!
999px

Console