Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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 http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="./assets/styles/main.css" />
  <title>Document</title>
</head>

<body>
  <div id="smooth-wrapper">
    <div id="smooth-content">
      <!-- MAIN SECTION-->
      <section id="main-section" class="panel">
        <div>
          <div id="main-content">
            <h1 class="cursor-scale" id="header-name">
              Lorem Ipsum
            </h1>
          </div>
          
<!-- THIS DIV IS RELEVANT FOR THE PROBLEM -->
          <div id="ellipse-group">
            <svg id="blue-ellipse" viewBox="0 0 639 647" fill="none" xmlns="http://www.w3.org/2000/svg">
              <g filter="url(#filter0_d_50_77)">
                <path d="M606.083 152.915C569.262 90.849 511.576 43.6857 442.607 19.2596C373.639 -5.16642 297.539 -5.38508 226.947 18.6399C156.356 42.665 95.5218 89.4877 54.5503 151.331C13.5788 213.174 -5.06431 286.315 1.71762 358.605C8.49955 430.894 40.2984 497.982 91.8321 548.725C143.366 599.467 211.533 630.81 285.01 637.546C358.488 644.283 432.853 626.009 495.754 585.758C558.655 545.508 606.305 485.704 630.79 416.281L591.981 404.054C570.601 464.676 528.992 516.897 474.066 552.044C419.14 587.191 354.204 603.149 290.042 597.266C225.881 591.383 166.357 564.014 121.357 519.706C76.357 475.397 48.5899 416.815 42.6678 353.691C36.7458 290.566 53.0252 226.699 88.8019 172.697C124.579 118.695 177.7 77.8084 239.341 56.8295C300.982 35.8505 367.434 36.0415 427.658 57.3706C487.882 78.6997 538.254 119.883 570.406 174.08L606.083 152.915Z" fill="#699CFF" />
              </g>
              <defs>
                <filter id="filter0_d_50_77" x="0.353424" y="0.779297" width="638.437" height="646.136" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
                  <feFlood flood-opacity="0" result="BackgroundImageFix" />
                  <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
                  <feOffset dx="4" dy="4" />
                  <feGaussianBlur stdDeviation="2" />
                  <feComposite in2="hardAlpha" operator="out" />
                  <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
                  <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_50_77" />
                  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_50_77" result="shape" />
                </filter>
              </defs>
            </svg>
            <svg id="gray-ellipse" viewBox="0 0 704 753" fill="none" xmlns="http://www.w3.org/2000/svg">
              <g filter="url(#filter0_d_50_76)">
                <path d="M0.550837 444.678C18.9051 528.007 63.4944 603.196 126.912 657.755C190.33 712.314 268.76 742.958 349.174 744.599C429.587 746.239 507.145 718.777 568.964 666.774C630.784 614.77 673.144 541.355 689.008 458.723C704.873 376.092 693.287 289.217 656.175 212.529C619.063 135.841 558.66 73.9553 484.997 37.1522C411.334 0.349022 328.846 -9.1569 251.234 10.2134C173.623 29.5837 105.559 76.6643 58.3482 143.635L94.5138 172.657C135.739 114.178 195.173 73.0663 262.944 56.152C330.716 39.2376 402.745 47.5383 467.068 79.6752C531.391 111.812 584.137 165.851 616.543 232.816C648.95 299.781 659.067 375.641 645.213 447.796C631.36 519.951 594.371 584.058 540.39 629.468C486.408 674.878 418.684 698.859 348.466 697.426C278.248 695.993 209.762 669.234 154.385 621.593C99.0075 573.951 60.0716 508.296 44.0445 435.531L0.550837 444.678Z" fill="#A1ADBA" />
              </g>
              <defs>
                <filter id="filter0_d_50_76" x="0.550842" y="0.407715" width="703.381" height="752.261" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
                  <feFlood flood-opacity="0" result="BackgroundImageFix" />
                  <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
                  <feOffset dx="4" dy="4" />
                  <feGaussianBlur stdDeviation="2" />
                  <feComposite in2="hardAlpha" operator="out" />
                  <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
                  <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_50_76" />
                  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_50_76" result="shape" />
                </filter>
              </defs>
            </svg>
            <svg id="hidden-gray-ellipse" viewBox="0 0 563 680" fill="none" xmlns="http://www.w3.org/2000/svg">
              <g filter="url(#filter0_d_24_129)">
                <path d="M432.865 10.4717C375.166 -2.59208 315.365 -2.23737 258.76 11.5045C202.154 25.2463 150.491 51.9511 108.346 89.2534C66.2011 126.556 34.8758 173.304 17.1448 225.357C-0.586219 277.411 -4.17569 333.163 6.69435 387.675C17.5644 442.186 42.5584 493.776 79.4625 537.873C116.367 581.969 164.042 617.213 218.264 640.481C272.487 663.749 331.585 674.324 390.321 671.268C449.058 668.212 505.621 651.621 555 622.963L530.16 586.625C487.041 611.649 437.65 626.137 386.36 628.805C335.071 631.473 283.466 622.239 236.118 601.921C188.77 581.603 147.14 550.829 114.915 512.323C82.6897 473.817 60.8646 428.768 51.3728 381.168C41.8809 333.568 45.0153 284.884 60.4982 239.431C75.9812 193.977 103.335 153.156 140.136 120.583C176.937 88.0103 222.05 64.6914 271.479 52.6919C320.908 40.6924 373.127 40.3826 423.51 51.79L432.865 10.4717Z" fill="#A1ADBA" />
              </g>
              <defs>
                <filter id="filter0_d_24_129" x="0.548645" y="0.92926" width="562.451" height="678.854" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
                  <feFlood flood-opacity="0" result="BackgroundImageFix" />
                  <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
                  <feOffset dx="4" dy="4" />
                  <feGaussianBlur stdDeviation="2" />
                  <feComposite in2="hardAlpha" operator="out" />
                  <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
                  <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24_129" />
                  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_24_129" result="shape" />
                </filter>
              </defs>
            </svg>
            <svg id="red-ellipse" height="1280" viewBox="0 0 1183 1280" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M104.442 104.328C206.919 35.106 331.414 -1.14465 462.183 0.160307C592.952 1.46523 724.123 40.2671 839.108 111.659C954.092 183.051 1047.73 283.827 1108.17 401.243C1168.61 518.659 1193.15 647.442 1178.68 771.305C1164.21 895.168 1111.38 1008.55 1026.87 1097.11C942.36 1185.67 829.969 1245.44 703.908 1268.84C577.848 1292.25 443.779 1278.26 318.656 1228.62C193.533 1178.99 82.9759 1095.95 0.964862 989.999L29.5203 970.711C107.012 1070.82 211.476 1149.28 329.703 1196.18C447.93 1243.08 574.61 1256.31 693.723 1234.19C812.836 1212.07 919.033 1155.6 998.884 1071.92C1078.73 988.238 1128.65 881.106 1142.33 764.069C1156 647.032 1132.82 525.347 1075.7 414.402C1018.59 303.457 930.119 208.235 821.471 140.778C712.824 73.32 588.882 36.6565 465.32 35.4235C341.757 34.1905 224.124 68.4434 127.295 133.851L104.442 104.328Z" fill="#DC2626" />
            </svg>
          </div>
      </section>
    </div>
  </div>
</body>

</html>
              
            
!

CSS

              
                #ellipse-group {
      width: 100%;
      height: 100%;
      z-index: -1;
      position: relative;

      #blue-ellipse {
        position: absolute;
        max-width: 40vw;
        max-height: 70vh;
        top: 13.32vh;
        left: 12.61vw;
        transform: rotate(-5deg);
      }

      #gray-ellipse {
        position: absolute;
        max-width: 40vw;
        max-height: 81vh;
        top: 30.74vh;
        left: -10.09vw;
      }

      .gray-ring {
        position: absolute;
        top: 12em;
        left: 0em;
      }

      #hidden-gray-ellipse {
        position: absolute;
        max-width: 40vw;
        max-height: 70vh;
        top: 102.45vh;
        left: -37.84vw;
        transform: rotate(-80deg);
      }

      #red-ellipse {
        z-index: 1;
        position: absolute;
        max-width: 70vw;
        top: -39.7vh;
        right: -12.61vw;
        transform: rotate(10deg);
      }
 }
              
            
!

JS

              
                function polygons_animation(panel, deg = 180) {
    const tlPolygons = gsap.timeline({
        scrollTrigger: {
            trigger: panel,
            start: "top bottom",
            end: "center top",
            scrub: true,
        },
    });
    tlPolygons
        .to(
            "#yellow-polygon",
            {
                duration: 0.2,
                rotation: deg,
            },
            0
        )
        .to(
            "#blue-polygon",
            {
                duration: 0.2,
                rotation: deg,
            },
            0
        )
        .to(
            "#red-polygon",
            {
                duration: 0.2,
                rotation: deg,
            },
            0
        );

    return tlPolygons;
}

const panelOne = document.querySelector("#panel-one");
const panelTwo = document.querySelector("#panel-two");


//THE IMPORTANT PART OR THE RELEVANT PART STARTS BELOW
// PANEL 1 STARTS
    gsap
        .timeline({
            scrollTrigger: {
                trigger: panelOne,
                start: "top bottom",
                end: "+=100%",
                scrub: true,
            },
        })
        .to(
            "#blue-ellipse",
            {
                x: '54vw',
                y: "154vh",
                rotation: "135deg",
                duration: 1,
            },
            0
        )
        .to(
            "#gray-ellipse",
            {
                x: "-41.67vw",
                y: "85.38vh",
                rotation: "180deg",
                duration: 1,
            },
            0
        )
        .to(
            "#hidden-gray-ellipse",
            {
                x: "33.34vw",
                y: "17.08vh",
                rotation: -345,
                duration: 1,
            },
            0
        )
        .to(
            "#red-ellipse",
            {
                rotate: "180deg",
                // x: "10rem",
                y: "93.917vh",
                duration: 1,
            },
            0
        )
        .to(
            "#polygons",
            {
                x: "-50rem",
                y: "58rem",
                duration: 1,
            },
            0
        )
        .add(polygons_animation(panelOne));
    // PANEL 1 ENDS

    //PANEL 2 STARTS
    gsap
        .timeline({
            scrollTrigger: {
                trigger: panelTwo,
                start: "top bottom",
                end: "+=100%",
                scrub: true
            },
        })
        .to(
            "#blue-ellipse",
            {
                x: "12.5vw",
                y: "256.99vh",
                rotation: "-163deg",
                duration: 1,
            },
            0
        )
        .to(
            "#gray-ellipse",
            {
                x: "4.1667vw",
                y: "196.3714vh",
                rotation: "-180deg",
                duration: 1,
            },
            0
        )
        .to(
            "#red-ellipse",
            {
                rotate: "-180deg",
                x: "-4.3333vw",
                y: "198.079vh",
                duration: 1,
            },
            0
        )
        .to(
            "#hidden-gray-ellipse",
            {
                rotation: -5,
                duration: 1,
            },
            0
        )
        .to(
            "#panel-three-gray-ellipse",
            {
                rotation: 270,
                duration: 1,
            },
            0
        )
        .to(
            "#panel-three-red-ellipse",
            {
                rotation: -220,
                duration: 1,
            },
            0
        )
        .to(
            "#polygons",
            {
                x: "15rem",
                y: "100rem",
                duration: 1,
            },
            0
        )
        .add(polygons_animation(panelTwo, 250));
 // PANEL 2 ENDS
              
            
!
999px

Console