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

              
                <section class="our-quotes-gsap">
    <div class="content">
        <div class="row">
            <div class="col">
                <div class="quote-articles">
                    <div class="quote-article quote-article-1" 
                         data-quote_text="Creativity is at the heart of all that we do. We develop in our children the skills and capacity to be innovative, intellectually nimble and independent in thought with a genuine joy of learning." 
                         data-quote_author="Student Name, Year" 
                         style="background-image: url(https://t4.ftcdn.net/jpg/04/09/70/87/360_F_409708782_HxuxOH8f7xSmj5p4ygbAbuJE74vGGj2N.jpg);"></div>
                  
                    <div class="quote-article quote-article-2" 
                         data-quote_text="Lorem Ipsum dolor sit amet" 
                         data-quote_author="Student Name, Year" 
                         style="background-image: url(https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg);"></div>
                  
                    <div class="quote-article quote-article-3" 
                         data-quote_text="lorem Ipsum" 
                         data-quote_author="Student Name, Year" 
                         style="background-image: url(https://static.vecteezy.com/system/resources/previews/001/849/553/original/modern-gold-background-free-vector.jpg);"></div>
                </div>
            </div>
            <div class="col quotes-wrapper">
                <svg width="48" height="43" viewBox="0 0 48 43" fill="white" xmlns="http://www.w3.org/2000/svg">
                    <path d="M29.5579 43V23.3812L42.4421 0L48 3.22499L39.4105 23.65V24.9938H46.4842V43H29.5579ZM0 43V23.3812L12.8842 0L18.4421 3.22499L9.85263 23.65V24.9938H16.9263V43H0Z" fill="white"></path>
                </svg>
                <div class="quote">
                    Creativity is at the heart of all that we do. We develop in our children the skills and capacity to be innovative, intellectually nimble and independent in thought with a genuine joy of learning.
                </div>
                <div class="author">
                    Student Name, Year
                </div>
                <div class="indicators">
                    <li class="active">&nbsp;</li>
                    <li>&nbsp;</li>
                    <li>&nbsp;</li>
                </div>
            </div>
        </div>
    </div>
</section>
              
            
!

CSS

              
                $red: rgba(230, 62, 45);
$white: #fff;

section.our-quotes-gsap {
  background: linear-gradient(180deg, rgba(83, 86, 90, 0.5) -24.09%, rgba(213, 210, 210, 0) 58.11%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    height: clamp(600px, 52.08vw, 1000px);
    .content {
      height: 100%;
      width: 100vw;
      max-width: 2000px;
      margin: 0 auto;
      position: relative;
      .row {
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;
        .col {
          position: relative;
          height: 100%;
          &:first-child {
            width: 60%;
            z-index: 2;
            padding: clamp(25px, 2.604vw, 50px);
          }
          &.quotes-wrapper {
            width: 40%;
            background-color: $red;
            padding: 125px clamp(20px, 2.604vw, 50px);
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            .quote {
              padding: 30px 0;
              font-size: clamp(24px, 1.7vw, 30px);
              font-weight: 300;
              color: white;
              line-height: 1.25;
              width: 75%;
            }
            .author {
              font-size: clamp(16px, 1.08vw, 20px);
              font-weight: 700;
              margin-bottom: clamp(40px, 5.208vw, 100px);
              color: white;
            }
            .indicators {
              list-style: none;
              padding: 0;
              margin: 0;
              display: flex;
              align-items: center;
              gap: 10px;
              li {
                padding: 0;
                margin: 0;
                width: 14px;
                height: 13px;
                background: rgba(255,255,255,0.6);
                border-radius: 50%;
                &.active {
                  width: 20px;
                  height: 20px;
                  background: white;
                }
              }
            }
            &:before {
              position: absolute;
              top: 0;
              left: -200px;
              width: 200px;
              height: 100%;
              content: '';
              background-color: $red;
              z-index: 1;
            }
            &:after {
              position: absolute;
              top: 0;
              left: 0;
              width: 1px;
              height: 170px;
              content: '';
              background-color: $white;
              z-index: 1;
            }
            svg {
              fill: white;
              path {
                fill: white;
              }
            }
          }
        }
        .quote-articles {
          height: clamp(500px, 41.66vw, 800px);
          .quote-article {
            width: 100%;
            height: clamp(500px, 41.66vw, 800px);
            border-radius: 20px;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
          }
        }
      }
    }
}
              
            
!

JS

              
                $(document).ready(function () {
    let quoteHeight = parseInt($(".quote-article-1").outerHeight());
    let endPos = quoteHeight * 3;

    const timeline = gsap.timeline({
        defaults: {
            ease: "none"
        },
        // scrollTrigger: {
        //     trigger: ".our-quotes-gsap",
        //     pin: ".our-quotes-gsap",
        //     start: "top top",
        //     end: () => '+='+endPos,
        //     pin: true,
        //     pinSpacing: true,
        //     scrub: 1,
        //     invalidateOnRefresh: true,
        //     markers: true
        // }
    });
    // function pinQuotes() {
        let elementHeight = quoteHeight;
        timeline.addLabel("One", 0);
        timeline.fromTo(".quote-article-1", { y: 0 }, { y: "-" + elementHeight }, "+=0.5");
        timeline.fromTo(".quote-article-2", { y: elementHeight }, { y: 0 }, "<");
        timeline.addLabel("Two", "<");
        timeline.to(".quote-article-2", { y: "-" + elementHeight }, "+=0.5");
        timeline.fromTo(".quote-article-3", { y: elementHeight + elementHeight }, { y: 0 }, "<");
        timeline.addLabel("Three", "<");
        timeline.to(".quote-article-3", { y: "-" + elementHeight + elementHeight }, "+=0.5");
        timeline.to({}, { duration: 0.5 });
    // }



    // window.addEventListener("load", function (event) {
    //     pinQuotes();
    // });

});

              
            
!
999px

Console