Pen Settings



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


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.


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.






                const frame = new Frame("outside", 1280, 720, black);
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
	const stage = frame.stage;
	const stageW = frame.width;
	const stageH = frame.height;

	// see for an intro example
	// see for video and code tutorials
	// see for documentation
	// see for ZIM on CodePen

	// comparison to the cool Splat example 
	// the GSAP code is at the bottom with some comments
	// thanks Carl and GSAP for the original post
	// not exactly the same but the systems are a little different

	// could store circles in Array but on canvas usually we use a Container
    const circles = new Container(stageW, stageH).addTo();
    loop(400, () => {
        // ZIM VEE (Pick) values give us dynamic parameters in many places in ZIM
        // passing in {min:val, max:val} gives range between
        // in this case in a loop we could just use rand(10)
        // passing in array randomly picks from array
        // in this case in a loop we could just use shuffle([etc.])[0]
        // but ZIM VEE is handy for when not in a loop
        // such as passing a time into an interval, objects into Tile or Emitter, etc.
        // can also use a series(pink,green,blue,yellow,purple) to pick colors in order
        // can also use a function that returns a value 
        new Circle({max:10}, [pink,green,blue,yellow,purple], dark).center(circles);

            y:{min:0, max:stageH}, // ZIM VEE (Pick) values that get reset each loop
            x:{min:0, max:stageW},
        time:{min:500, max:700},
        sequence:0, // operate on each child of Container - 0 for at same time
        loopPick:true, // pick from ZIM VEE (Pick) values each loop
        ease:"quartOut", // try "quartInOut"
    interval([800,900], ()=>pauseAnimate(false), null, null, true); // sync the animates and pause on blur

	// I think the clumping with quartOut is because the pause activates before reaching its original position
	// whereas the quartInOut seems to make it back to its starting position... strange - but I like it better

	// GSAP and Carl
	// for (let i = 0; i < 400; i++){
	// 	let circle = new Circle(Math.random() * 10, "#FFCC32").center()
	// 	circles.push(circle)
	// }
	// gsap.ticker.add(function(){
	// 	stage.update()
	// })
	//, {
	//    scale:3,
	//    duration:function(){return Math.random()-0.5},
	//    x:"random(0, 1280)",
	//    y:"random(0, 720)",
	//    repeat:-1,
	//    yoyo:true,
	//    repeatRefresh:true,
	//    ease:"power4"
	// })	

	stage.update(); // this is needed to show any changes


}); // end of ready