css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <svg class="panda" xmlns="http://www.w3.org/2000/svg" version="1.1" id="Layer_1" x="0" y="0" viewBox="0 0 980.1 400" enable-background="new 0 0 980.1 400" xml:space="preserve">
  <g id="shadow">
    <ellipse opacity="0.1" fill="#3A6E91" cx="480.3" cy="374.5" rx="161.3" ry="17.9" />
    <ellipse opacity="0.4" fill="#3A6E91" cx="480.3" cy="370.9" rx="97.5" ry="10.8" />
  </g>
  <g class="p-body">
    <path id="leg2" d="M573.6 236.3c0 0-2.9 58.1-11.8 77.2 -9.3 19.8 8.3 44.5 0 54.4s-70.4 6.2-70.4 6.2 -7.7-11.9 0-54.4c7.4-41.1-4.9-42.1-4.9-42.1L573.6 236.3 573.6 236.3 573.6 236.3H571l0 0" />
    <path id="leg1" d="M390 236.3c0 0 11.1 56.7 17.5 77.2 5.6 18-8.6 44.5 0 54.4 8.6 9.9 73.2 6.2 73.2 6.2s6.4-11.6 0-54.4c-6.6-43.9 5.1-42.1 5.1-42.1L390 236.3 390 236.3 390 236.3 390 236.3 390 236.3" />
    <path id="arm2" d="M536 122.9c0 0 46.1 10.6 54.1 72.2s14.8 82.4-8.1 86.6c-22.8 4.2-33.2-58.3-33.2-58.3L536 122.9z" />
    <path id="arm3" display="none" d="M239.5 134.4c0 0 50.1 60 53.8 31.7 6.8-52.7 34.7-49.1 34.7-34.5 0 0 18.9 100.3-47 87.8C281 219.5 172.7 195.9 239.5 134.4z" />
    <path id="arm1" d="M425.9 125.5c0 0-43.2 11-50.7 74.8 -7.6 63.8-13.8 85.4 7.6 89.8 21.4 4.3 31.1-60.5 31.1-60.5L425.9 125.5z" />
    <g id="body">
      <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="430.2" y1="117" x2="536.7" y2="301.5">
        <stop offset="0" stop-color="#FFFFFF" />
        <stop offset="0.2" stop-color="#FCFCFC" />
        <stop offset="0.4" stop-color="#F2F2F2" />
        <stop offset="0.6" stop-color="#E1E1E1" />
        <stop offset="0.7" stop-color="#C9C9C9" />
        <stop offset="0.9" stop-color="#ABABAB" />
        <stop offset="1" stop-color="#919191" />
      </linearGradient>
      <ellipse fill="url(#SVGID_1_)" cx="483.4" cy="209.2" rx="94.9" ry="110.1" />
      <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="483" y1="275.8" x2="483" y2="97.4">
        <stop offset="0" stop-color="#FFFFFF" />
        <stop offset="0.2" stop-color="#FCFCFC" />
        <stop offset="0.3" stop-color="#F2F2F2" />
        <stop offset="0.4" stop-color="#E1E1E1" />
        <stop offset="0.6" stop-color="#C9C9C9" />
        <stop offset="0.7" stop-color="#ABABAB" />
        <stop offset="0.8" stop-color="#858585" />
        <stop offset="0.9" stop-color="#5A5A5A" />
        <stop offset="1" stop-color="#2E2E2E" />
      </linearGradient>
      <ellipse opacity="0.4" fill="url(#SVGID_2_)" cx="483" cy="186.6" rx="86" ry="89.2" />
      <ellipse display="none" fill="#D3D3D3" cx="483.4" cy="205" rx="87.8" ry="101.9" />
      <path opacity="0.9" fill="#FFFFFF" d="M545.1 159.7c-39.4 24-82.4 38-118.6-4.5 -18.2 19-22.4 60.7-17.9 85.1 5.1 27.7 31.1 43.5 59 47.7 52.4 7.9 101.3-28.6 93.5-83.2C562.6 210.5 559.7 176.6 545.1 159.7z" />
    </g>
    <g id="head">
      <g id="face">
        <path fill="#ABABAB" d="M415 99.9c10.8-31.2 33.1-85.7 71.5-88.6 34.9-2.7 61.1 49.8 67.6 76.9 3.7 15.4 3.4 34.3-1 49.4 -6.7 22.9-22.2 28.4-42.4 35.9 -24.6 9.1-44.6 11.2-67.2-6.4C423.4 151.4 407.5 126 415 99.9z" />
        <path fill="#EAEAEA" d="M415 98.1c10.8-31.2 33.1-85.7 71.5-88.6 34.9-2.7 61.1 49.8 67.6 76.9 3.7 15.4 3.4 34.3-1 49.4 -6.7 22.9-22.2 28.4-42.4 35.9 -24.6 9.1-44.6 11.2-67.2-6.4C423.4 149.6 407.5 124.3 415 98.1z" />
        <path fill="#FFFFFF" d="M418.9 93.4c10.2-29.4 31.2-80.8 67.4-83.6 32.9-2.5 57.6 46.9 63.7 72.5 3.5 14.5 3.2 32.4-0.9 46.6 -6.3 21.6-20.9 26.8-40 33.9 -23.2 8.6-42.1 10.6-63.4-6.1C426.8 142 411.9 118.1 418.9 93.4z" />
      </g>
      <g id="features">
        <path d="M517.4 31.2c0 0 10.8-26.6 20.7-15.8 0 0 25.6 37.4 0 43.3C538.1 58.8 509.5 44.7 517.4 31.2z" />
        <path d="M466.5 22.8c0 0-10.8-26.6-20.7-15.8 0 0-25.6 37.4 0 43.3C445.8 50.4 474.4 36.3 466.5 22.8z" />
        <path d="M468.8 154.9h26.9C495.6 154.9 485.2 178.4 468.8 154.9z" />
        <path d="M501.6 126.7c0 0 0.2-35.4 14.4-16.7 0 0 9.8 9.4 5.3 16.7l-5.3 12.8C516 139.5 512.5 151.3 501.6 126.7z" />
        <path d="M452.5 111.3c5.6-8.1 10.2-10.8 15.4-2 3.1 5.2 1.3 11.7-1.5 17.1 -2.9 5.6-6.3 17.2-14.4 12.7 -4.3-2.4-4.3-7.1-5-11.4C446 121.2 448.8 116.7 452.5 111.3z" />
      </g>
    </g>
  </g>
  <path class="heart" fill="#F04E39" d="M542.8 202c0-4.6-5.8-7.1-8.7-3.1 -2.2-3.1-6.8-2.5-8.3 1 -1.5 3.3 0.4 5.2 2.7 7.1 1.4 1.2 4.1 3.1 6 3.9l0 0C537.2 208.9 542.8 205.7 542.8 202z" />
  <path class="heart" fill="#ef7c2e" d="M542.8 202c0-4.6-5.8-7.1-8.7-3.1 -2.2-3.1-6.8-2.5-8.3 1 -1.5 3.3 0.4 5.2 2.7 7.1 1.4 1.2 4.1 3.1 6 3.9l0 0C537.2 208.9 542.8 205.7 542.8 202z" />
  <path class="heart" fill="#F04E39" d="M542.8 202c0-4.6-5.8-7.1-8.7-3.1 -2.2-3.1-6.8-2.5-8.3 1 -1.5 3.3 0.4 5.2 2.7 7.1 1.4 1.2 4.1 3.1 6 3.9l0 0C537.2 208.9 542.8 205.7 542.8 202z" />
  <g id="lasers" opacity="0.8">
    <line fill="none" stroke="#F04E39" stroke-width="3" stroke-miterlimit="10" x1="525.3" y1="122.9" x2="1013" y2="236.3" />
    <line fill="none" stroke="#F04E39" stroke-width="3" stroke-miterlimit="10" x1="466.4" y1="126.4" x2="1005.6" y2="290.3" />
  </g>
</svg>
<h2>Huggy Laser Panda</h2>
            
          
!
            
              html, body {
  width: 100vw;
  height: 100vh;
  background: #56caf5;
  font-family: 'Frijole', cursive;
}

.panda {
  height: 325px;
  margin: 10px auto;
  display: table;
}

#lasers line {
  visibility: hidden;
}

h2 {
  font-family: 'Frijole', cursive;
  top: 140px;
  left: 50%;
  margin-left: -300px;
  text-align: center;
  color: lighten(#F04E39, 20%);
  font-size: 45px;
  position: absolute;
  text-shadow: 0 1px 0 hsl(5,76%,50%),
   0 2px 0 hsl(5,76%,60%),
   0 3px 0 hsl(5,76%,50%),
   0 4px 0 hsl(5,76%,46%),
   0 5px 0 hsl(5,76%,44%),
   0 6px 0 hsl(5,76%,42%),
   0 7px 0 hsl(5,76%,41%),
   0 8px 0 hsl(5,76%,35%),
   0 0 5px rgba(80,25,25,.05),
  0 1px 3px rgba(80,25,25,.1),
  0 3px 5px rgba(80,25,25,.1),
 0 5px 10px rgba(80,25,25,.1),
0 10px 10px rgba(80,25,25,.1),
0 20px 20px rgba(80,25,25,.2);
}
 
            
          
!
            
              var $rleg = $("#leg2"),
  $lleg = $("#leg1"),
  $shadow = $("#shadow"),
  $panda = $(".p-body"),
  $features = $("#features"),
  $t1 = $("h2"),
  $lasers = $("#lasers line");

TweenMax.set($lasers, {
  rotation: 150,
  x: -15,
  opacity: 0,
  drawSVG: '0 0',
  visibility: "visible"
});

TweenMax.set($t1, {
  perspective: 400
});

// the first scene
function sceneOne() {
  var tl = new TimelineMax();

  tl.add("start");
  tl.staggerTo([$rleg, $lleg], 0.5, {
      scaleY: 0.96,
      transformOrigin: "50% 50%",
      repeat: 4.5,
      yoyo: true,
      ease: Power4.easeOut
    }, 0.3, "start")
    .to($panda, 0.25, {
      y: -2,
      scaleX: 1.002,
      transformOrigin: "50% 50%",
      repeat: 11,
      yoyo: true,
      ease: Power3.easeInOut
    }, "start")
    .to($shadow, 0.25, {
      scaleX: 0.95,
      transformOrigin: "50% 50%",
      repeat: 10,
      yoyo: true,
      ease: Sine.easeOut
    }, "+=start0.5")
    .to($("#arm1"), 1, {
      rotation: 30,
      transformOrigin: "100% 30%",
      ease: Power4.easeOut
    }, "start+=3")
    .to($("#arm2"), 1, {
      rotation: -30,
      transformOrigin: "0% 30%",
      ease: Power4.easeOut
    }, "start+=3")
    .staggerFromTo($(".heart"), 3, {
      scale: 0,
      transformOrigin: "50% 50%"
    }, {
      scale: 10,
      opacity: 0,
      transformOrigin: "50% 50%",
      ease: Power4.easeOut
    }, 1, "start+=4")
    .to($("html,body"), 3, {
      backgroundColor: "#ad2a66",
      ease: Power4.easeOut
    }, "start+=3")
    .to($("#shadow ellipse"), 3, {
      fill: "#590647",
      ease: Circ.easeOut
    }, "start+=3")
    .to($("#arm1"), 1, {
      rotation: 0,
      transformOrigin: "100% 30%",
      ease: Power2.easeIn
    }, "start+=7")
    .to($("#arm2"), 1, {
      rotation: 0,
      transformOrigin: "0% 30%",
      ease: Power2.easeIn
    }, "start+=7");

  tl.timeScale(1.2);

  return tl;
}

// the second scene
function sceneTwo() {
  var tl = new TimelineMax(),
    sT = new SplitText($t1, {
      type: "chars"
    });

  tl.add("lasers");
  tl.to($features, 1, {
      rotationX: -5,
      x: -10,
      transformOrigin: "50% 50%",
      ease: Power2.easeIn
    }, "lasers")
    .to($("html,body"), 3, {
      backgroundColor: "red",
      ease: Power4.easeOut
    }, "lasers")
    .to($lasers, 0.25, {
      opacity: 1
    }, "lasers+=1")
    .fromTo($lasers, 1.1, {
      drawSVG: '0 0'
    }, {
      drawSVG: true
    }, "lasers+=1")
    .to($lasers, 2, {
      rotation: 0,
      x: 0,
      ease: Power3.easeIn
    }, "lasers+=2")
    .staggerFromTo(sT.chars, 1, {
      scale: 0,
      rotationY: -360
    }, {
      scale: 1,
      rotationY: 0,
      ease: Elastic.easeOut
    }, 0.08, "lasers+=3")
    .to($features, 2, {
      rotationX: 5,
      x: 10,
      transformOrigin: "50% 50%",
      ease: Power3.easeIn
    }, "lasers+=2")
    .fromTo($lasers, 0.75, {
      drawSVG: true
    }, {
      drawSVG: "0 0"
    }, "lasers+=5")
    .to($features, 2, {
      rotationX: 0,
      x: 0,
      transformOrigin: "50% 50%",
      ease: Power3.easeIn
    }, "lasers+=6");

  return tl;
}

var master = new TimelineMax();
master.add(sceneOne(), "scene1")
  .add(sceneTwo(), "scene2", "-=2");

//master.seek("scene2");
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console