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 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

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

              
                
              
            
!

CSS

              
                
              
            
!

JS

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

	// REFERENCES for ZIM at https://zimjs.com
	// see https://zimjs.com/intro.html for an intro example
	// see https://zimjs.com/learn.html for video and code tutorials
	// see https://zimjs.com/docs.html for documentation
	// see https://codepen.io/topic/zim/ for ZIM on CodePen
	
	// *** NOTE: ZIM Cat defaults to time in seconds
	// All previous versions, examples, videos, etc. have time in milliseconds
	// This can be set back with TIME = "milliseconds" but we suggest you give it a try!
	// There will be a warning in the conslole if your animation is not moving ;-)

	// CODE HERE	
	
	new Label({
		text:"Be Part of the Teleporter Network!",
		variant:true,
		color:white,
		italic:true
		// backgroundColor:black
	}).pos(0,50,CENTER,TOP);
	
	loop(5, i=>{
		new Circle(250-10*i,white).alp(.3).center();
	});	
				
	// to include a Teleporter in a ZIM app 
	// import https://zimjs.org/teleporter.js
	// and pass in the URL of your CodePen page
	const url = "https://codepen.io/zimjs/pen/zYBvyrv";
	const teleporter = new Teleporter(url).sca(.5).center();	
	// To include a Teleporter on your HTML page see this Pen for an example
	// https://codepen.io/zimjs/pen/WNxQPLp
	
	const pane = new Pane({
		width:stageW+50,
		height:300,
		backgroundColor:yellow
	});
	
	new Button({
		label:"GET CODE",
		width:300,
		height:60,
		corner:0,
		backgroundColor:yellow.darken(.2),
		rollBackgroundColor:yellow		
	}).sca(.7).pos(0,50,CENTER,BOTTOM).tap(()=>{
		pane.show();
	});
	
	new Label("Add this code to your CodePen page").pos(0,60,CENTER,TOP, pane);
	const textArea = new TextArea({
		width:1200,
		height:100,
		color:dark
	}).pos(0,60,CENTER,BOTTOM, pane);
	textArea.text = "<!-- replace url with your codepen page url -->\n\n<iframe src='https://zimjs.com/teleporter.html?url=CodePenPage' width=100 height=150 frameBorder=0></iframe>";
	textArea.tag.style.textAlign = "center";
	
	stage.update(); // this is needed to show any changes

	// DOCS FOR ITEMS USED
	// https://zimjs.com/docs.html?item=Frame
	// https://zimjs.com/docs.html?item=Circle
	// https://zimjs.com/docs.html?item=Label
	// https://zimjs.com/docs.html?item=Button
	// https://zimjs.com/docs.html?item=Pane
	// https://zimjs.com/docs.html?item=TextArea
	// https://zimjs.com/docs.html?item=tap
	// https://zimjs.com/docs.html?item=loop
	// https://zimjs.com/docs.html?item=pos
	// https://zimjs.com/docs.html?item=alp
	// https://zimjs.com/docs.html?item=sca
	// https://zimjs.com/docs.html?item=center
	// https://zimjs.com/docs.html?item=darken
	// https://zimjs.com/docs.html?item=zog

	// FOOTER
	// call remote script to make ZIM icon - you will not need this
	createIcon(); 

}); // end of ready
              
            
!
999px

Console