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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <svg id="turtle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1056.24 831.62">
  <path id="back-leg-dk" d="M414.24,596.78s-11.8,45.38-42.86,68.21-62.49,39.09-64,43.55-21.59-90.19,12.08-135.64S414.24,596.78,414.24,596.78Z" transform="translate(-122.76 -11.18)" fill="#91932b"/>
  <path d="M777.24,378.89s15.89,5.3,21.2,22.55-33.1,147-62.27,157.63-59.62-116.51-38.38-145.74S777.24,378.89,777.24,378.89Z" transform="translate(-122.76 -11.18)" fill="#bf792a"/>
  <g id="front-leg-dk">
    <path d="M744.12,531.29S802.42,563,809,606.71s-10.56,119.19-3.94,125.87-39.72,1.3-68.89-33.1S674,589.57,680.59,564.35,744.12,531.29,744.12,531.29Z" transform="translate(-122.76 -11.18)" fill="#9e9e36"/>
    <path class="cls-4" d="M572.37 601.56L574.17 600.7 583.21 619.77 581.39 620.68 572.37 601.56 572.37 601.56zM594.41 649.77L596.25 648.91 605.25 667.99 603.49 668.85 594.41 649.77 594.41 649.77zM610.6 675.07L612.19 673.84 625.21 689.85 623.64 691.12 610.6 675.07 610.6 675.07zM587.44 612.69L589.2 611.67 597.23 625.74 595.46 626.76 587.44 612.69 587.44 612.69zM595.42 633.65L597.3 632.86 604.31 649.95 602.43 650.71 595.42 633.65 595.42 633.65z"/>
  </g>
  <g id="front-leg-lt">
    <path class="cls-5" d="M652.76,610.76S630.21,712.7,575.89,759s-143,70.18-149.65,82.11-27.8-42.35,1.37-101.91c29-59.59,77.5-143.55,105.39-154.23S652.76,602.8,652.76,610.76Z" transform="translate(-122.76 -11.18)"/>
    <path class="cls-6" d="M348.44 652.87L358.48 632.82 360.3 633.68 350.24 653.82 348.44 652.87 348.44 652.87zM336.37 682.15L344.39 659.06 346.3 659.68 338.24 682.8 336.37 682.15 336.37 682.15zM323.29 710.24L330.3 690.18 332.21 690.82 325.17 710.92 323.29 710.24 323.29 710.24zM308.18 740.53L313.21 721.46 315.16 721.96 310.09 741.05 308.18 740.53 308.18 740.53zM297.26 777.35L303.08 752.97 305.01 753.43 299.2 777.82 297.26 777.35 297.26 777.35zM350.39 668.06L357.43 648.98 359.36 649.71 352.31 668.78 350.39 668.06 350.39 668.06zM323.36 725.15L333.41 706.08 335.17 707.05 325.17 726.13 323.36 725.15 323.36 725.15zM340.36 715.33L345.34 696.28 347.28 696.79 342.29 715.86 340.36 715.33 340.36 715.33z"/>
  </g>
  <path id="back-leg-lt" class="cls-5" d="M333.54,593.56s-22.58,41.08-58.3,55.58-70.18,22.54-72.78,26.48c-2.75,4,1.23-92.72,45-128.51S333.54,593.56,333.54,593.56Z" transform="translate(-122.76 -11.18)"/>
  <g id="head">
    <path class="cls-5" d="M736.17,422.61s36.59,14.17,95.41-7.08c72.28-26.1,88.8-63.76,162.63-56.2,78.35,8,182.88,62.7,184.75,106.4,1.4,33.17-37.15,119.88-71.92,137.07-25.17,12.45-128.36,34.41-162.84,22.51s-91.43-45-118-54.31-72.78-18.54-96.63-19.88S704.41,451.78,736.17,422.61Z" transform="translate(-122.76 -11.18)"/>
    <path class="cls-6" d="M741.16 546.07l.07-2s20 1 24.33 2h0l-.55 2c-3.68-.94-23.85-2-23.85-2zM775.13 549l.36-1.92c.09 0 17 2.94 21.4 5.06h0L796 554c-3.62-1.89-20.53-4.89-20.82-5zm0 0v0zM804.12 554.06l.65-1.92c.06 0 18 6 22.19 8.06h0l-.91 1.8c-3.78-1.91-21.6-7.88-21.93-7.94zm0 0v0h0v0zM837.11 565h0l.87-1.8c.07 0 20 10 24.29 13.16h0l-1.23 1.55c-3.84-2.82-23.93-12.91-24-12.91z" transform="translate(-122.76 -11.18)"/>
    <path class="cls-6" d="M747.5 570.88L748.37 569.1 768.47 579.16 767.6 580.96 747.5 570.88 747.5 570.88z"/>
    <path class="cls-6" d="M767 538.76c-4.73 0-8.67.3-8.74.3h0l-.11-2s4.08-.25 8.85-.25h0c4.85 0 10.34.25 13.59 1.3h0L780 540c-2.75-.93-8.29-1.23-13-1.23zM791.11 542l.58-2s19.08 6.05 23 7.05h0l-.53 1.92c-4.1-1-23.1-7-23.1-7zM823.09 549l.84-1.8c.07 0 21.06 10 24.25 12.13h0L847.09 561c-2.82-1.89-23.57-11.82-24-12zm0 0h0l0 0v0z" transform="translate(-122.76 -11.18)"/>
    <g id="eyel">
      <circle cx="830.11" cy="398.27" r="15.39"/>
      <path class="cls-7" d="M952.07,413.1a5.27,5.27,0,1,1-5.28-5.23A5.28,5.28,0,0,1,952.07,413.1Z" transform="translate(-122.76 -11.18)"/>
    </g>
    <g id="eyer">
      <path d="M1108.57,399.74a14.61,14.61,0,1,1-14.61-14.6A14.61,14.61,0,0,1,1108.57,399.74Z" transform="translate(-122.76 -11.18)"/>
      <path class="cls-7" d="M1093.12,401.36a5.25,5.25,0,1,1-5.22-5.24A5.24,5.24,0,0,1,1093.12,401.36Z" transform="translate(-122.76 -11.18)"/>
    </g>
    <g class="cheeks">
      <circle cx="810" cy="460" r="25" />
      <circle cx="1010" cy="460" r="25" />
    </g>
        <path id="mouth" d="M984,512s44,106,99,14" transform="translate(-122.76 -11.18)" stroke="#843323" stroke-linecap="round" stroke-width="3" opacity=".5" fill="none" stroke-miterlimit="10"/>
      <ellipse id="mouth2" class="cls-8" cx="914.24" cy="533.82" rx="16.69" ry="17.5" stroke="#843323" stroke-linecap="round" stroke-width="3" opacity=".5" fill="none" stroke-miterlimit="10"/></g>
    </g>
    
  <path d="M795.88,392.07s-96.81,66.24-59.71,167c0,0-35.92,111.5-316.51,75.57C234.19,610.76,172,490.2,172,490.2s44.05-119.74,89.26-173c100.37-118.49,202-127.78,313.26-118.49S766.61,324.57,795.88,392.07Z" transform="translate(-122.76 -11.18)" fill="#c77729"/>
  <path d="M677.08,363.75a432.39,432.39,0,0,1,55.41-62.17c1.59-1.52,3.18-2.89,4.7-4.23A359.43,359.43,0,0,0,710,267.72,468.65,468.65,0,0,0,644.71,340c-44,60-88.22,150.06-88.22,268,0,10.66.39,21.5,1.16,32.67,14.46-.91,27.68-2.35,40-4.19q-1-14.53-.94-28.48C596.72,500.35,636.79,418.93,677.08,363.75ZM748,311a262.33,262.33,0,0,0-29.64,28.77c-33.53,38.09-67.08,99.42-66.92,187.2,0,28.26,3.39,59.09,11.13,92.81a184.07,184.07,0,0,0,36.93-19.38A366.88,366.88,0,0,1,691.54,527c.11-77.52,28.59-128.15,57-160.72a224,224,0,0,1,22.15-21.83C763.93,333.42,756.34,322.14,748,311ZM573,333.27a828.58,828.58,0,0,1,73.83-85.94c6.51-6.6,12.18-12.18,17.1-16.76a221.66,221.66,0,0,0-37.66-19.48,870.77,870.77,0,0,0-85.5,98.18c-56.25,75.79-113.78,180.2-114,296.28,0,9.94.43,20,1.38,30.07,14.24,1.7,28,3.1,40.94,4.08a293.54,293.54,0,0,1-2.19-34.15C466.64,503.32,519.19,405.34,573,333.27Zm-232.89-14c11.9-32.64,23.85-60.6,32.75-80.38,2.89-6.33,5.35-11.59,7.44-16.08a295.37,295.37,0,0,0-60.14,36.9C291.26,329.67,253,440.51,252.7,539.63a333.11,333.11,0,0,0,1.8,35.24,341.21,341.21,0,0,0,45.33,25.74c-4.74-18.55-7-39.11-7-61C292.74,468.19,316.24,384.37,340.08,319.29Zm120.82-.14a1082.76,1082.76,0,0,1,61.43-98.75c6.91-9.81,12.77-17.8,17.35-23.92a495.45,495.45,0,0,0-49.84.29,1134,1134,0,0,0-64.17,103.08c-46.26,84.59-93.4,196.84-93.54,310.37,0,1.22.07,2.48.07,3.71A399.34,399.34,0,0,0,372.65,626c-.23-5.28-.41-10.56-.41-15.79C372.1,508.05,416.13,400.49,460.9,319.15ZM228.48,366.23C213,393.77,199.21,424,189.05,447.7c-.72,21.35-1.34,44.3-1.41,65.66a283.64,283.64,0,0,0,40.84,41.93c-.47-10.16-.73-22.06-.73-35,0-65.67,5.4-153.59,5.35-153.73Z" transform="translate(-122.76 -11.18)" fill="#b45228"/>
  <path class="cls-11" d="M182.09,490.34l1.68-1s10.09,17.07,16.81,21.8h0l-1.15,1.62c-7.37-5.35-17.34-22.33-17.34-22.4Z" transform="translate(-122.76 -11.18)"/>
  <path class="cls-11" d="M147.98 560.79L149.09 559.13 175.22 576.2 174.1 577.86 147.98 560.79 147.98 560.79zM229.61 600.11L230.12 598.17 264.23 607.2 263.73 609.14 229.61 600.11 229.61 600.11zM318.16 615.19L347.28 614.21 347.37 616.15 318.26 617.2 318.16 615.19 318.16 615.19zM359.36 617.2L359.43 615.19 392.53 617.2 392.46 619.23 359.36 617.2 359.36 617.2zM406.42 618.22L433.58 614.21 433.8 616.15 406.74 620.21 406.42 618.22 406.42 618.22zM484.62 609.23L516.74 600.15 517.28 602.11 485.19 611.14 484.62 609.23 484.62 609.23zM569.62 577.27L594.73 557.17 595.93 558.77 570.85 578.82 569.62 577.27 569.62 577.27zM82.48 489.31L84.01 488.04 100.08 507.13 98.57 508.43 82.48 489.31 82.48 489.31zM105.72 516.56L106.95 514.97 125.06 529.03 123.83 530.65 105.72 516.56 105.72 516.56zM168.17 563.93L169.04 562.06 192.1 572.11 191.3 573.91 168.17 563.93 168.17 563.93zM210.46 583.31L211.1 581.36 235.18 589.13 234.6 591.04 210.46 583.31 210.46 583.31zM250.62 593.07L251.23 591.11 280.35 600.19 279.78 602.06 250.62 593.07 250.62 593.07zM293.94 601.13L294.31 599.14 324.44 604.16 324.08 606.15 293.94 601.13 293.94 601.13zM336.3 602.13L366.36 601.13 366.44 603.15 336.3 604.13 336.3 602.13 336.3 602.13zM376.42 605.18L376.53 603.15 411.61 605.18 411.54 607.16 376.42 605.18 376.42 605.18zM425.49 605.18L450.58 601.17 450.9 603.15 425.82 607.16 425.49 605.18 425.49 605.18zM507.7 593.14L533.84 585.12 534.38 587.03 508.25 595.09 507.7 593.14 507.7 593.14zM545.55 579.23L564.63 565.16 565.79 566.8 546.74 580.89 545.55 579.23 545.55 579.23zM102.76 496.55L103.92 494.88 126.03 510.96 124.88 512.58 102.76 496.55 102.76 496.55zM157.99 543.74L159.13 542.08 178.23 555.16 177.07 556.78 157.99 543.74 157.99 543.74zM190.22 561.88L191.16 560.07 215.27 572.14 214.36 573.91 190.22 561.88 190.22 561.88zM229.54 576.98L230.2 575.07 255.27 583.12 254.63 585.01 229.54 576.98 229.54 576.98zM267.78 587.06L268.21 585.08 294.31 590.11 293.94 592.09 267.78 587.06 267.78 587.06zM444.53 588.08L466.61 584.07 466.98 586.06 444.94 590.07 444.53 588.08 444.53 588.08zM481.65 582.08L508.77 576.08 509.2 578.03 482.09 584.07 481.65 582.08 481.65 582.08z"/>
  <path class="cls-11" d="M210.13,474.15h0l1.84-.73s7.34,18.26,9.72,19.59h0l-1.15,1.66c-3.69-2.67-10.31-20.42-10.41-20.52Z" transform="translate(-122.76 -11.18)"/>
  <path class="cls-11" d="M78.34 423.72L80.21 423.14 87.22 446.24 85.31 446.85 78.34 423.72 78.34 423.72zM127.69 502.42L129.15 501.01 145.22 517.06 143.81 518.51 127.69 502.42 127.69 502.42zM152.85 524.57L154.23 523.07 169.26 536.14 167.96 537.63 152.85 524.57 152.85 524.57z"/>
  <g id="bubbles" fill="#66a9b2">
    <circle id="bubble5" cx="87.24" cy="317.82" r="18.5" opacity=".65"/>
    <circle id="bubble6" cx="84.24" cy="293.82" r="15" opacity=".55"/>
    <circle id="bubble4" cx="64.24" cy="331.82" r="23" opacity=".53"/>
    <circle id="bubble2" cx="44.24" cy="293.82" r="15" opacity=".76"/>
    <circle id="bubble1" cx="26.74" cy="332.32" r="14.5" opacity=".77"/>
    <circle id="bubble3" cx="63.74" cy="313.32" r="19.5" opacity=".41"/>
  </g>
  <g id="bstrings">
    <path id="bstring2" class="cls-18" d="M167,305s32-62-3-109-39-66-12-106,0-68,0-68" transform="translate(-122.76 -11.18)"/>
    <path id="bstring6" class="cls-18" d="M205.53,298s43-43.48,23-53.48-52-34-28-57,42-26,21-50-33-35-16-72,16-54,16-54" transform="translate(-122.76 -11.18)"/>
    <path id="bstring5" class="cls-18" d="M212.87,329s68.63-61.5,20.63-106.5-11-100-11-100,27-34,16-59-33-52-33-52" transform="translate(-122.76 -11.18)"/>
    <path id="bstring3" class="cls-18" d="M186.5,319.5s25-37,13-52-21-28-8-47,21-50,0-72,3-69,3-69,15-37-14-55" transform="translate(-122.76 -11.18)"/>
    <path id="bstring4" class="cls-18" d="M186.5,343.5s46-59,26-76-42-32-30-56,36-33,22-54-42-43-27-65,18-44,20-79" transform="translate(-122.76 -11.18)"/>
    <path id="bstring1" class="cls-18" d="M149.5,343.5s-38-60-22-79,44-46,30-69-47-71-29-101,17-63,10-79" transform="translate(-122.76 -11.18)"/>
  </g>
</svg>

<a href="https://greensock.com"><img class="gsap-3-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-3-logo.svg" width="150" /></a>
            
          
!

CSS

            
              body {
  background: #357e84;
}

svg {
  width: 80vw;
  height: 80vh;
  margin: 10vh 10vw;
}

#bstrings {
  opacity: 0;
}

.cheeks circle {
  fill: #e05e5c;
  opacity: 0;
}

#mouth2 {
  opacity: 0;
}

.cls-4 {
  fill: #45720a;
}
.cls-5 {
  fill: #a6af37;
}
.cls-6 {
  fill: #578e17;
}
.cls-7 {
  fill: #fff;
}
.cls-18 {
  fill: none;
  stroke-miterlimit: 10;
}
.cls-11 {
  fill: #912b0c;
}
.cls-18 {
  stroke: #66a9b2;
}

.gsap-3-logo {
  width: 20vw;
  max-width: 150px;
  position: fixed;
  bottom: 15px;
  right: 15px;
}
            
          
!

JS

            
              const stepDuration = 0.5,
      bklegs = '#front-leg-dk, #back-leg-dk',
      frlegs = '#front-leg-lt, #back-leg-lt'

// walking cycle
gsap.set(bklegs, {
  transformOrigin: "50% 0%",
  rotation: 15
})

gsap.set(frlegs, {
  transformOrigin: "50% 0%",
  rotation: -10
})

const walk = () => {
  gsap
    .timeline({
      repeat: -1,
      defaults: { ease: "circ.inOut", duration: stepDuration }
    })
    .add('start')
    .to(bklegs, { rotation: -15 })
    .to(bklegs, { rotation: 15 })
    .to(frlegs, { rotation: 10 }, 'start')
    .to(frlegs, { rotation: -10 }, `start+=${stepDuration}`)
}

// bouncing cycle
gsap.set('svg', {
  y: -2
})

const bounce = () => {
  gsap
    .timeline({
      repeat: -1,
      defaults: { duration: 0.25 }
    })
    .add('bouncest')
    .to('svg', { y: 2 })
    .to('svg', { y: -2 }, 'bouncest+=0.25' )
}

// blink
gsap.set('#eyer, #eyel', {
  transformOrigin: "50% 50%",
})

const blink = () => {
  gsap
    .timeline({
      repeat: -1,
      repeatDelay: 1.5,
      defaults: { ease: "circ", duration: 0.1 }
    })
    .add('blink')
    .to('#eyer, #eyel', { scaleY: 0 })
    .to('#eyer, #eyel', { scaleY: 1 })
}

//farts
gsap.registerPlugin(MotionPathPlugin);
const bubcircle = document.querySelectorAll('#bubbles circle')

gsap.set(`#bubbles`, {
  x: -230,
  y: -200
})

const bubbles = () => {
  bubcircle.forEach((el, i) => {
    gsap.to(el, { 
      scale: 0.4, 
      opacity: 0, 
      repeat: -1,
      ease: "circ", 
      duration: 6,
      stagger: 0.05,
      motionPath:{
        path: `#bstring${i + 1}`
      }
    })
  })
}

// fartreaction
const fartDur = 0.5

const fartreaction = () => {
  gsap
    .timeline({
      repeat: -1,
      repeatDelay: 5,
      defaults: { ease: 'back', duration: fartDur }
    })
    .add('fart')
    .to('.cheeks circle', { opacity: 0.5 }, 'fart')
    .to('.cheeks circle', { opacity: 0 }, `fart+=${fartDur}`)
    .to('#head', { x: -20 }, 'fart')
    .to('#head', { x: 0 }, `fart+=${fartDur}`)
    .to('#mouth', { opacity: 0, duration: 0.01 }, 'fart')
    .to('#mouth2', { opacity: 0.5, duration: 0.01 }, 'fart')
    .to('#mouth', { opacity: 0.5, duration: 0.01 }, `fart+=${fartDur}`)
    .to('#mouth2', { opacity: 0, duration: 0.01 }, `fart+=${fartDur}`)
}

window.onload = () => {
	walk()
  bounce()
  blink()
  bubbles()
  fartreaction()
};
            
          
!
999px

Console