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 is required to process package imports. If you need a different preprocessor remove all packages first.

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


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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.






                const frame = new Frame("fit", 400, 300, darker, dark);
frame.on("ready", ()=>{ // ES6 Arrow Function - similar to function(){}
    zog("ready from ZIM Frame"); // logs in console (F12 - choose console)

    // often need below - so consider it part of the template
    let stage = frame.stage;
    let stageW = frame.width;
    let stageH = frame.height;

    // REFERENCES for ZIM at
    // see for video and code tutorials
    // see for documentation
    // see for INTRO to ZIM
    // see for INTRO to CODE

    // CODE HERE
	 // Thanks for the elegant drag on path formula 
	 // we have installed it in the new ZIM 10.3.0 and works better than what we had!
	 // It feels wrong to compare... but ZIM is 46% the size of the Paper version 
	 // ZIM itself will be bigger as it contains the dragging on path code
	 // but it is nicely abstracted so you don't have to think about it...
    const path = new Squiggle({

    // using percentComplete works on the current animation only
    // so if planning on doing more than one animation, 
	 // add the object to a container and animate the container and object separately
    const circle = new Container();
    const circleShape = new Circle(6, green).addTo(circle);
		 		// setting drag pauses the animation 
		 		// but could circle.pauseAnimate(false) to drag while animating
            ease:"linear", // important for dragging on path
            rewind:true, // rewind allows us to animate backwards at the end
            loop:true, // animation would end (no drag) once rewound if not a loop
                circle.percentComplete = .01;
    circle.blendMode = "difference";

    const ticker = Ticker.add(()=>{
        if (circle.percentComplete > 49.9) { // half way through - due to rewind
            circleShape.animate([ // animation series in array
                {props:{scale:30}, time:1000, call:()=>{circle.pauseAnimate(false);}},
                {props:{scale:1}, time:3000}
    stage.update(); // this is needed to show any changes

}); // end of ready