123

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="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 977.9 1036.4" enable-background="new 0 0 977.9 1036.4" xml:space="preserve" height="400px">
<path id="morph" fill="none" stroke="black" stroke-miterlimit="10" d="M 343.5 646.6 L 343.5 646.6 C 343.5 646.6 357.2 683.2 355.8 696.8 C 322.1 685.6 319.8 692.8 319.8 692.8 C 319.8 692.8 320.1 698.8 330.1 704.5 C 340.1 710.2 341.1 713.5 341.1 713.5 C 341.1 713.5 327 717.8 319.8 718.5 C 313.6 719.1 299.9 664 300.1 659.5 C 300.2 655.9 302.1 650 301.1 639 C 300.2 629.5 296.1 615.5 292.6 608.5 C 290.1 603.6 276.6 571.5 261.1 557.5 C 254.6 529.5 256.1 473.3 230.1 472.5 C 236.6 497 252.6 525.9 243.1 548 C 240.1 555 192.4 534.3 187.1 541.5 C 179.4 552 238.6 553.5 260.2 576.9 C 286.7 608 291.2 645.5 284.5 650.8 C 279.3 655 228.9 626.3 227.8 628.8 C 225.4 634.2 236.8 645.1 249.8 651.5 C 263.9 658.5 283.8 671 287.8 678.8 C 291.4 685.7 306.6 709.8 299.8 717.5 C 297.1 720.5 253.1 690.5 239.6 681.7 C 230.4 675.7 208.1 652.9 183.6 625.9 C 182.1 604.9 176.8 597.6 173.3 593.6 C 169.8 589.6 151.5 572.8 145.8 569.6 C 140.2 566.5 122.9 559.7 141 576.3 C 162.7 596.3 165.2 621.5 165.2 621.5 C 165.2 621.5 103.2 605.7 116.8 615.9 C 137.7 631.6 144.6 628.5 155.2 632.5 C 171.2 636.9 220.2 676.4 215.9 680.2 C 209.2 686 160.2 697.1 161.3 701 C 162.9 706.8 209.3 693.9 224.3 695.2 C 247.5 697.1 289.3 724.9 287.2 728.2 C 284.8 731.9 267.8 737.7 260.5 740.2 C 255.3 742 235.3 740.9 236.7 746.3 C 238 751.5 257.5 749.2 261.5 748.7 C 269.7 747.7 308.5 736.2 308.5 736.2 C 308.5 736.2 306.8 751.6 301 758.9 C 297.2 763.6 268.9 781.8 295 774.4 C 310.2 770.1 320.2 734.8 323.2 734.2 C 326 733.6 350.9 729.4 352.5 731.2 C 356.2 735.2 360.6 751.5 360.6 751.5 C 363.1 758.6 368.4 767.3 372.7 772.5 C 377.7 784.5 376.6 798.4 379.9 800.7 C 404 798.5 408.9 761.9 415.2 747.5 C 420.5 735.4 420.2 734.9 422.5 728.7 C 424.7 723.1 426.9 720 429.1 713 C 429.8 710.7 430.8 706.8 432 702.4 C 432.6 699.9 435.5 692.5 435.5 692.5 C 436.9 687.4 442.9 674.7 445 671.9 C 446.9 669.4 461.8 640.6 462.2 649.2 C 467.9 647.9 472.2 646.7 474.2 644.9 C 476.7 646.2 481.9 642.3 482.9 644.2 C 484.1 646.4 490.9 645.7 492.6 642.9 C 498.6 646.9 502.7 667 501.2 694.5 C 499.7 722 500.5 770.5 500.2 772.3 C 499.9 774.1 496.4 776.9 494.4 780.1 C 492.4 783.3 491.9 790.6 491.9 790.6 L 486.6 797.6 C 486.6 797.6 515.6 805.8 520.4 800.6 C 525.2 795.4 519.9 779.1 523.7 762.6 C 519.9 747.4 523.2 725.6 528.2 714.1 C 526.9 708.9 528.7 692.1 528.7 692.1 C 525.5 675.3 529.5 648.6 534 634.3 C 540 641.3 538.2 672.8 541 706.1 C 549.8 728.6 549 738.2 550.3 748.4 C 551.6 758.6 554.4 770.1 554.6 777.4 C 554.8 784.7 555.1 788.9 554.3 790.7 C 553.5 792.5 550 801 550 801 L 570.5 801.3 C 570.5 801.3 569 794 572.8 793.3 C 576.6 792.6 581.1 792.3 581.1 789.8 C 581.1 787.3 576.1 777.5 575.1 772.5 C 574.1 767.5 574.6 764.3 575.9 757.5 C 573.1 712 568.9 699.2 568.1 694.2 C 567.3 689.2 568.8 674.4 570.1 663.9 C 571.4 653.4 571.1 644.1 571.9 633.1 C 578.4 633.9 621 628.6 630.2 625.6 C 639.4 622.6 653.9 613.3 665.7 606.3 C 667.2 622.3 693.7 669.8 696.2 677.8 C 698.7 685.8 689 730.3 688.2 740.8 C 687.4 751.3 684.7 775.8 676.9 786.8 C 669.1 797.8 669.9 801.6 669.9 801.6 C 669.9 801.6 680.7 801.6 691.7 801.3 C 691.7 798 692.5 792.5 696 791.5 C 699.5 790.5 706.3 792.6 707.5 791.8 C 708.7 791 704.5 773.2 704.2 767.5 C 703.9 761.8 706.4 760.5 707.7 754.5 C 709 748.5 712 730.4 713 725.2 C 714 720 719.3 682.6 720.6 675.8 C 721.9 669 720.1 665 719.1 648 C 728.9 654.2 747.9 684.5 760.9 686.5 C 760.4 691 761.9 723.5 762.9 731.5 C 763.9 739.5 766.4 781 766.4 782.5 C 766.4 784 762.9 787 759.4 791 C 755.9 795 749.9 809.5 749.9 809.5 L 770.9 809.5 C 770.9 809.5 778.9 800 778.4 796.5 C 777.9 793 783.4 779 785.4 763 C 787.4 747 792.9 700 788.4 676 C 783.9 652 760.4 633.5 758.9 608 C 764.4 590 766.3 564 766.6 555.2 C 766.9 546.3 767.4 542 768.6 542 C 769.7 542 772.8 555.4 776.4 561.3 C 780 567.2 786.7 566.8 788.2 566.5 C 789.7 566.2 792.9 567.4 791.4 549.7 C 789.9 532 769.5 498.2 765.7 494.2 C 761.9 490.2 742.2 480.1 742.2 480.1 C 742.2 480.1 714 467.3 690.7 460.8 C 662.7 452.9 591.7 453 582.7 454.5 C 574.3 455.9 536.5 466.5 523.7 472.5 C 512.4 477.9 492.5 487.5 478.7 501.2 C 468.9 511 438.1 546.6 429.5 566.8 C 422.3 583.7 409.1 618.7 401 635.7 C 392.8 653.1 377.9 681.3 378.5 680.6 C 379.1 679.9 376 671.1 369 661.6 C 361.5 651.4 343.5 646.6 343.5 646.6"/>
<path id="state2" d="M 485.5 367.5 L 485.5 367.5 C 485.5 367.5 467.5 383.5 438.1 387.3 C 444.1 356.5 436.3 351 436.3 351 C 436.3 351 431.5 350.2 427.5 361 C 423.5 371.8 419.7 376.8 419.7 376.8 C 419.7 376.8 409.4 362.3 410.9 356.3 C 412.4 350.3 462.1 329.6 465.4 328 C 468.7 326.4 472.2 328 481.7 326.7 C 491.2 325.4 507.4 319.4 511.7 315.9 C 516 312.4 552.2 284.6 564.5 272.6 C 583 267.6 653.3 244.6 641 231.6 C 594.3 260.1 573 258.9 567 252.4 C 561 245.9 574.7 197.8 566 199.6 C 557.3 201.4 554.3 259.3 544 274.6 C 520.2 306.1 475.5 317.4 471.7 311.9 C 467.9 306.4 486.9 251.9 484.2 251.9 C 481.5 251.9 474.4 259.9 469.2 273.4 C 464 286.9 453 311.6 447.7 317.4 C 442.4 323.2 413.7 338.9 410.9 337.7 C 408.1 336.5 430.4 281.9 434.4 271.7 C 438.4 261.5 460.7 237.5 483.2 207.5 C 509 199.3 515 188.8 519 186 C 523 183.2 533.4 161.2 533.4 161.2 C 533.4 161.2 538.9 140.2 524.6 160.2 C 510.3 180.2 485.8 190.7 485.8 190.7 C 485.8 190.7 495.8 126.6 484 138.9 C 472.2 151.2 474.1 182.8 469.2 189.2 C 462.7 204.9 438.7 248 434.4 248.2 C 430.1 248.4 406.8 195.4 403.1 196.9 C 399.4 198.4 417.4 234.4 418.9 257.6 C 420.4 280.8 400.1 324.9 397.4 324.6 C 394.7 324.3 383.6 306.3 380.4 301.8 C 377.2 297.3 374.1 277.8 371.4 277.5 C 368.7 277.2 371.9 301 372.2 305 C 372.5 309 391.6 348.2 391.6 348.2 C 391.6 348.2 372 345.2 366.8 342.2 C 361.6 339.2 342.8 317.7 349.3 336.7 C 355.8 355.7 392 361.7 394.8 362.7 C 397.6 363.7 404.1 389.1 403.1 391.3 C 402.1 393.5 383.8 402.5 383.8 402.5 C 379 406.2 375.2 410.4 370.8 413.2 C 356.9 421.9 337.8 421.7 338.1 429.7 C 338.6 442.5 360.1 448.5 372.9 450 C 385.8 451.5 393.4 458.3 398.1 463 C 402.8 467.6 403.4 491.3 405.1 501.3 C 406.8 511.3 409.4 521.6 411.8 536.6 C 414.2 551.6 422.5 564.6 422.5 564.6 C 425.1 569.6 438.8 579.3 440.8 581.6 C 442.8 584 456.9 592.5 457.3 601.1 C 469.4 619.7 474.3 619.9 476.3 618.1 C 478.8 619.4 478.8 624.5 479.3 626.7 C 479.8 628.9 482.7 630.5 486.2 627.5 C 492.2 631.5 502.7 667 501.2 694.5 C 499.7 722 500.5 770.5 500.2 772.3 C 499.9 774.1 496.4 776.9 494.4 780.1 C 492.4 783.3 491.9 790.6 491.9 790.6 L 486.6 797.6 C 486.6 797.6 515.6 805.8 520.4 800.6 C 525.2 795.4 519.9 779.1 523.7 762.6 C 519.9 747.4 523.2 725.6 528.2 714.1 C 526.9 708.9 528.7 692.1 528.7 692.1 C 525.5 675.3 529.5 648.6 534 634.3 C 540 641.3 538.2 672.8 541 706.1 C 549.8 728.6 549 738.2 550.3 748.4 C 551.6 758.6 554.4 770.1 554.6 777.4 C 554.8 784.7 555.1 788.9 554.3 790.7 C 553.5 792.5 550 801 550 801 L 570.5 801.3 C 570.5 801.3 569 794 572.8 793.3 C 576.6 792.6 581.1 792.3 581.1 789.8 C 581.1 787.3 576.1 777.5 575.1 772.5 C 574.1 767.5 574.6 764.3 575.9 757.5 C 573.1 712 568.9 699.2 568.1 694.2 C 567.3 689.2 568.8 674.4 570.1 663.9 C 571.4 653.4 571.1 644.1 571.9 633.1 C 578.4 633.9 621 628.6 630.2 625.6 C 639.4 622.6 653.9 613.3 665.7 606.3 C 667.2 622.3 693.7 669.8 696.2 677.8 C 698.7 685.8 689 730.3 688.2 740.8 C 687.4 751.3 684.7 775.8 676.9 786.8 C 669.1 797.8 669.9 801.6 669.9 801.6 C 669.9 801.6 680.7 801.6 691.7 801.3 C 691.7 798 692.5 792.5 696 791.5 C 699.5 790.5 706.3 792.6 707.5 791.8 C 708.7 791 704.5 773.2 704.2 767.5 C 703.9 761.8 706.4 760.5 707.7 754.5 C 709 748.5 712 730.4 713 725.2 C 714 720 719.4 682.6 720.7 675.8 C 722 669 720.2 665 719.2 648 C 729 654.2 748 684.5 761 686.5 C 760.5 691 762 723.5 763 731.5 C 764 739.5 766.5 781 766.5 782.5 C 766.5 784 763 787 759.5 791 C 756 795 750 809.5 750 809.5 L 771 809.5 C 771 809.5 779 800 778.5 796.5 C 778 793 783.5 779 785.5 763 C 787.5 747 793 700 788.5 676 C 784 652 760.5 633.5 759 608 C 764.5 590 766.4 564 766.7 555.2 C 767 546.3 767.5 542 768.7 542 C 769.8 542 772.9 555.4 776.5 561.3 C 780.1 567.2 786.8 566.8 788.3 566.5 C 789.8 566.2 793 567.4 791.5 549.7 C 790 532 769.6 498.2 765.8 494.2 C 762 490.2 752.5 482.5 742.5 482 C 732.5 481.4 720.5 480 691.5 478 C 662.5 476 590.5 480 582 480 C 573.5 480 545.7 483.7 533.5 486.5 C 521.3 489.3 519.5 486.2 506.5 481.5 C 493.5 476.8 484.2 466.5 473 453 C 461.8 439.5 457 424.1 456 422.1 C 455 420.1 451.8 408.3 452.4 407.5 C 453 406.7 464.9 403.6 475.5 396.6 C 486.1 389.6 485.5 367.5 485.5 367.5"/>
</svg>
            
          
!
            
              svg {
  display: block;
  margin: 0 auto;
  overflow: visible;
}
path {
  display: none;
}
path:first-child {
  display: block;
  fill: none;
  stroke-meterlimit: 10;
  stroke: #000;
  stroke-width: 5px;
  stroke-dasharray: 5000px 500px; /* change 500px to 5000px to see other effect */
}
            
          
!
            
              const { autoPlay, Tween, Easing } = TWEEN;

autoPlay(true);

let morph = document.querySelector("#morph");
let toMorph = document.querySelector("#state2");

var animal = new Tween(morph, {
  stroke: "#0cf",
  attr: {
    d: morph.getAttribute("d")
  },
  draw: "0 100%"
})
  .to(
    {
      stroke: "#fc0",
      attr: {
        d: toMorph.getAttribute("d")
      },
      draw: "10% 90%"
    },
    2000
  )
  .easing(Easing.Quadratic.InOut)
  .repeat(Infinity)
  .yoyo(true)
  .start();

            
          
!
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.

Console