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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <svg class="demo" viewBox="0 0 500 260" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
  <path d="M 250 248 L 10 248 L 10 8 L 10 8 L 490 8 L 490 248 L 250 248"></path>
  <path d="M 250 240 L 20 240 L 20 20 L 20 20 L 480 20 L 480 240 L 250 240"></path>
  <path d="M 250 230 L 30 230 L 30 30 L 30 30 L 470 30 L 470 230 L 250 230"></path>
  <path d="M 250 220 L 40 220 L 40 40 L 40 40 L 460 40 L 460 220 L 250 220"></path>
  <path d="M 251 210 L 50 210 L 50 50 L 50 50 L 450 50 L 450 210 L 251 210"></path>
</svg>
              
            
!

CSS

              
                .demo  {
  opacity:0;
  width:90%;
}

body {
  text-align:center;
  overflow:hidden;
  background:#1d1d1d;
}

.demo path {
  stroke:orange;
  stroke-weight:2px;
  fill:none;
}
              
            
!

JS

              
                
gsap.set(".demo", {opacity:1})

gsap.set("path", {opacity:gsap.utils.distribute({base: 0.2, amount: 0.8})})


const tl = gsap.timeline()
.fromTo("path", 
        {drawSVG:"100% 100%"}, 
        {drawSVG:"151% 50%", duration:2,
        stagger:{
          each:0.05,
          from:"center"
        }, repeat:1, yoyo:true})

//secret sauce ;)
//flip the rectangles vertically immediately before the repeat happens. This makes it look like they are "un-drawing" from the bottom.
.set("path", {rotation:180, transformOrigin:"50% 50%"}, "<50%")


GSDevTools.create({animation:tl})


              
            
!
999px

Console