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.

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", 1200, 675, darker, 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
    // see for video and code tutorials
    // see for documentation
    // see for INTRO to ZIM
    // see for INTRO to CODE

    // CODE HERE
		// made at
		const points = [[-7,-149.4,0,0,-15.1,33.1,12.4,30.9,"free"],[48.5,-73.4,0,0,0,0,0,0,"none"],[19.8,-75.2,0,0,17.6,6.4,12,30.7,"free"],[81.6,-5.4,0,0,0,0,0,0,"none"],[40,-11.2,0,0,21.2,7.8,10.1,32.2,"free"],[112,57.8,0,0,0,0,0,0,"none"],[57.5,56.2,0,0,31.5,7.5,20.5,38.9,"free"],[133.4,119.6,0,0,0,0,0,0,"mirror"],[18.2,120.8,0,0,39.9,15.4,-0.9,0.9,"free"],[19.5,153.9,0,0,0,0,0,0,"none"],[-25.6,153.7,0,0,0,0,0,0,"none"],[-24.4,123,0,0,0,-0.9,-40.8,10.9,"free"],[-132.7,122,0,0,0,0,0,0,"mirror"],[-67.2,57.5,0,0,-24.6,44.4,-35.2,10.9,"free"],[-122.7,57.8,0,0,0,0,0,0,"none"],[-50.7,-8.3,0,0,-12.7,36.8,-20.6,9.7,"free"],[-102.1,-2.7,0,0,0,0,0,0,"none"],[-33.1,-76.5,0,0,-14.5,32.4,-15.6,7.8,"free"],[-67.2,-69.3,0,0,0,0,0,0,"none"]];

		// a function to make and animate a light
		const colors = [red, green, blue, pink, yellow];
		function makeLight() {
			let light = new Container();
			new Circle(5, colors)
			new Circle(rand(5,30), clear, colors)
			return light;

		// the shape for the lights to follow
		const tree = new Blob({
		}).transformPoints("scale", 4); // make it bigger than the original size

		// we are going to parallax the left and right tree - including the Beads, Dial and LabelOnArc objects in each
		const leftTree = new Container(stageW, stageH).addTo();

		// use the Beads object to set lights around tree path
		const lights1 = new Beads({
			startPercent:54, // not on the trunk of the tree
			endPercent:45, // wrap back around to 45 (path start is at top)
			clone:false, // to keep animate on each object
		}).center(leftTree).mov(-130, -310);

		// clone the second lights
		const rightTree = new Container(stageW, stageH).addTo().bot();
		const lights2 = lights1.clone().centerReg(rightTree).sca(-.8,.8).mov(220, -180)

		// add a Parallax object to control the motion of the trees based on mouseX and mouseY
		// y gets a factor of -1 as usually, a lower y lifts the view
		// but here we need to interact with the dials at top so make cursor at top, move scene upwards
		new Parallax([
			{obj:leftTree, prop:"x", propChange:150},
			{obj:leftTree, prop:"y", input:"mouseY", propChange:1000, factor:-1}, 
			{obj:rightTree, prop:"x", propChange:100},
			{obj:rightTree, prop:"y", input:"mouseY", propChange:800, factor:-1},
		], .02);

		// We will scale specific letters based on the Dial
		// a space in the front lets Dial at top set all letters back to scale
		const greet1 = new LabelOnArc(" HAPPY HOLIDAYS", 24, null, white, 70)
			.loc(lights1.path.pointCircles[0], null, leftTree)

		const greet2 = new LabelOnArc(" DAN ZEN AND ZIM", 20, null, white, 60)
			.loc(lights2.path.pointCircles[0], null, rightTree)

		STYLE = {
					backgroundColor:series(green, red), // alternate dial colors
					width:series(100,80), // alternate dial widths, etc.
					max:series(greet1.numLetters-1, greet2.numLetters-1),
		const dial1 = new Dial()
			.loc(greet1, null, leftTree)
			.change(()=>{; // set the last letter back to scale of 1
				// scale the letter that matches the Dial index
				// the labelLetter labels are held in labels array
				lastLetter1 = greet1.labels[dial1.currentValue].sca(2); 
		// start off with the first label as the lastLetter
		let lastLetter1 = greet1.labels[0];

		const dial2 = new Dial()
		.loc(greet2, null, rightTree)
			lastLetter2 = greet2.labels[dial2.currentValue].sca(2)
		let lastLetter2 = greet2.labels[0];

    stage.update(); // this is needed to show any changes
    // FOOTER
    // call remote script to make ZIM Foundation for Creative Coding icon

}); // end of ready