Pen Settings



CSS Base

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

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


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.


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.


                <script setup>
// import { gsap } from "gsap";
// import { ScrollTrigger } from "gsap/ScrollTrigger";

// if (process.client) 

let images = gsap.utils.toArray('.image');, {
  xPercent: -100 * (images.length - 1),
  ease: "none",
  scrollTrigger: {
    trigger: '.container',
    // pin: true,
    // had to remove this line as it was causing error "failed to execute 'getcomputedstyle' on 'window': parameter 1 is not of type 'element'."
    scrub: 1,
    snap: 1 / (images.length - 1), 
    end: "+=3500",

  <div class="h-screen overscroll-none bg-[#faedcd] body">
    <div class="h-full overscroll-none w-[600%] bg-[#faedcd] flex flex-nowrap container" ref="container">
      <div class="w-screen text-[60px] image" v-for="x in [1, 2, 3, 4, 5, 6]" ref="image">{{ x }}</div>

<!-- I've used tailwind in my actual app but can't seem to get that to work here so included the exact same styles below too -->
  .body {
    height: 100vh;
    overscroll-behavior: none;
    background-color: #faedcd;
  .container {
    height: 100%;
    overscroll-behavior: none;
    width: 600%;
    background-color: #faedcd;
    display: flex;
    flex-wrap: nowrap;
  .image {
    width: 100vw;
    font-size: 60px;