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

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

              
                <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1500" height="1200" viewBox="0 0 1500 800">
  <defs>
    <style>
      .cls-1 {
        fill: none;
      }

      .cls-2 {
        clip-path: url(#clip-path);
      }

      .cls-3 {
        fill: #ffd266;
      }

      .cls-4, .cls-7 {
        fill: #f2f9f9;
      }

      .cls-5 {
        fill: #badfe3;
      }

      .cls-6 {
        fill: #b3d6da;
      }

      .cls-7 {
        opacity: 0.4;
      }

      .cls-8 {
        fill: #62bcc9;
      }

      .cls-9 {
        fill: #5aadb9;
      }

      .cls-10 {
        fill: #06a7b8;
      }

      .cls-11 {
        fill: #0597a6;
      }

      .cls-12 {
        fill: #0492a0;
      }

      .cls-13 {
        fill: #007d91;
      }
    </style>
    <clipPath id="clip-path">
      <rect class="cls-1" x="4.55" width="3000" height="2952.13" transform="translate(3009.09 2952.13) rotate(180)"/>
    </clipPath>
  </defs>
  <title>Sea background2</title>
  <g class="cls-2">
    <rect class="cls-3" x="4.55" y="-758.28" width="3000" height="5057.99" transform="translate(3009.09 3541.44) rotate(180)"/>
    <path class="cls-4" d="M256.86,756c149.07,2.87,292.65,69.6,438.56,110.31C917,928.09,1148,929.78,1370.13,871.19,1638,800.56,1892.19,643.78,2163.88,607.8c266.13-35.25,532.22,47.46,792.47,129.6,26.09,8.24,53.63,17.52,72.52,42.89,25.53,34.26,28.12,87.51,29.19,135.77q13.41,605.61,26.83,1211.22c6.72,303.64,13.19,611.06-36.66,907.49-16.24,96.57-44,200.95-109.41,247.83-36.05,25.83-78.32,30-119.17,33.56-572.34,50.48-1149.09,100.79-1717.82,1.58-394.06-68.73-784-209.12-1181.32-196.16-39.52-184.44-54.49-378.18-44-569.48,9.75-177.57,41.19-352.52,45.08-530.48,5.6-256.41-46-508.27-98.6-755-11.16-52.38-22.49-107-15.18-160.59,9.12-66.87,47.76-84.89,79.91-127C-77.53,933.57-54,885-11.45,849,67.45,782.16,164.14,754.16,256.86,756Z"/>
    <path class="cls-5" d="M256.86,787.44c149.07,2.84,292.65,68.76,438.56,109C917,957.51,1148,959.18,1370.13,901.3c267.83-69.79,522.06-224.68,793.75-260.23,266.13-34.83,532.22,46.89,792.47,128,26.09,8.14,53.63,17.31,72.52,42.37,25.53,33.86,28.12,86.46,29.19,134.14q13.41,598.33,26.83,1196.66c6.72,300,13.19,603.71-36.66,896.58-16.24,95.41-44,198.53-109.41,244.84-36.05,25.53-78.32,29.61-119.17,33.17-572.34,49.87-1149.09,99.58-1717.82,1.56-394.06-67.91-784-206.61-1181.32-193.8C-119,2942.4-134,2751-123.47,2562c9.75-175.43,41.19-348.28,45.08-524.1,5.6-253.32-46-502.16-98.6-745.95-11.16-51.75-22.49-105.72-15.18-158.66,9.12-66.06,47.76-83.87,79.91-125.44C-77.53,962.92-54,915-11.45,879.34,67.45,813.34,164.14,785.67,256.86,787.44Z"/>
    <path class="cls-6" d="M256.86,849c149.07,2.74,292.65,66.45,438.56,105.32a1341.25,1341.25,0,0,0,674.71,4.72C1638,891.6,1892.19,741.9,2163.88,707.53c266.13-33.66,532.22,45.33,792.47,123.76,26.09,7.87,53.63,16.73,72.52,41,25.53,32.73,28.12,83.57,29.19,129.65q13.41,578.29,26.83,1156.58c6.72,290,13.19,583.5-36.66,866.56-16.24,92.21-44,191.88-109.41,236.64-36.05,24.67-78.32,28.62-119.17,32.06-572.34,48.2-1149.09,96.24-1717.82,1.51-394.06-65.64-784-199.69-1181.32-187.32-39.52-176.12-54.49-361.12-44-543.79,9.75-169.55,41.19-336.62,45.08-506.55,5.6-244.84-46-485.34-98.6-721-11.16-50-22.49-102.18-15.18-153.34,9.12-63.86,47.76-81.06,79.91-121.25C-77.53,1018.61-54,972.25-11.45,937.83,67.45,874,164.14,847.3,256.86,849Z"/>
    <path class="cls-7" d="M-28.69,1166.55c70.32-84,165.26-107.34,254.17-93.93s174,60,258.63,103.63c242.57,125,497.43,229.6,752,187.3,184-30.58,364.57-137.44,548.8-109.82,107.9,16.18,210.41,77.92,316.51,111.92,204.38,65.48,416.06,26.73,624.86,33.54,75.5,2.47,154.93,12.93,217.48,77.4,47.49,49,80.22,124.08,110.11,198.64,77.78,194,146.33,405.39,155.16,632.35,6.92,178-23.41,354.36-59.19,524.16q-49.66,235.66-113.88,463.44c-20.74,73.53-44.95,150.57-89.61,192.72-35.94,33.92-80,40.09-122.24,42-137.86,6.16-275.16-23.74-412.67-39.7-217.66-25.26-436.31-15.57-654.57-10.67-603.78,13.55-1207.63-9.66-1811.28-32.88-25.86-1-54.51-3.74-72.65-31.84-13.14-20.36-17.79-49.84-21.12-77.94-39.25-331.44,30.61-669.1,32.49-1005.88,1.34-240.06-24-476.95-18.23-717.5C-130.06,1453.34-118,1273.27-28.69,1166.55Z"/>
    <path class="cls-8" d="M-28.69,1183.27c70.32-83.39,165.26-106.58,254.17-93.26s174,59.59,258.63,102.9c242.57,124.13,497.43,228,752,186,184-30.36,364.57-136.47,548.8-109,107.9,16.06,210.41,77.37,316.51,111.12,204.38,65,416.06,26.55,624.86,33.31,75.5,2.45,154.93,12.84,217.48,76.85,47.49,48.61,80.22,123.21,110.11,197.24,77.78,192.65,146.33,402.52,155.16,627.87,6.92,176.77-23.41,351.86-59.19,520.46q-49.66,234-113.88,460.16c-20.74,73-44.95,149.5-89.61,191.35-35.94,33.68-80,39.81-122.24,41.68-137.86,6.12-275.16-23.57-412.67-39.42-217.66-25.07-436.31-15.45-654.57-10.59-603.78,13.46-1207.63-9.59-1811.28-32.65-25.86-1-54.51-3.71-72.65-31.61-13.14-20.21-17.79-49.49-21.12-77.38-39.25-329.1,30.61-664.37,32.49-998.77,1.34-238.37-24-473.58-18.23-712.43C-130.06,1468-118,1289.24-28.69,1183.27Z"/>
    <path class="cls-9" d="M-28.69,1210.53c70.32-81.37,165.26-104,254.17-91s174,58.14,258.63,100.4c242.57,121.13,497.43,222.45,752,181.47,184-29.63,364.57-133.17,548.8-106.4,107.9,15.67,210.41,75.49,316.51,108.43,204.38,63.44,416.06,25.9,624.86,32.5,75.5,2.39,154.93,12.53,217.48,75,47.49,47.43,80.22,120.22,110.11,192.46,77.78,188,146.33,392.77,155.16,612.66,6.92,172.48-23.41,343.33-59.19,507.84q-49.66,228.33-113.88,449c-20.74,71.25-44.95,145.89-89.61,186.73-35.94,32.86-80,38.83-122.24,40.66-137.86,6-275.16-23-412.67-38.46-217.66-24.47-436.31-15.08-654.57-10.33-603.78,13.13-1207.63-9.37-1811.28-31.86-25.86-1-54.51-3.62-72.65-30.85-13.14-19.72-17.79-48.29-21.12-75.51-39.25-321.13,30.61-648.27,32.49-974.57,1.34-232.59-24-462.1-18.23-695.17C-130.06,1488.4-118,1313.94-28.69,1210.53Z"/>
    <path class="cls-7" d="M-128.64,2921.69c-21.6-103.88-32.44-215-19-321.88,35.31-281.06,228.8-461.44,417.4-507.52s381.13,6.17,572.22,4.92c162.53-1.06,324.93-41.27,479-118.62,139.75-70.15,273.33-170.82,417.83-214.35,207.1-62.41,421.78-3.11,625.73,79.36s405.25,188.61,615.34,221.87c50.26,8,105.14,14.4,142.06,66.05,48.24,67.47,45.37,181.17,38.89,279.51l-83.79,1271c-2.58,39.17-7.15,83.56-29,105.48-13,13.09-29.56,15-45.24,16.12-197.08,13.94-393.4-35.2-590.19-56.45-347-37.47-695.35,11.88-1043.27,19.67-125.72,2.82-252.73,0-375.14-43-105.93-37.22-206.1-103.7-309.42-154.72C560.4,3507.65,431.61,3468.75,303.19,3430c-90.42-27.29-193.34-32.06-265.73-124.28C-41.46,3205.17-99.57,3070.88-128.64,2921.69Z"/>
    <path class="cls-10" d="M-128.64,2947.4c-21.6-104.81-32.44-216.87-19-324.74,35.31-283.54,228.8-465.51,417.4-512s381.13,6.22,572.22,5c162.53-1.07,324.93-41.64,479-119.68,139.75-70.76,273.33-172.32,417.83-216.24,207.1-63,421.78-3.13,625.73,80.07s405.25,190.28,615.34,223.83c50.26,8,105.14,14.53,142.06,66.63,48.24,68.07,45.37,182.77,38.89,282l-83.79,1282.21c-2.58,39.52-7.15,84.3-29,106.42-13,13.2-29.56,15.13-45.24,16.25-197.08,14.07-393.4-35.5-590.19-56.94-347-37.81-695.35,12-1043.27,19.84-125.72,2.85-252.73,0-375.14-43.39C888.3,3719.06,788.13,3652,684.81,3600.51c-124.41-62-253.2-101.21-381.62-140.31-90.42-27.53-193.34-32.34-265.73-125.38C-41.46,3233.38-99.57,3097.91-128.64,2947.4Z"/>
    <path class="cls-11" d="M-128.64,2944c-21.6-102.46-32.44-212-19-317.47,35.31-277.21,228.8-455.11,417.4-500.56s381.13,6.08,572.22,4.85c162.53-1,324.93-40.71,479-117,139.75-69.18,273.33-168.47,417.83-211.41,207.1-61.55,421.78-3.06,625.73,78.28s405.25,186,615.34,218.83c50.26,7.85,105.14,14.2,142.06,65.14,48.24,66.55,45.37,178.69,38.89,275.68L3077.06,3693.9c-2.58,38.64-7.15,82.41-29,104-13,12.91-29.56,14.8-45.24,15.89-197.08,13.76-393.4-34.71-590.19-55.67-347-37-695.35,11.71-1043.27,19.4-125.72,2.78-252.73,0-375.14-42.42-105.93-36.71-206.1-102.28-309.42-152.6-124.41-60.59-253.2-98.95-381.62-137.18-90.42-26.91-193.34-31.61-265.73-122.58C-41.46,3223.62-99.57,3091.17-128.64,2944Z"/>
    <path class="cls-12" d="M-139,3084.47c-8.59-188.4,66.49-388.08,185.55-442.33,93-42.39,192,4.36,286.39,39,304.62,111.87,629.19,95.48,928.25-46.88,107.15-51,211.38-117.91,321.38-152.17,350.21-109.08,703.05,122.2,1057.75,190.06,107,20.48,215,26,322.76,33.6,24.85,1.76,52.49,5.55,69.09,33.69,14.5,24.61,16.1,60.58,16.47,93.61a3344.38,3344.38,0,0,1-20.71,411.15C3017.34,3338,3002.15,3433,2967.26,3512c-62.32,141.05-176.73,207.24-287.08,234.66-131.11,32.58-265,22.33-397.71,14q-527.05-33.16-1054.76-24.52c-215.92,3.54-432.81,12.25-646.9-30.62-117.45-23.53-233.29-62.44-348.95-101.32C145.12,3575,55.75,3567.61-10.32,3471.05-80.35,3368.73-132.19,3234.05-139,3084.47Z"/>
    <path class="cls-13" d="M-139,3085.23c-8.59-183,66.49-377,185.55-429.74,93-41.18,192,4.25,286.39,37.92,304.62,108.69,629.19,92.76,928.25-45.54,107.15-49.55,211.38-114.55,321.38-147.83,350.21-106,703.05,118.71,1057.75,184.64,107,19.9,215,25.26,322.76,32.65,24.85,1.7,52.49,5.38,69.09,32.73,14.5,23.9,16.1,58.85,16.47,90.94a3157.52,3157.52,0,0,1-20.71,399.44c-10.56,91.07-25.75,183.39-60.64,260.1-62.32,137-176.73,201.35-287.08,228-131.11,31.65-265,21.69-397.71,13.58q-527.05-32.22-1054.76-23.83c-215.92,3.44-432.81,11.91-646.9-29.75-117.45-22.85-233.29-60.66-348.95-98.43-86.74-28.31-176.11-35.48-242.18-129.29C-80.35,3361.39-132.19,3230.55-139,3085.23Z"/>
  </g>
</svg>

              
            
!

CSS

              
                
              
            
!

JS

              
                console.clear(); // Start with a clean console on refesh 
const tl = gsap.timeline({
  repeatRefresh: true, 
  repeat: -1,
  // autoRound: false,
  // onComplete: function () {
  //   tl.invalidate().restart();
  // }
});

/* Wave 1 Y-axis */
const maxY1 = -275;
const minY1 = -75;

/* Wave 2 Y-axis */
const maxY2 = -225;
const minY2 = -50;

/* Wave 1 X-axis */
const max2 = 50;
const min2 = -50;

/* Wave 2 X-axis */
const max2X = -50;
const min2X = 75;

/* Wave 1 Scale */
const maxS1 = 1;
const minS1 = 0.8;

/* Wave 2 Scale */
const maxS2 = 1;
const minS2 = 0.75;
// for (let i = 0; i < 100; i++) {
tl.to(
  "path",
  {
    duration: "random([6, 12])",
    y: random2(minY1, maxY1),
    x: random2(min2, max2),
    autoAlpha: gsap.utils.wrap([0, 0.5, 0.75]),
    scaleX: randomS1(minS1, maxS1),
    ease: "sine.inOut",
    // repeat: 3,
    // repeatDelay: 0.5,
    yoyo: true
  },
);
// }

function randomY1(minY1, maxY1) {
  if (maxY1 == null) {
    maxY1 = minY1;
    minY1 = 0;
  }
  return function () {
    return Math.random() * (maxY1 - minY1) + minY1;
  };
}

function randomY2(minY2, maxY2) {
  if (maxY2 == null) {
    maxY2 = minY2;
    minY2 = 0;
  }
  return function () {
    return Math.random() * (maxY2 - minY2) + minY2;
  };
}

function random2(min2, max2) {
  if (max2 == null) {
    max2 = min2;
    min2 = 0;
  }
  return function () {
    return Math.random() * (max2 - min2) + min2;
  };
}

function random2X(min2X, max2X) {
  if (max2X == null) {
    max2X = min2X;
    min2X = 0;
  }
  return function () {
    return Math.random() * (max2X - min2X) + min2X;
  };
}

function randomS1(minS1, maxS1) {
  if (maxS1 == null) {
    maxS1 = minS1;
    minS1 = 0;
  }
  return function () {
    return Math.random() * (maxS1 - minS1) + minS1;
  };
}

function randomS2(minS2, maxS2) {
  if (maxS2 == null) {
    maxS2 = minS2;
    minS2 = 0;
  }
  return function () {
    return Math.random() * (maxS2 - minS2) + minS2;
  };
}

              
            
!
999px

Console