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><button>redrawing</button></div>
            <svg xmlns="http://www.w3.org/2000/svg" id="レイヤー_1" x="0" y="0" version="1.1" viewBox="0 0 250.229 260.531"
                xml:space="preserve">
                <style>
                    .st0 {
                        fill: none;
                        stroke: #FFFFFF;
                        stroke-width: 3;
                        stroke-linecap: round;
                        stroke-linejoin: round;
                        stroke-miterlimit: 10
                    }

                    .st1 {
                        fill: #00A29A;
                        stroke: #FFFFFF;
                        stroke-width: 3;
                        stroke-linecap: round;
                        stroke-linejoin: round;
                        stroke-miterlimit: 10
                    }
                </style>
                <g id="radient-line">
                    <path d="M1.5 65.883l25.741 13.786" class="st0" />
                    <path d="M52.306 18.751L67.167 42.63" class="st0" />
                    <path d="M121.708 1.5v27.589" class="st0" />
                    <path d="M191.111 18.751l-14.862 23.88" class="st0" />
                    <path d="M241.917 65.883l-25.741 13.786" class="st0" />
                    <path d="M241.917 194.648l-25.741-13.787" class="st0" />
                    <path d="M191.111 241.779L176.249 217.9" class="st0" />
                    <path d="M121.708 259.031v-27.589" class="st0" />
                    <path d="M52.306 241.779L67.168 217.9" class="st0" />
                    <path d="M1.5 194.648l25.741-13.787" class="st0" />
                </g>
                <g id="arrows">
                    <g id="left-arrow">
                        <path d="M248.729 147.198H4.903" class="st0" />
                        <path d="M17.968 160.263L4.903 147.198l13.065-13.064" class="st0" />
                    </g>
                    <g id="right-arrow">
                        <path d="M4.903 115.777h243.826" class="st0" />
                        <path d="M235.664 102.712l13.065 13.065-13.065 13.064" class="st0" />
                    </g>
                </g>
                <g id="key">
                    <path id="key-body"
                        d="M159.344 167.319H84.073a8 8 0 01-8-8v-50.716a8 8 0 018-8h75.271a8 8 0 018 8v50.716a8 8 0 01-8 8z"
                        class="st1" />
                    <path id="key-hole"
                        d="M130.074 128.34a8.367 8.367 0 00-16.732 0c0 3.583 2.257 6.631 5.422 7.823v10.183a2.944 2.944 0 105.888 0v-10.183c3.166-1.192 5.422-4.24 5.422-7.823z"
                        class="st1" />
                    <path id="key-arm"
                        d="M121.709 72.439c11.744 0 21.457 8.337 23.085 19.186h10.427c-1.685-16.354-16.045-29.128-33.512-29.128-17.468 0-31.827 12.775-33.512 29.128h10.427c1.627-10.849 11.34-19.186 23.085-19.186z"
                        class="st0" />
                </g>
            </svg>
        </div>
              
            
!

CSS

              
                body {
  background-color: #00a29a;
}
svg {
  width: 200px;
  background-color: #00a29a;
  [class^="st"] {
    stroke: #fff;
    stroke-width: 3;
    // opacity: 0;
  }
}
              
            
!

JS

              
                gsap.registerPlugin(DrawSVGPlugin);

gsap.set("path", {drawSVG: false});
const tl = gsap.timeline({ delay: 1 });
tl.from("path", {opacity: 0, duration: 0.5})
	.to("#key path", { drawSVG: true, duration: 3 })
	.to("#arrows path", { drawSVG: true, duration: 3 }, 1)
	.to("#radient-line path", { drawSVG: true, duration: 0.25, stagger: 0.2 }, 2);
document.querySelector("button").addEventListener("click", () => tl.restart());
              
            
!
999px

Console