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="purchase-inner">
                <div class="purchase__items">
                  <div class="purchase__items-inner">
                    <div class="purchase__item-content">
                      <span class="plate text-md-16">step I</span>
                      <h3 class="purchase__item-subtitle subtitle">Make a deposit</h3>
                      <span class="purchase__item-desc__txt text-md-16">
                        For clarity, we will show examples with FTM
                      </span>
                      <p class="purchase__item-text desc-txt">
                        Make a deposit in supported crypto assets (20+) on Midas platform
                      </p>
                    </div>
                    <div class="purchase__item-content">
                      <span class="plate text-md-16">
                        step II
                      </span>
                      <h3 class="purchase__item-subtitle subtitle">
                        Open Midas token share
                      </h3>
                      <p class="purchase__item-text desc-txt">
                        Open MIDAS token share and click on “Swap” button
                      </p>
                    </div>
                    <div class="purchase__item-content">
                      <span class="plate text-md-16">step III</span>
                      <h3 class="purchase__item-subtitle subtitle">
                        Make a swap
                      </h3>
                      <p class="purchase__item-text desc-txt">
                        Swap your crypto to MIDAS token and start earning 30% APY
                      </p>
                      <a class="btn" href="#" target="_blank">
                        Go to platform
                      </a>
                    </div>
                  </div>
                </div>
                <div class="purchase__desc">
                  <div class="purchase__desc-inner">
                    <div class="purchase__img">
                      <img src="https://cataas.com/cat" alt="deposit">
                    </div>
                    <div class="purchase__img">
                      <img src="https://cataas.com/cat/cute" alt="share deposit">
                    </div>
                    <div class="purchase__img">
                      <img src="https://cataas.com/cat/brasileira" alt="swap deposit">
                    </div>
                  </div>
                </div>
              </div>
              
            
!

CSS

              
                .purchase {
  &-inner {
  margin: 100px 0;
    display: grid;
    grid-gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  &__item {
    &-content {
      min-height: 100vh;
      min-height: 100dvh;
    }

    &-desc__txt {
      margin-bottom: 24px;
      display: inline-block;
      color: #000
    }
  }

  &__desc {
    overflow: hidden;
    position: relative;
    max-height: 700px;
    min-height: 700px;
    border-radius: 48px;
    background: #ccc;
  }

  &__img {
    position: absolute;
    left: 10px;
    right: 10px;
    // bottom: -100%;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);
const tl = gsap.timeline();

const purchaseDetails = gsap.utils.toArray(".purchase__item-content:not(:first-child)");
    const purchaseImages = gsap.utils.toArray(".purchase__img:not(:first-child)");
    const purchaseImagesAll = gsap.utils.toArray(".purchase__img");

    tl.set(purchaseImages, {
      yPercent: 100,
    })

    ScrollTrigger.create({
      trigger: ".purchase-inner",
      start: "top 20%",
      end: "bottom bottom",
      pin: ".purchase__desc",
    })

    purchaseDetails.forEach((detail, idx) => {
      const plate = detail.querySelector('.plate');
      // const animPin = gsap.timeline()
      console.log(purchaseDetails);
      tl
        .to(purchaseImages[idx], {
          yPercent: 0,
          duration: 3.7,
        })
        .to(purchaseImages[idx], {
          yPercent: '-100',
          duration: 3.7,
        })
        .set(purchaseImagesAll[idx], {
          autoAlpha: 0,
        })
        ScrollTrigger.create({
          trigger: plate,
          start: "top 40%",
          end: "bottom bottom",
          animation: tl,
          scrub: 3,
        })
    })
              
            
!
999px

Console