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

              
                  <div id="svgContainer"></div>
              
            
!

CSS

              
                html {
  margin: 0;
  padding: 0;
  background-color: #1E1C26;
}

body,
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
}

#svgContainer {
  max-width: 100%;
  max-height: 100%;
  background-color: #1E1C26;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}
              
            
!

JS

              
                /* Shapes */
var svgContainer = document.getElementById('svgContainer');
var animItem = bodymovin.loadAnimation({
  wrapper: svgContainer,
  animType: 'canvas',
  loop: true,
  path: 'https://labs.nearpod.com/bodymovin/demo/markus/isometric/markus2.json'
});


const scaling = "fit"; // this will resize to fit inside the screen dimensions
const width = 700;
const height = 700;
const color = black; // ZIM colors like green, blue, pink, faint, clear, etc.
const outerColor = black; // any HTML colors like "violet", "#333", etc. are fine to use

const frame = new Frame(scaling, width, height, color, outerColor);
frame.on("ready", () => { // ES6 Arrow Function - like function(){}
    zog("ready from ZIM Frame"); // logs in console (F12 - choose console)

    zogr(svgContainer)
    const stage = frame.stage;
    let stageW = frame.width;
    let stageH = frame.height;

    // see https://zimjs.com/learn.html for video and code tutorials
    // see https://zimjs.com/docs.html for documentation
    // see https://zimjs.com/bits.html for 64 Interactive Media techniques

    // *** 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 ;-)

    // put your code here (you can delete this sample code)

    // 1. need event to find out when ready because does not work if run right away 
    timeout(1, ()=>{
      // 2. changing the size of the screen changes the size we put here 
      // so need some way of finding out dimensions
      // leaving out dimensions sort of works - but how big to make the frame?
      new Bitmap(animItem.container).center();         
      svgContainer.style.display = "none";      
    });    
    Ticker.always();

}); // end of ready
              
            
!
999px

Console