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="chat__container">
	<div class="chat__wrapper">
		<div class="left__block">Norms and mindsets manifest themselves in the way your people <span class="home-buble-left-para">think and behave</span></div>
        <div class="right__block">
           	<div class="chat__1 chat_block--global">
           		<img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/chat_window_4.png" alt="">
            </div>
            <div class="chat__2 chat_block--global">
               	<img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/chat_window_1.png" alt="">
            </div>
            <div class="chat__3 chat_block--global">
				<img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/chat_window_2.png" alt="">
            </div>
            <div class="chat__4 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/chat_window_3.png" alt="">                    
            </div>
          	<div class="chat__5 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/you-are-late-one.png" alt="">                    
            </div>
          	<div class="chat__6 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/you-are-late-two.png" alt="">                    
            </div>
          	<div class="chat__7 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/you-are-late-three.png" alt="">                    
            </div>
          	<div class="chat__8 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/you-are-late-four.png" alt="">                    
            </div>
          	<div class="chat__9 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/Johns-proposal-one.png" alt="">                    
            </div>
          	<div class="chat__10 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/Johns-proposal-two.png" alt="">                    
            </div>
          	<div class="chat__11 chat_block--global">
                 <img src="https://grzdemo.grazitti.com/axialent/wp-content/uploads/2022/02/Johns-proposal-three.png" alt="">                    
            </div>
          </div>
  	</div>
</div>

<div class="chat-extradiv"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/ScrollTrigger.min.js"></script>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

.chat__container {
  max-width: 1240px;
  margin: 20px auto;
}

.chat__wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  width: 100%;
  align-items: center;
}

.left__block {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 50%;
          flex: 0 0 50%;
  	font-size: 40px;
	letter-spacing: -1px;
    line-height: 50px;
	color: #002d62;
}

.right__block {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 50%;
          flex: 0 0 50%;
  position: relative;
      min-height: 500px;
}

.chat_block--global {
  position: absolute;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  width: 100%;
}

.chat_block--global img {
  max-width: 100%;
}
/*# sourceMappingURL=style.css.map */
              
            
!

JS

              
                    console.clear();
let images = gsap.utils.toArray(".chat_block--global"),
    curIndex = 0,
    t2 = gsap.timeline({
      scrollTrigger: {
        trigger: ".chat__container",
        pin: true,
        start: 0,
        end: "+=5000",
        scrub: true,
        onUpdate({ progress, direction }) {
                    gsap.killTweensOf(t2);
                    if (direction === -1) {
                        console.log("dfsdf");
                        t2.progress(0);
                        } else {
                            console.log("else");
                        gsap.to(t2, {
                            //duration: 0.5,
                           // ease: "expo",
                            progress
                        });
                        }
                    }
      }
    });

// hide all but the first image
gsap.set(images.slice(1), { autoAlpha: 0 });

images.slice(1).forEach((image, i) => {
    t2.add(() => {
    showImage(t2.scrollTrigger.direction < 0 ? i : i + 1);
  }, i + 1)
});

function showImage(index) {
  if (index !== curIndex) {
    gsap.to(images[index], {autoAlpha: 1, overwrite: true});
    gsap.to(images[curIndex], {autoAlpha: 0, overwrite: true});
    curIndex = index;
  }
}
              
            
!
999px

Console