Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                const frame = new Frame("fit", 1024, 768, black, 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
	let stage = frame.stage;
	let stageW = frame.width;
	let stageH = frame.height;

	// REFERENCES for ZIM at http://zimjs.com
	// see http://zimjs.com/learn.html for video and code tutorials
	// see http://zimjs.com/docs.html for documentation
	// see https://www.youtube.com/watch?v=pUjHFptXspM for INTRO to ZIM
	// see https://www.youtube.com/watch?v=v7OT0YrDWiY for INTRO to CODE

	// CODE HERE
	
	// this shape was discovered for https://opartica.com - and was my fave!
	
	// used as a background color and a mask to hide edges of squiggly Blobs
	const mask = new Circle(500, green, black, 2)
		.center()
		.animate({
			wait:5000,
			props:{color:orange},
			time:1000,
			rewind:true,
			rewindWait:5000,
			loop:true,
			loopWait:5000
		});

	// add all blobs to two containers and rotate them opposite directions
	const one = new Container(stageW, stageH)
		.centerReg()
		.setMask(mask)
		.animate({props:{rotation:360}, ease:"linear", time:60000, loop:true});
	const two = new Container(stageW, stageH)
		.sca(-1,1)
		.centerReg()
		.setMask(mask)
		.animate({props:{rotation:-360}, ease:"linear", time:60000, loop:true});

	// here we add the blobs
	// the initial blob points were created here in a few minutes 
	// https://zimjs.com/nio/paths.html
	loop(24, i=>{
		let b = new Blob({
			interactive:false,
			color:black,
			points:[[0,-100,0,0,0,0,0,0,"none"],[-30.7,1.9,0,0,-6.5,-25.5,6.5,25.5],[37.3,57.6,0,0,-1,-21.9,1,21.9,"mirror"],[-27.1,116.2,0,0,-1.1,-23.4,1.1,23.4],[-1.1,150.6,0,0,0,0,0,0,"none"],[-47.7,151.7,0,0,0,0,0,0,"none"],[-56.1,115.1,0,0,0.1,28.6,-0.1,-28.6],[14.3,58.7,0,0,0,25,0,-25,"mirror"],[-42.1,2.8,0,0,5.8,26.7,-5.8,-26.7]]
		})
			.sca(2)
			.reg(0,-100) // putting the reg on the tip of the blob
			.loc(stageW/2, stageH/2, one)
			.rot(i*360/24);
		b.clone().addTo(two); // clone the first and put in in two
	});
	// optionally cache - will help performance on slower machines
	// note, the Blobs are larger than the stage so adjust...
	one.cache(-stageW*.5,-stageH*.5,stageW*2, stageH*2);
	two.cache(-stageW*.5,-stageH*.5,stageW*2, stageH*2);
	
	// new Circle(20).center()
   
	// DOCS FOR ITEMS USED
	// https://zimjs.com/docs.html?item=Frame
	// https://zimjs.com/docs.html?item=Container
	// https://zimjs.com/docs.html?item=Circle
	// https://zimjs.com/docs.html?item=Blob
	// https://zimjs.com/docs.html?item=animate
	// https://zimjs.com/docs.html?item=loop
	// https://zimjs.com/docs.html?item=loc
	// https://zimjs.com/docs.html?item=mov
	// https://zimjs.com/docs.html?item=alp
	// https://zimjs.com/docs.html?item=rot
	// https://zimjs.com/docs.html?item=reg
	// https://zimjs.com/docs.html?item=sca
	// https://zimjs.com/docs.html?item=addTo
	// https://zimjs.com/docs.html?item=centerReg
	// https://zimjs.com/docs.html?item=center
	// https://zimjs.com/docs.html?item=setMask
	// https://zimjs.com/docs.html?item=zog


	// FOOTER
	// call remote script to make ZIM Foundation for Creative Coding icon
	createIcon(null,null,(icon)=>{
		icon.sca(.7).mov(40,10)
	}); 
	createGreet()
		.alp(0)
		.animate({
			props:{alpha:1},
			wait:2000,
			rewindWait:2000,
			rewind:true
		}); 
}); // end of ready
              
            
!
999px

Console