Pen Settings



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


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


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.


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.






                const frame = new Frame("fit", 800, 600, lighter, grey);
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
    // ZIM Pizzazz 3 provides animated patterns - see
    // example with ProgressBar - only for barType == "rectangle" not the default "circle"
    // this is what a real progress bar with animated backing might look like:
    // btw the ProgressBar does not need animated backings
    // you can just set it to new ProgressBar(); and adjust its color parameters, etc.

    // const bar = new ProgressBar({
    //     type:"rectangle",
    //     backing:pizzazz.makePattern({colors:[blue, green], interval:100})
    // });
    // const frame = new Frame("fit", 1024, 768, black, white, "assets.mp3", "sounds/", bar);
    // frame.on("ready", ()=>{
    //     var circle = new Circle(100, red).center();
    //     circle.on("click", ()=>{
    //         frame.asset("sound.mp3").play();
    //     });
    // });

    // Below, we are going to show a series of patterns
    // and run a demonstration progress bar repeatedly with new patterns

    const patterns = [
        // makePattern(type, colors, size, cols, rows, spacingH, spacingV, interval, startPaused, cache)
        // these are animated (optional) and all but the first is started paused (optional) 
				// we unpause when shown in the bar
					type:"slants", colors:makeSeries([brown, grey]), 
					size:5, rows:20, cols:60, interval:500
					type:"pixels", colors:[blue, green], 
					interval:100, startPaused:true
					type:"hatch", colors:pink, 
					interval:1000, startPaused:true
					type:"dots", colors:[blue, green], 
					size:7, rows:3, interval:100, startPaused:true, cache:false
					type:"plaid", colors:makeSeries([green, grey, green, blue]), 
					size:5, rows:20, cols:60, interval:500, startPaused:true
					type:"noise", colors:[orange, yellow], 
					interval:100, startPaused:true
					type:"stripes", colors:makeSeries([purple, pink]), 
					gradient:.2, rows:3, interval:500, startPaused:true
					type:"bling", colors:["#999", "#aaa", "#bbb"], 
					size:25, rows:5, cols:15, backgroundColor:darker, 
					interval:100, startPaused:true

		// anytime series is called it returns the next item in the pattern array
    const series = makeSeries(patterns); 
		// for example - this will be the slants pattern
    const firstPattern = series(); 

    const bar = new ProgressBar({
        backingColor:grey, // some patterns are partially transparent so this may affect colors

        // corner:0,
        // borderWidth:10,
        // label:"LOADING",
        // labelPosition:"above",
        // padding:3,
        // fastClose:true

    interval(30, (obj)=>{ // note, the ZIM interval() is a little different than setInterval()
        if (obj.count <= 100) {
            bar.percent = obj.count; // manually change the progress bar
        } else if (obj.count == 101) {
            // once the bar reaches 100 it will automatically hide
            // This just swaps the backing with the next backing
            // for demonstration purposes only - normally, you would not do all this
           	bar.backing.pattern.pauseInterval(); // pause existing animation
            bar.setBacking(series()); // set the backing of the bar to the new pattern
            timeout(1000, ()=>{ // note, the ZIM timeout() is a little different than setTimeout()
                obj.count = 0;
                bar.backing.pattern.pauseInterval(false); // start the new pattern
		new Label("Example Animated Progress Bar Backings in ZIM").sca(.8).center().mov(0,-200).alp(.5);

    // FOOTER
    // call remote script to make ZIM Foundation for Creative Coding icon

}); // end of ready