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

              
                <div class="container">
  
  <section class="panel">    
    
    <svg width="2876" height="487" class="svg-1" viewBox="0 0 2876 487" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M0.114258 356.395H707.482C807.613 354.528 865.966 314.948 926.435 227.052C1056.49 38.014 1237.84 -26.7729 1420.84 105.196C1566.11 209.963 1611.81 409.116 1852.61 418H2215.34" stroke="url(#paint0_linear)" stroke-width="70" />
      <path d="M2842.34 335.794L2840.74 340.975L2839.13 346.172L2837.53 351.371L2835.92 356.559L2834.32 361.723L2832.71 366.85L2831.11 371.927L2829.5 376.943L2827.9 381.883L2826.29 386.736L2824.69 391.49L2823.08 396.133L2821.48 400.652L2819.87 405.038L2818.27 409.279L2816.66 413.364L2815.06 417.283L2813.45 421.027L2811.85 424.585L2810.24 427.95L2808.64 431.112L2807.03 434.064L2805.43 436.798L2803.82 439.308L2802.22 441.587L2800.61 443.63L2799.01 445.431L2797.4 446.987L2795.8 448.292L2794.19 449.344L2792.59 450.14L2790.98 450.679L2789.38 450.958L2787.77 450.978L2786.17 450.737L2784.56 450.238L2782.96 449.48L2781.35 448.466L2779.75 447.199L2778.14 445.681L2776.54 443.916L2774.93 441.91L2773.33 439.666L2771.72 437.19L2770.12 434.489L2768.51 431.569L2766.91 428.438L2765.3 425.104L2763.7 421.574L2762.09 417.858L2760.49 413.964L2758.88 409.903L2757.28 405.686L2755.68 401.321L2754.07 396.82L2752.47 392.196L2750.86 387.458L2749.26 382.619L2747.65 377.691L2746.05 372.686L2744.44 367.617L2742.84 362.496L2741.23 357.337L2739.63 352.152L2738.02 346.954L2736.42 341.756L2734.81 336.572L2733.21 331.413L2731.6 326.293L2730 321.225L2728.39 316.222L2726.79 311.295L2725.18 306.458L2723.58 301.722L2721.97 297.099L2720.37 292.601L2718.76 288.239L2717.16 284.024L2715.55 279.966L2713.95 276.075L2712.34 272.362L2710.74 268.836L2709.13 265.505L2707.53 262.377L2705.92 259.462L2704.32 256.765L2702.71 254.293L2701.11 252.053L2699.5 250.051L2697.9 248.29L2696.29 246.777L2694.69 245.514L2693.08 244.505L2691.48 243.752L2689.87 243.257L2688.27 243.021L2686.66 243.045L2685.06 243.329L2683.45 243.872L2681.85 244.673L2680.24 245.73L2678.64 247.04L2677.03 248.599L2675.43 250.405L2673.82 252.452L2672.22 254.735L2670.61 257.249L2669.01 259.987L2667.4 262.943L2665.8 266.109L2664.19 269.477L2662.59 273.039L2660.98 276.786L2659.38 280.708L2657.77 284.796L2656.17 289.039L2654.56 293.427L2652.96 297.949L2651.35 302.594L2649.75 307.35L2648.14 312.205L2646.54 317.147L2644.93 322.163L2643.33 327.242L2641.72 332.369L2640.12 337.534L2638.51 342.722L2636.91 347.921L2635.3 353.117L2633.7 358.299L2632.09 363.452L2630.49 368.563L2628.89 373.621L2627.28 378.613L2625.68 383.525L2624.07 388.346L2622.47 393.064L2620.86 397.667L2619.26 402.143L2617.65 406.481L2616.05 410.671L2614.44 414.701L2612.84 418.562L2611.23 422.244L2609.63 425.739L2608.02 429.036L2606.42 432.128L2604.81 435.008L2603.21 437.668L2601.6 440.101L2600 442.301L2598.39 444.263L2596.79 445.982L2595.18 447.454L2593.58 448.674L2591.97 449.64L2590.37 450.35L2588.76 450.802L2587.16 450.994L2585.55 450.926L2583.95 450.598L2582.34 450.012L2580.74 449.168L2579.13 448.068L2577.53 446.716L2575.92 445.115L2574.32 443.268L2572.71 441.181L2571.11 438.859L2569.5 436.307L2567.9 433.531L2566.29 430.54L2564.69 427.339L2563.08 423.938L2561.48 420.344L2559.87 416.568L2558.27 412.617L2556.66 408.502L2555.06 404.234L2553.45 399.822L2551.85 395.278L2550.24 390.614L2548.64 385.841L2547.03 380.971L2545.43 376.015L2543.82 370.988L2542.22 365.9L2540.61 360.765L2539.01 355.596L2537.4 350.405L2535.8 345.205L2534.19 340.011L2532.59 334.833L2530.98 329.686L2529.38 324.583L2527.77 319.535L2526.17 314.556L2524.56 309.658L2522.96 304.853L2521.35 300.154L2519.75 295.572L2518.14 291.118L2516.54 286.804L2514.93 282.641L2513.33 278.638L2511.72 274.807L2510.12 271.155L2508.51 267.694L2506.91 264.43L2505.3 261.373L2503.7 258.53L2502.09 255.908L2500.49 253.514L2498.88 251.353L2497.28 249.431L2495.68 247.754L2494.07 246.324L2492.47 245.146L2490.86 244.223L2489.26 243.556L2487.65 243.148L2486.05 243L2484.44 243.112L2482.84 243.483L2481.23 244.113L2479.63 245L2478.02 246.142L2476.42 247.536L2474.81 249.179L2473.21 251.066L2471.6 253.194L2470 255.555L2468.39 258.145L2466.79 260.957L2465.18 263.985L2463.58 267.219L2461.97 270.654L2460.37 274.279L2458.76 278.085L2457.16 282.064L2455.55 286.206L2453.95 290.499L2452.34 294.934L2450.74 299.498L2449.13 304.182L2447.53 308.972L2445.92 313.858L2444.32 318.826L2442.71 323.865L2441.11 328.961L2439.5 334.103L2437.9 339.277L2436.29 344.47L2434.69 349.669L2433.08 354.862L2431.48 360.035L2429.87 365.176L2428.27 370.271L2426.66 375.308L2425.06 380.274L2423.45 385.157L2421.85 389.945L2420.24 394.626L2418.64 399.187L2417.03 403.618L2415.43 407.907L2413.82 412.044L2412.22 416.019L2410.61 419.821L2409.01 423.441L2407.4 426.87L2405.8 430.099L2404.19 433.121L2402.59 435.927L2400.98 438.511L2399.38 440.867L2397.77 442.988L2396.17 444.868L2394.56 446.505L2392.96 447.892L2391.35 449.028L2389.75 449.908L2388.14 450.531L2386.54 450.895L2384.93 451L2383.33 450.845L2381.72 450.43L2380.12 449.757L2378.51 448.826L2376.91 447.642L2375.3 446.205L2373.7 444.521L2372.09 442.593L2370.49 440.426L2368.88 438.026L2367.28 435.398L2365.68 432.549L2364.07 429.486L2362.47 426.217L2360.86 422.75L2359.26 419.094L2357.65 415.258L2356.05 411.251L2354.44 407.083L2352.84 402.765L2351.23 398.308L2349.63 393.723L2348.02 389.021L2346.42 384.213L2344.81 379.313L2343.21 374.332L2341.6 369.283L2340 364.178L2338.39 359.03L2336.79 353.852L2335.18 348.657L2333.58 343.457L2331.97 338.267L2330.37 333.098L2328.76 327.964L2327.16 322.878L2325.55 317.852L2323.95 312.899L2322.34 308.031L2320.74 303.261L2319.13 298.599L2317.53 294.059L2315.92 289.651L2314.32 285.387L2312.71 281.276L2311.11 277.33L2309.5 273.558L2307.9 269.969L2306.29 266.573L2304.69 263.378L2303.08 260.393L2301.48 257.623L2299.87 255.077L2298.27 252.761L2296.66 250.68L2295.06 248.84L2293.45 247.245L2291.85 245.9L2290.24 244.807L2288.64 243.97L2287.03 243.39L2285.43 243.069L2283.82 243.009L2282.22 243.207L2280.61 243.666L2279.01 244.383L2277.4 245.356L2275.8 246.583L2274.19 248.061L2272.59 249.787L2270.98 251.755L2269.38 253.962L2267.77 256.401L2266.17 259.066L2264.56 261.952L2262.96 265.05L2261.35 268.353L2259.75 271.852L2258.14 275.539L2256.54 279.405L2254.93 283.44L2253.33 287.633L2251.72 291.975L2250.12 296.455L2248.51 301.061L2246.91 305.781L2245.3 310.605L2243.7 315.52L2242.09 320.513L2240.49 325.573L2238.88 330.686L2237.28 335.84L2235.68 341.022L2234.07 346.218L2232.47 351.417L2230.86 356.605L2229.26 361.768L2227.65 366.895L2226.05 371.972L2224.44 376.987L2222.84 381.926L2221.23 386.779L2219.63 391.532L2218.02 396.173L2216.42 400.692L2214.81 405.077L2213.21 409.316L2211.6 413.4L2210 417.317L2208.39 421.059L2206.79 424.616L2205.18 427.979L2203.58 431.139L2201.97 434.089L2200.37 436.821L2198.76 439.329L2197.16 441.606L2195.55 443.647L2193.95 445.446L2192.34 446.999" stroke="url(#paint1_linear)" stroke-width="70" />
      <path d="M229.714 356.395H688.91C789.041 354.528 847.394 314.948 907.863 227.052C1037.91 38.014 1219.27 -26.7729 1402.27 105.196" stroke="url(#paint2_linear)" stroke-width="70" />
      <defs>
        <linearGradient id="paint0_linear" x1="2087.84" y1="82.0002" x2="41.3491" y2="60.4901" gradientUnits="userSpaceOnUse">
          <stop stop-color="#35DE79" />
          <stop offset="0.357931" stop-color="#0B48CB" stop-opacity="0.622166" />
          <stop offset="1" stop-color="#0B48CB" stop-opacity="0" />
        </linearGradient>
        <linearGradient id="paint1_linear" x1="2257.39" y1="432.653" x2="3319.89" y2="437.888" gradientUnits="userSpaceOnUse">
          <stop stop-color="#35DE79" />
          <stop offset="0.378507" stop-color="#0B48CB" stop-opacity="0.622166" />
          <stop offset="1" stop-color="#0B48CB" stop-opacity="0" />
        </linearGradient>
        <linearGradient id="paint2_linear" x1="1526" y1="63.0001" x2="333.162" y2="88.7703" gradientUnits="userSpaceOnUse">
          <stop offset="0.184668" stop-color="#3580DE" />
          <stop offset="0.650834" stop-color="#0B48CB" stop-opacity="0.622166" />
          <stop offset="1" stop-color="#0B48CB" stop-opacity="0" />
        </linearGradient>
      </defs>
    </svg>
    
  </section>
  <section class="panel">
    TWO
  </section>
  <section class="panel">
    THREE
  </section>
  <section class="panel">
    FOUR
  </section>

</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

.container {
  width: 600%;
  max-height: 100vh;
  display: flex;
  flex-wrap: nowrap;
}

.panel {
	width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 1.5em;
  text-align: center;
  color: white;
  position: relative;
  box-sizing: border-box;
  padding: 10px;
}


.panel:nth-child(odd) {
  background-color: #333;
}

.panel:nth-child(even) {
  background-color: #666;
}

.svg-1 {
  position: absolute;
  inset: 0;
  width: 100vw;
  max-height: 100vh;
  //left: 60%;
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const sections = gsap.utils.toArray(".panel");

gsap.to(sections, {
  xPercent: -100 * (sections.length - 1),
  ease: "none",
  scrollTrigger: {
    trigger: ".container",
    pin: true,
    scrub: true,
    end: () => "+=" + document.querySelector(".container").offsetWidth
  }
});

const drawLine = (line, i) => {
  const container = sections[i];
  return gsap.from(line, {
    drawSVG: 0,
    scrollTrigger: {
      start: () => container.offsetLeft,
      end: () => `+=${container.offsetWidth}`,
      scrub: true
    }
  });
};

const svgs = gsap.utils.toArray("svg path");
svgs.forEach(drawLine);

              
            
!
999px

Console