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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              // ZIM is a JavaScript Canvas Framework for coding creativity!
// - please visit to start a wonderful coding journey.
// The main site has banner sections of TEN excellent uses of ZIM.

// ZIM provides many conveniences, components and controls 
// to help designers, developers and artists create interactive media 
// - why ZIM, features, applications
// - expand open any feature for info and examples

// Here are CodePen examples with comments for learning:
// - ZIM CodePen
// - ZIM Founder's CodePen

// There are also many tutorials, videos and references here:
// - ZIM Skool, ZIM Kids, ZIM Badges, etc.
// - ZIM Template, tools and more
// - join us on *** Slack *** for discussion and support

// -----------------

// ZIM is powered by CreateJS so we import CreateJS and ZIM in CodePen settings
// We make a Frame object which makes a stage on an HTML canvas 
// We then add objects to the stage and update the stage to see them 
const frame = new Frame("fit", 1024, 768, orange, darker); // see docs for other options
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;

	// Make a path for the create ghoul to animate along 
	// The path is editable and the animation still follows
	// See for the ZIM NIO (9) min-site 
	// with examples of animating and dragging along paths
	// also see a space game:
	// and an SVG path example:

	const path = new Squiggle({
		onTop:false, // so does not come to top (above ghoul) when editing 
		showControls:false, // start with no controls showing
		allowToggle:false, // do not do usual toggle of controls off and on
		editPoints:false, // do not allow user to add or remove points - optional
		// recorded points with keypress below
		// expand open to see the point data

	const ball = new Circle(10).rot(-90).addTo().animate({
		// animate along path 
		// zoom from 0-10 times the size from stage top to bottom 
		// decrease the speed the higher up (farther away)
		// see docs for more options
		props:{path:path, zoom:[0,12], speed:[50,100]},
	const emitter = new Emitter({
		obj:new Circle(10),
		num:mobile()?1:4, // reduce particles for mobile
		// ball is scaling so need to scale individual particles to match ball
		random:{scale:function(){return ball.scale*rand(.5,.9)}},
		// emit in direction of ball - optional (want tail to start up which is -90)
		angle:function(){return ball.rotation-90+rand(-20,20)}
	}).loc(ball).ord(-1); // under ball
	// could put emitter with its particles in ball but then all particles move with ball
	// as of ZIM 9.5.0 emitter is separate from its particles 
	// so just move emitter and leave particles alone to get proper effect
	new Label({

	// This records and shows the path if desired
	// You can also let the user's path be stored
	// with a ZIM TransformManager()
	frame.on("keydown", e=>{
		// zog(e.keyCode) // uncomment this to see keyCode of keys
		if (e.keyCode == 82) { // R
			path.recordPoints(true); // true pops up window with data

	// Optional use of ZIM STYLE
	// Any time we use series,
	// it might have been easier to use arguments
	// when making the object
	STYLE = {
				// first made gets edit, second gets hide
				label:series("edit", "hide"), 
				x:series(30, 150),
				text:series("SMALL", "BIG"),
				x:series(40, 915),
				y:series(40, 690),
				size:series(20, 40),

	// we have abstracted the styles to STYLE
	// but we could have added them directly to the components
	// which might have been more clear due to all the series
	new CheckBox().change(e=>{
	new CheckBox().change(e=>{
		path.visible = !;
	new Label();
	new Label();
	// call remote script to make ZIM Foundation for Creative Coding icon and a greet link

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


}); // end of ready
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.