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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.

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.


  <button class="js-play">Play</button>
  <button class="js-pause">Pause</button>
  <button class="js-restart">Restart</button>

  <button class="js-seek-green">Seek Green</button>
  <button class="js-seek-cyan">Seek Cyan</button><button class="js-seek-yellow">Seek Yellow</button>

  <div class="ball"></div>

  <li>The ball should start NOT rotating</li>
  <li>When the ball turns green and translates 100px in X, it should start rotating</li>
  <li>There are some other translate keyframes after that</li>


                body {

.ball {
  width: 100px;
  height: 75px;
  background: #ff0000;
  border-radius: 50%;


                'use strict';

let tl = new TimelineMax({
  delay: 0.5

let ballNode = $('.ball');

// Set up the infinite rotating timeline
let alwaysRotateTl = new TimelineMax({repeat: -1});
alwaysRotateTl.fromTo(ballNode, 2, { rotation: 0}, {rotation: 360, ease: Linear.easeNone});

// Now do some stuff on the main timeline
  .set(ballNode, {backgroundColor: '#ff0000'}, 0)
  .to(ballNode, 2, {x: 100, backgroundColor: '#00ff00'}, 'green-label')
  .to(ballNode, 2, {y: 100, backgroundColor: '#00ffff'}, 'cyan-label')
  .add('yellow-label', tl.recent().endTime()) //find end of most recently added tween
  .to(ballNode, 2, {x: 0, backgroundColor: '#ffff00'}, 'yellow-label')
  .to(ballNode, 1, {scale:0.5, backgroundColor:'#f60'}, tl.recent().endTime())//add another tween after the most recently added tween
  .to(ballNode, 1, {scale:2, backgroundColor:'#000'}, tl.recent().endTime() + 2)//add another tween 2 seconds aafter the most recently added tween ends

$('.js-play').on('click', function() {;

$('.js-pause').on('click', function() {

$('.js-restart').on('click', function() {

$('.js-seek-green').on('click', function() {'green-label');

$('.js-seek-cyan').on('click', function() {'cyan-label');

$('.js-seek-yellow').on('click', function() {'yellow-label');