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

              
                // it would be nice if Apple paid to have impact installed by default...
const frame = new Frame(FIT, 700, 700, darker, dark, {font:"impact", src:"https://assets.codepen.io/2104200/IMPACT.TTF"});
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: since ZIM Cat (before ZIM NFT) ZIM 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
	
	// We could use a new Label()
	// but we want to treat each letter as individual to get a different shadow 
	// and to wiggle the letter - so use LabelLetters. 
	// The styles could have just been LabelLetter parameters 
	// but wanted to demonstrate that ZIM has Style on the Canvas.
	
	STYLE = {
		font:"impact", 
		size:100, 
		color:yellow,
		bold:true,
		letterSpacing:8,
		lineSpacing:50,
		lineAlign:CENTER // align is the align of each letter in LabelLetters
	};
	const text = new LabelLetters("GOOD\nMORNING\nPEN\nFRIENDS")
		.centerReg() // so it animates in about its center
		.sca(0)
		.animate({scale:1}, 1.7, "elasticOut");  // {} around scale is where we can add more properties to animate
	const colors = series(red,blue,purple,green,pink);
	// text is a container and we can loop through the container 
	// and each time we are given the child - in this case a letter
	text.loop(letter=>{
		// shadow: color, x, y, blur 
		// wiggle: prop, start, min, max, minTime, maxTime
		letter.sha(colors().toAlpha(.5),8,8,0).wiggle("rotation",0,5,10,.2,.4);
	});
	STYLE = {}; // turn off style in case it affects anything below

	// stage.update(); // this would be needed to see things if not animating...

	// DOCS FOR ITEMS USED
	// https://zimjs.com/docs.html?item=Frame
	// https://zimjs.com/docs.html?item=LabelLetters
	// https://zimjs.com/docs.html?item=animate
	// https://zimjs.com/docs.html?item=wiggle
	// https://zimjs.com/docs.html?item=loop
	// https://zimjs.com/docs.html?item=sha
	// https://zimjs.com/docs.html?item=sca
	// https://zimjs.com/docs.html?item=centerReg
	// https://zimjs.com/docs.html?item=timeout
	// https://zimjs.com/docs.html?item=series
	// https://zimjs.com/docs.html?item=toAlpha
	// https://zimjs.com/docs.html?item=zog
	// https://zimjs.com/docs.html?item=STYLE

	// FOOTER
	// call remote script to make ZIM icon - you will not need this
	timeout(1, ()=>{createIcon(); createGreet();}); 

}); // end of ready
              
            
!
999px

Console