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

              
                <body class="" id="top">

    <div class="history-wrapper-content">
        <section class='scrollContainer'>
            <section class="section start-content">
                <div class="item start-chapter">
                    <div class="caption">
                        <h2>
                            Our History
                        </h2>
                        <p>
                            Founded in 1977 and headquartered in Eschborn(Germany), Standard Profil Group is a first
                            tier automotive supplier of sealing systems...
                            Adding value to lives since 1977 Would you like to take a tour though the history?
                        </p>
                    </div>
                    <figure class="start-image">
                        <img class="parallax"
                            src="https://images.unsplash.com/photo-1576666735065-b24beb27b939?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1042&q=80">
                    </figure>
                </div>
            </section>

            <section class='section'>
                <div class="chapters c01">
                    <div class="double-images type-01">
                        <figure>
                            <img
                                src="https://images.unsplash.com/photo-1576666735112-87a8ea71671c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1786&q=80">
                        </figure>
                        <figure class="parallax">
                            <img
                                src="https://images.unsplash.com/photo-1579702493487-45a296ba9e34?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=780&q=80">
                        </figure>
                    </div>
                    <div class="caption fadeUp">
                        <h2 class="text-animated">
                            1977
                        </h2>
                        <p>
                            Our deep roots in automotive sealing systems go back to 1977 when Standard Profil was
                            founded by Rıfat Kamhi in Istanbul on March 10
                        </p>
                    </div>
                </div>
            </section>

            <section class='section'>
                <div class="chapters">
                    <div class="triple-images">
                        <figure>
                            <img
                                src="https://images.unsplash.com/photo-1504328345606-18bbc8c9d7d1?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3270&q=80">
                        </figure>
                        <figure class="parallax">
                            <img
                                src="https://images.unsplash.com/photo-1496247749665-49cf5b1022e9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80">
                        </figure>
                        <figure class="parallax">
                            <img
                                src="https://images.unsplash.com/photo-1455165814004-1126a7199f9b?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80">
                        </figure>
                    </div>
                </div>
            </section>
          
           <section class='section video-wrapper'>
                <div class="chapters c02">
               <div class="video">
                        <video ref="video" muted="" playsinline="" class="video" id="video" loop controlslist="nodownload">
<source type="video/mp4" src="https://joy.videvo.net/videvo_files/video/free/2021-04/large_watermarked/210329_06B_Bali_1080p_013_preview.mp4">
</video>
                      </div>
                </div>
            </section>

            <section class='section'>
                <div class="chapters c02">
                    <div class="double-images type-02">
                        <figure>
                            <img class="scale"
                                src="https://images.unsplash.com/photo-1565089200536-d69692d4525e?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1yZWxhdGVkfDEyfHx8ZW58MHx8fHw%3D&auto=format&fit=crop&w=500&q=60">
                        </figure>
                        <figure class="parallax">
                            <img
                                src="https://images.unsplash.com/photo-1589320011103-48e428abcbae?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80">
                        </figure>
                    </div>
                    <div class="caption">
                        <h2 class="text-animated">
                            1977
                        </h2>
                        <p>
                            Our deep roots in automotive sealing systems go back to 1977 when Standard Profil was
                            founded by Rıfat Kamhi in Istanbul on March 10
                        </p>
                    </div>
                </div>
            </section>
            
        </section>
    </div>

  </body>
              
            
!

CSS

              
                body,
html {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 10px;
}

* {
    margin: 0;
    padding: 0;
    outline: none;
    border: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    list-style: none;
    box-shadow: none;
}

$white: #fff;

.history-wrapper-content {

    .scrollContainer {
        overscroll-behavior: none;
        //width: 280%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
      }
      
      .section {
        height: 100vh;
        //width: 82vw;
        &.start-content {
            flex: 0 0 100vw;
        }
      }
      
    .caption {
       
            h2 {
                font-size: clamp(7rem, 6vw, 10rem);
                text-transform: uppercase;
                line-height: 1;
                letter-spacing: -6.66667px;
            }

            p {
                max-width: 60rem;
                font-size: clamp(2rem, 6vw, 2rem);
            }
    }

    //Images Types
    .double-images {
        position: relative;
        width: 90rem;
        display:flex;

        &.type-01 {
            margin: 10rem 0;

            figure {
                &:first-child {
                    flex-basis: 60rem;
                    flex-shrink: 0;
                    height: 80vh;
                }
                
                &:last-child {
                    max-width: 45rem;
                    height: 50vh;
                    position: absolute;
                    bottom: -4rem;
                    right: -26rem;
                    top: auto;
                }
            }
        }

        &.type-02 {
            figure {
                &:first-child {
                    flex-basis: 90rem;
                    flex-shrink: 0;
                    height: 100vh;


                }
                
                &:last-child {
                    max-width: 45rem;
                    height: 50vh;
                    position: absolute;
                    bottom: -4rem;
                    right: -26rem;
                    top: auto;
                }
            }
        }
    }

    .triple-images {
        position: relative;
        max-width: 110rem;
        display:flex;
        justify-content: center;
        align-items: center;
        margin: 10rem 0;

        figure {
            width: 50rem;
            height: 50rem;

            &:first-child {
                width: 50vh;
                height: 50vh;
                padding-bottom: 100%;

                img {
                    width: 100%;
                    height: 100%;
                }
            }
            &:nth-child(2) {
                width: 35vh;
                height: 35vh;
                position: absolute;
                top: -35%;
                right: -20%;

                img {
                    width: 100%;
                    height: 100%;
                }
            }
            &:nth-child(3) {
                width: 40vh;
                height: 40rem;
                position: absolute;
                bottom: -35%;
                left: -20%;

                img {
                    width: 100%;
                    height: 100%;
                }
            }
        }
    }

    figure {
        width: 100%;
        position: relative;
        overflow: hidden;

        &.start-image {
            width: 40%;
            height: 100%;
            
            img {
                width: 140%;
                height: 100%;
                position: absolute;
                top: 0;
                left: 0;
                object-fit: cover;
            }
        }

        img {
            width: 140%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            object-fit: cover;
        }
    }

    //Chapters
    .start-chapter {
        .caption {
            width: 60%;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
            flex-direction: column;
            padding-left: 5vw;
            margin-bottom: 10rem;
            
                h2 {
                    font-size: clamp(7rem, 6vw, 10rem);
                    text-transform: uppercase;
                    line-height: 1;
                }
    
                p {
                    max-width: 60rem;
                    padding-left: 10rem;
                    font-size: clamp(2rem, 6vw, 2rem);
                }
        }
    }

    .chapters {
        height: 100%;
        margin: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        padding: 0 10vw;
        &.c01 {

            .caption {
                padding-left: 20rem;
            }
        }

        &.c02 {

            padding: 0 10vw;

            .caption {
                padding-left: 20rem;
                width: max-content;
                margin-top: 10rem;
            }
        }
    }

    .item {
        width: 100%;
        height: 100%;
        display: flex;
        background: $white;
    }
}

.video {
 min-height: 100%;
    position: relative;
    width: 60rem;
  video {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    -o-object-fit: cover;
    object-fit: cover;
  }
}
              
            
!

JS

              
                console.clear(); // Start with a clean console on refesh 
gsap.registerPlugin(ScrollToPlugin, ScrollTrigger);

let sections = document.querySelectorAll(".section");
let scrollContainer = document.querySelector(".scrollContainer");

//horizontal scroll
let scrollTween = gsap.to(scrollContainer, {
  x: () => -(scrollContainer.scrollWidth - window.innerWidth),
  ease: "none",
  scrollTrigger: {
    trigger: scrollContainer,
    invalidateOnRefresh: true,
    pin: true,
    scrub: 1,
    end: () => "+=" + scrollContainer.scrollWidth,
  },
});

gsap.utils.toArray(".parallax").forEach(text => {
  gsap.timeline({
    defaults: {ease: "none"},
    scrollTrigger: {
      containerAnimation: scrollTween,
      trigger: text,
      start: "left right",
      end: "left left",
      scrub: true
    }
  })
  .fromTo(text, {x: 250}, {x: -250}, 0)
  // .from(text.nextElementSibling, {scale: 0.8}, 0)
});

gsap.utils.toArray(".scale").forEach(text => {
  gsap.timeline({
    defaults: {ease: "none"},
    scrollTrigger: {
      containerAnimation: scrollTween,
      trigger: text,
      start: "left right",
      end: "left left",
      scrub: true
    }
  })
  .fromTo(text, {scale: 1}, {scale: 1.4}, 0)
  // .from(text.nextElementSibling, {scale: 0.8}, 0)
});


gsap.utils.toArray(".video").forEach(text => {
  gsap.timeline({
    defaults: {ease: "none"},
    scrollTrigger: {
      containerAnimation: scrollTween,
      trigger: text,
      start: "-50% 45%",
      end: "150% center",
      markers:true,
      onEnter: () => video.play(),
      onLeave: () => video.pause(),
      onEnterBack: () => video.play(),
      onLeaveBack: () => video.pause(),
    }
  })
});



              
            
!
999px

Console