Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                import zim from "https://zimjs.org/cdn/00/zim";

// see https://zimjs.com
// and https://zimjs.com/learn
// and https://zimjs.com/docs

const frame = new Frame(FIT, 1024, 768, darker, dark);
frame.on("ready", () => {
    const stage = frame.stage;
	const stageW = frame.width;
	const stageH = frame.height;
   
    // put your code here
	
	// made a quick path here https://zimjs.com/paths and copied the point data
	const points = [[-41.1,165.4,0,0,-28.2,105.9,28.2,-105.9],[147.7,32.8,0,0,-57,18.7,120.9,-39.7,"straight"],[145,-141.5,0,0,105.2,26.4,-54.8,-13.8,"straight"],[21.3,-102.4,0,0,18,-31.7,-34.8,61.3],[114.7,-36.3,0,0,-72.1,13.1,72.1,-13.1],[426.1,-60.3,0,0,-94.8,-34.1,94.8,34.1]];
	
	const path = new Squiggle({
		points:points,
		interactive:false, // remove or set to true to allow user to change with path
		thickness:1,		
		color:grey
	})
		.transformPoints("scale", 1.8)
		.center();
	
	// emojis are different in different browsers 
	// on the PC we want to rotate the emoji 45 degrees to be straight on the path 
	// animate the container but rotate the object in the container
	let label;
	const plane = new Container()
		.addTo()
		.animate({
			time:4,
			props:{path:path},
			startPaused:false, // remove or set to true to not animate but only drag		
			drag:true, // optional
			call:()=>{
				label = new Label("drag plane", 30, null, yellow).pos(100, 0, RIGHT, CENTER);
			}
		});	
	new Emoji("✈️", 100)
		.centerReg(plane)
		.rot(45);
	
	// remove instructions if press on plane
	plane.on("mousedown", e=>{
		if (label) {
			label.removeFrom();
			e.remove(); // remove event
		}
	});
	
	frame.madeWith().pos(40,40,RIGHT,BOTTOM);
	
	  
    stage.update(); // needed to view changes
	
	// docs for items used
	// https://zimjs.com/docs.html?item=Frame
	// https://zimjs.com/docs.html?item=Container
	// https://zimjs.com/docs.html?item=Squiggle
	// https://zimjs.com/docs.html?item=Label
	// https://zimjs.com/docs.html?item=Emoji
	// https://zimjs.com/docs.html?item=animate
	// https://zimjs.com/docs.html?item=pos
	// https://zimjs.com/docs.html?item=rot
	// https://zimjs.com/docs.html?item=addTo
	// https://zimjs.com/docs.html?item=removeFrom
	// https://zimjs.com/docs.html?item=centerReg
	// https://zimjs.com/docs.html?item=center
	// https://zimjs.com/docs.html?item=transformPoints
	
	
});
              
            
!
999px

Console