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

              
                <!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="css/main.css">
        <title>GSAP</title>
    </head>

    <body>
        <div><button onclick="play()">redrawing</button></div>
        <div class="animeIcon-box">

            <svg xmlns="http://www.w3.org/2000/svg" id="レイヤー_1" x="0" y="0" version="1.1" viewBox="0 0 295.545 295.545"
                xml:space="preserve">
                <path fill="none" d="M-.002-.002h295.55v295.55H-.002z" />
                <g id="securityLogo1">
                    <g id="arrows">
                        <g id="left-arrow">
                            <path d="M274.404 170.426H30.578" class="st1" />
                            <path d="M43.643 183.491l-13.065-13.065 13.065-13.064" class="st1" />
                        </g>
                        <g id="right-arrow">
                            <path d="M30.578 139.005h243.826" class="st1" />
                            <path d="M261.339 125.94l13.065 13.065-13.065 13.065" class="st1" />
                        </g>
                    </g>
                    <g id="radient-line">
                        <path d="M27.175 89.111l25.741 13.786" class="st1" />
                        <path d="M77.981 41.979l14.862 23.879" class="st1" />
                        <path d="M147.384 24.728v27.589" class="st1" />
                        <path d="M216.786 41.979l-14.862 23.88" class="st1" />
                        <path d="M267.592 89.111l-25.741 13.787" class="st1" />
                        <path d="M267.592 217.876l-25.741-13.787" class="st1" />
                        <path d="M216.786 265.007l-14.862-23.879" class="st1" />
                        <path d="M147.384 282.259V254.67" class="st1" />
                        <path d="M77.981 265.007l14.862-23.879" class="st1" />
                        <path d="M27.175 217.876l25.741-13.787" class="st1" />
                    </g>
                    <g id="key">
                        <path id="key-body"
                            d="M185.019 190.547h-75.271a8 8 0 01-8-8v-50.716a8 8 0 018-8h75.271a8 8 0 018 8v50.716a8 8 0 01-8 8z"
                            class="st2" />
                        <path id="key-hole"
                            d="M155.75 151.569a8.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.165-1.193 5.422-4.241 5.422-7.823z"
                            class="st2" />
                        <path id="key-arm"
                            d="M147.384 95.667c11.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.628-10.849 11.341-19.186 23.085-19.186z"
                            class="st1" />
                    </g>
                </g>
            </svg>

            <svg xmlns="http://www.w3.org/2000/svg" id="レイヤー_1" x="0" y="0" version="1.1" viewBox="0 0 295.545 295.545"
                xml:space="preserve">
                <path fill="none" d="M-.002-.002h295.55v295.55H-.002z" />
                <g id="securityLogo2">
                    <g id="right-doc">
                        <path id="doc-outline"
                            d="M271.556 149.82H185.83a8 8 0 01-8-8V29.734a8 8 0 018-8h75.695l18.031 18.031V141.82a8 8 0 01-8 8z"
                            class="st1" />
                        <g id="doc-contens_1_">
                            <path d="M191.447 47.292h74.492" class="st1" />
                            <path d="M191.447 60.12h74.492" class="st1" />
                            <path d="M191.447 72.948h74.492" class="st1" />
                            <path d="M191.447 85.777h74.492" class="st1" />
                            <path d="M191.447 98.605h74.492" class="st1" />
                            <path d="M191.447 111.433h74.492" class="st1" />
                            <path d="M191.447 124.261h37.246" class="st1" />
                            <path d="M240.905 124.261h25.034" class="st1" />
                        </g>
                        <path id="doc-wrapped" d="M279.556 39.765h-18.031V21.734z" class="st1" />
                    </g>
                    <g id="left-doc">
                        <path id="doc-outline_1_"
                            d="M108.332 236.613H22.606a8 8 0 01-8-8V116.527a8 8 0 018-8h75.695l18.031 18.031v102.055a8 8 0 01-8 8z"
                            class="st2" />
                        <path id="doc-wrapped_1_" d="M116.332 126.558H98.301v-18.031z" class="st2" />
                        <g id="doc-contens">
                            <circle cx="54.094" cy="152.312" r="20.756" class="st1" />
                            <circle cx="88.419" cy="163.887" r="9.18" class="st1" />
                            <circle cx="88.419" cy="140.736" r="9.18" class="st1" />
                            <path d="M54.094 131.556v20.756l-17.573 11.044" class="st1" />
                            <path d="M88.419 131.556v9.18l-8.932-2.102" class="st1" />
                            <path d="M88.419 154.707v9.18l-4.731 7.867" class="st1" />
                            <g>
                                <path d="M25.87 213.584h79.197" class="st2" />
                                <path d="M33.338 206.834v-11.642" class="st2" />
                                <path d="M41.286 206.834v-15.751" class="st2" />
                                <path d="M49.234 206.834v-25.001" class="st2" />
                                <path d="M57.183 206.834v-7.875" class="st2" />
                                <path d="M65.131 206.834v-12.501" class="st2" />
                                <path d="M73.079 206.834v-20.251" class="st2" />
                                <path d="M81.027 206.834v-27.943" class="st2" />
                                <path d="M88.976 206.834v-27.943" class="st2" />
                                <path d="M96.924 206.834v-23.251" class="st2" />
                            </g>
                        </g>
                    </g>
                    <g id="key">
                        <path id="key-body"
                            d="M185.499 190.599h-75.271a8 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="M156.23 151.62a8.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.165-1.192 5.422-4.24 5.422-7.823z"
                            class="st1" />
                        <path id="key-arm"
                            d="M147.864 95.719c11.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.628-10.849 11.341-19.186 23.085-19.186z"
                            class="st1" />
                    </g>
                </g>
            </svg>

            <svg xmlns="http://www.w3.org/2000/svg" id="securityLogo3" x="0" y="0" version="1.1"
                viewBox="0 0 295.545 295.545" xml:space="preserve">
                <path fill="none" d="M-.002-.002h295.55v295.55H-.002z" />
                <g id="securityLogo3">
                    <g id="arrows3">
                        <g id="top">
                            <path d="M170.565 28.138l-22.792 30.287L103.685 1.5" class="st1 arrow-bar" />
                            <path d="M155.38 30.282l15.185-2.144 2.144 15.186" class="st1 arrow-head" />
                            <g class="arrow-effect">
                                <path d="M120.919 40.918l8.37 7.44" class="st1" />
                                <path d="M117.622 53.356l12.142.825" class="st1" />
                            </g>
                        </g>
                        <g id="right">
                            <path d="M267.407 170.565l-30.287-22.792 56.925-44.088" class="st1 arrow-bar" />
                            <path d="M265.263 155.38l2.144 15.185-15.186 2.144" class="st1 arrow-head" />
                            <g class="arrow-effect">
                                <path d="M254.627 120.919l-7.44 8.37" class="st1" />
                                <path d="M242.189 117.622l-.825 12.142" class="st1" />
                            </g>
                        </g>
                        <g id="under">
                            <path d="M124.98 267.407l22.793-30.287 44.087 56.925" class="st1 arrow-bar" />
                            <path d="M140.165 265.263l-15.185 2.144-2.144-15.186" class="st1 arrow-head" />
                            <g class="arrow-effect">
                                <path d="M174.626 254.627l-8.37-7.44" class="st1" />
                                <path d="M177.923 242.189l-12.142-.825" class="st1" />
                            </g>
                        </g>
                        <g id="left">
                            <path d="M28.138 124.98l30.287 22.793L1.5 191.86" class="st1 arrow-bar" />
                            <path d="M30.282 140.165l-2.144-15.185 15.186-2.144" class="st1 arrow-head" />
                            <g class="arrow-effect">
                                <path d="M40.918 174.626l7.44-8.37" class="st1" />
                                <path d="M53.356 177.923l.825-12.142" class="st1" />
                            </g>
                        </g>
                    </g>
                    <circle id="key-back" cx="147.773" cy="147.773" r="89.347" class="st2" />
                    <g id="key">
                        <path id="key-body_2_"
                            d="M185.408 190.299h-75.271a8 8 0 01-8-8v-50.716a8 8 0 018-8h75.271a8 8 0 018 8v50.716a8 8 0 01-8 8z"
                            class="st2" />
                        <path id="key-hole_2_"
                            d="M156.138 151.32a8.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="st2" />
                        <path id="key-arm_2_"
                            d="M147.773 95.419c11.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.341-19.186 23.085-19.186z"
                            class="st2" />
                    </g>
                </g>
            </svg>
        </div>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/gsap.min.js"></script>
        <script src="./app.js"></script>
    </body>

</html>
              
            
!

CSS

              
                body {
  background-color: #00a29a;
}
.animeIcon-box {
  display: flex;
}
svg {
  width: 200px;
  margin-left: 40px;
}
[class^="st"] {
  opacity: 0;
}
#securityLogo1 {
  .st1 {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }

  .st2 {
    fill: #00a29a;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }
}

#securityLogo2 {
  .st1 {
    fill: #00a29a;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }
  .st2 {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }
}
#securityLogo3 {
  .st1 {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }
  .st2 {
    fill: #00a29a;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
  }
}

              
            
!

JS

              
                function setStrokeProperty(lines, direction = 1) {
  lines.forEach((line) => {
    let pathLength = line.getTotalLength();
    line.style.setProperty("stroke-dasharray", pathLength + " " + pathLength);
    line.style.setProperty("stroke-dashoffset", pathLength);
    if (direction === -1) {
      line.style.setProperty("stroke-dashoffset", -pathLength);
    }
  });
  return lines;
}

function securityLogo1() {
  let SVGname = "#securityLogo1 ";
  // const keyLines = document.querySelectorAll(SVGname + "#key path");
  const radientLines = document.querySelectorAll(
    SVGname + "#radient-line path"
  );
  setStrokeProperty(radientLines);
  const arrowLines = document.querySelectorAll(SVGname + "#arrows path");
  setStrokeProperty(arrowLines);
  gsap.set(SVGname + "#key path", { opacity: 1 });
  let tl1 = gsap.timeline();
  tl1.to(arrowLines, 0.2, { opacity: 1 });
  tl1.to(arrowLines, 1, { "stroke-dashoffset": 0 }, 0);
  // tl1.to(keyLines, 1.5, { opacity: 1 }, "-=2.5");
  tl1.to(radientLines, 0.1, { opacity: 1, stagger: 0.1 }, 1);
  tl1.to(radientLines, 0.1, { "stroke-dashoffset": 0, stagger: 0.1 }, 1);

  return tl1;
}
function securityLogo2() {
  let SVGname = "#securityLogo2 ";
  // const keyLines2 = document.querySelectorAll(SVGname + "#key path");
  const rightDocLines2 = document.querySelectorAll(SVGname + "#right-doc path");
  setStrokeProperty(rightDocLines2);

  const leftDocLines2 = document.querySelectorAll(SVGname + "#left-doc path");
  const leftDocCircles2 = document.querySelectorAll(
    SVGname + "#left-doc circle"
  );
  setStrokeProperty(leftDocLines2);
  setStrokeProperty(leftDocCircles2);

  gsap.set(SVGname + "#key path", { opacity: 1 });
  let tl2 = gsap.timeline();
  tl2.to(rightDocLines2, 0.5, { opacity: 1, stagger: 0.1 });
  tl2.to(rightDocLines2, 1.5, { "stroke-dashoffset": 0, stagger: 0.1 }, 0);
  tl2.to(leftDocLines2, 1, { opacity: 1, stagger: 0.1 }, "-=2.5");
  tl2.to(leftDocLines2, 1, { "stroke-dashoffset": 0, stagger: 0.1 }, "-=2.5");
  tl2.to(leftDocCircles2, 1, { opacity: 1, stagger: 0.1 }, "-=1.5");
  tl2.to(leftDocCircles2, 1, { "stroke-dashoffset": 0, stagger: 0.1 }, "-=1.5");
  // tl2.to(keyLines2, 1.5, { opacity: 1 }, "-=1");

  return tl2;
}

function securityLogo3() {
  let SVGname = "#securityLogo3 ";
  // const keyLines3 = document.querySelectorAll(SVGname + "#key path");
  const keyBack3 = document.querySelectorAll(SVGname + "#key-back");
  setStrokeProperty(keyBack3);
  const arrows3 = document.querySelectorAll(SVGname + "#arrows3 path");
  setStrokeProperty(arrows3, -1);
  const arrowHeads = document.querySelectorAll(
    SVGname + "#arrows3 path.arrow-head"
  );
  setStrokeProperty(arrowHeads);
  const arrowBars = document.querySelectorAll(
    SVGname + "#arrows3 path.arrow-bar"
  );
  setStrokeProperty(arrowBars, -1);
  const arrowEffects = document.querySelectorAll(
    SVGname + "#arrows3 .arrow-effect path"
  );
  setStrokeProperty(arrowEffects);
  gsap.set(SVGname + "#key path", { opacity: 1 });
  let tl3 = gsap.timeline();
  // tl3.to(keyLines3, 3, { opacity: 1 });
  // tl3.to(keyBack3, 0.5, { opacity: 1 }, "-=1.5");
  // tl3.to(keyBack3, 1.5, { "stroke-dashoffset": 0 }, "-=1.5").add("end", 2);
  tl3.to(keyBack3, 0.5, { opacity: 1 });
  tl3.to(keyBack3, 1.5, { "stroke-dashoffset": 0 }, 0).add("end", 2);
  tl3.to(arrowBars, 0.5, { opacity: 1, stagger: 0.2 }, "-=0.9");
  tl3.to(arrowBars, 0.5, { "stroke-dashoffset": 0, stagger: 0.2 }, "-=0.9");
  tl3.to(arrowHeads, 0.2, { opacity: 1 }, "-=0.5");
  tl3.to(arrowHeads, 0.5, { "stroke-dashoffset": 0 }, "-=0.5");
  tl3.to(arrowEffects, 0.05, { opacity: 1 }, "-=0.4");
  tl3.to(arrowEffects, 0.05, { "stroke-dashoffset": 0 }, "-=0.4");

  return tl3;
}
let tl1 = securityLogo1();
let tl2 = securityLogo2();
let tl3 = securityLogo3();
// var master = gsap.timeline();
// master
//   .add(securityLogo1())
//   .add(securityLogo2(), "-=1")
//   .add(securityLogo3(), "-=1");

function play() {
  tl1.restart();
  tl2.restart();
  tl3.restart();
  // master.restart();
}

              
            
!
999px

Console