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


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.


                <h1>Demo 4: Synchronising Playback with the Scrollbar</h1>

<p>A responsive sprite animation that is synchronised with the scrollbar, and that remains in a fixed position for its duration of 1500 pixels. Scroll up and down to control playback.</p>

<div class="container" id="js-pinned">
  <div class="cnc" id="js-animation"></div>

<p class="p">Demo by Tom Bennet. <a href="" target="_blank">See article</a>.</p>


                body {
  padding: 20px;
  text-align: center;

.container {
  font-size: 15em;
  min-height: 110vh;

.cnc {
  margin: auto;
  width: 1em;
  height: 1em;
  background:  url('') no-repeat 0 0%;
  background-size: 100%;

h1 {
  font-size: 1.2em;

p {
  width: 60%;
  margin: auto;
  text-align: left;

.p {
  margin-top: 120px;
  font-size: 14px;
  text-align: center;


                // initialise ScrollMagic controller
var controller = new ScrollMagic.Controller();

// create Tween
var tween ="#js-animation", 1.0, {
	backgroundPosition: "0 100%", 
	ease: SteppedEase.config(31)

// build scene
var scene = new ScrollMagic.Scene({duration: 1500})