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

              
                <svg width="224px" height="428px" viewBox="0 0 224 428" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
    <title>fridge</title>
    <desc>Created with Sketch.</desc>
    <defs>
        <filter x="-4.1%" y="-6.2%" width="108.1%" height="112.3%" filterUnits="objectBoundingBox" id="filter-1">
            <feGaussianBlur stdDeviation="2.77630974" in="SourceGraphic"></feGaussianBlur>
        </filter>
        <filter x="-4.1%" y="-3.2%" width="108.1%" height="106.4%" filterUnits="objectBoundingBox" id="filter-2">
            <feGaussianBlur stdDeviation="2.77630974" in="SourceGraphic"></feGaussianBlur>
        </filter>
        <rect id="path-3" x="13" y="107" width="9" height="30" rx="4.5"></rect>
        <rect id="path-4" x="13" y="170" width="9" height="69.6328125" rx="4.5"></rect>
    </defs>
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="fridge">
            <path d="M20,12.5 C13.6487254,12.5 8.5,17.6487254 8.5,24 L8.5,133.140625 C8.5,139.4919 13.6487254,144.640625 20,144.640625 L198.614448,144.640625 C204.965723,144.640625 210.114448,139.4919 210.114448,133.140625 L210.114448,24 C210.114448,17.6487254 204.965723,12.5 198.614448,12.5 L20,12.5 Z" id="freezerOutline" stroke="#B9E8FF" stroke-width="3" filter="url(#filter-1)"></path>
            <rect id="fridgeOutline" stroke="#B9E8FF" stroke-width="3" filter="url(#filter-2)" x="8.5" y="158.181641" width="201.614448" height="259.118347" rx="13"></rect>
            <rect id="freezerDoor" stroke="#979797" stroke-width="3" x="3.5" y="12.5" width="206.614448" height="136.140625" rx="13"></rect>
            <rect id="fridgeDoor" stroke="#979797" stroke-width="3" x="3.5" y="157.5" width="206.614448" height="266.285156" rx="13"></rect>
            <g id="freezerHandle">
                <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-3"></use>
                <rect stroke="#979797" stroke-width="3" x="14.5" y="108.5" width="6" height="27" rx="3"></rect>
            </g>
            <g id="fridgeHandle">
                <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-4"></use>
                <rect stroke="#979797" stroke-width="3" x="14.5" y="171.5" width="6" height="66.6328125" rx="3"></rect>
            </g>
        </g>
    </g>
</svg>
              
            
!

CSS

              
                body {
  display: flex;
  justify-content: center;
  align-items: center;
}

#fridgeDoor {
  transform-origin: 100% 0%;
}
              
            
!

JS

              
                var tl = new TimelineMax();

tl.from("#freezerDoor", 1, {drawSVG:"0%", delay:.5, ease:Power1.easeOut})
  .from("#fridgeDoor", 1, {drawSVG:"0%", ease:Power1.easeOut}, "-=1")
  .fromTo("#freezerHandle", 1.5, {transform: "scaleY(0)", ease:Elastic.easeOut}, {transform: "scaleY(1)", ease:Elastic.easeOut})
.fromTo("#fridgeHandle", 1.5, {transform: "scaleY(0)", ease:Elastic.easeOut}, {transform: "scaleY(1)", ease:Elastic.easeOut}, "-=1.5")
.fromTo("#freezerOutline", .25, {attr:{opacity:0}}, {attr:{opacity:1}}, "-=.5")
.fromTo("#fridgeOutline", .25, {attr:{opacity:0}}, {attr:{opacity:1}}, "-=.5");
              
            
!
999px

Console