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("fit", 1024, 768, darker, darker);
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
	// Thanks Natasya Hopkins for the original post: Proximity Effect with GSAP
	// it is well coded at
	// This code is 2637 characters using HTML, CSS, JS and GreenSock GSAP

	// The ZIM code is 582 characters (782 with the ZIM template)
	// Which is 22% the size the developer would code - and we think more readable

    // CODE HERE
	const colors = [orange, red, purple, pink, blue, green];
	const scales = [.8,1.7,.8,1.5,.8,1.5];
	const locs = [{x:175,y:476},{x:287,y:209},{x:648,y:209},{x:796,y:295},{x:731,y:524},{x:344,y:564}];
	const rectangles = new Container().addTo();
	loop(6, i=>{
		let rect = new Rectangle(176,98,colors[i])
			.centerReg(rectangles) // so they scale from the center
			// .place(); // used place to position and look at console for x,y
		rect.pd = new ProportionDamp(0,400,1.25,1); // baseMin, baseMax, targetMin, targetMax
		// to stop the boxes animating at start 
		// an immediate value would need to be added to pd
		// as currently they damp to 0,0 of mouse starting position
		// but I liked the initial animation
		// rect.pd.immediate(dist(rect.x, rect.y, 0, 0));
			let d = dist(rect.x, rect.y, frame.mouseX, frame.mouseY);
			// the objects are scaled already 
			// so multiply the conversion by the original scale
			rect.scale = scales[i]*rect.pd.convert(d);
    // FOOTER
    // call remote script to make ZIM Foundation for Creative Coding icon

}); // end of ready