Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div id="box1"></div>
<div id="box2"></div>
              
            
!

CSS

              
                #box1 {
  background-color: red;
  width: 20px;
  height: 20px;
}
#box2 {
  background-color: blue;
  width: 20px;
  height: 20px;
}
              
            
!

JS

              
                var tl_A = gsap.timeline();
var tl_B = gsap.timeline();

// User A gives me a timeline, but I don't know what is inside. I just know its TotalDuration
tl_A.to('#box1', { x: 100, duration: 2, ease: "linear" });
tl_A.to('#box1', { rotation: "360deg", duration: 2, ease: "linear" });
tl_A.to('#box1', { x: 200, duration: 2, ease: "linear" });
tl_A.to('#box1', { backgroundColor: "green", duration: 1, ease: "linear" });
tl_A.to('#box1', { x: 300, duration: 2, ease: "linear" });

// User B gives me its own timeline, telling me that what is after ToEnd label as to run at the end of the tl_A and finish exactly when it finishes
tl_B.addLabel("Start_at_the_same_time_than_tl_A");
tl_B.to('#box2', { scale: 2, duration: 2, ease: "linear" });
tl_B.addLabel("Fellowing_have_to_finish_exactly_when_tl_A_finished");
tl_B.to('#box2', { scale: 1, duration: 2, ease: "linear" });
tl_B.to('#box2', { backgroundColor: "pink", duration: 1, ease: "linear" });
              
            
!
999px

Console