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

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.

HTML

              
                <main>
	
	  <!-- IMAGE COVERUP COMPONENT -->
    <section>
        <div class="container-fluid p-0">
            <div class="row cmpnt--image-coverup m-0">
                <div class="col-12 p-0 all-vh ic__image--one">

                    <img src="https://picsum.photos/600/800?random=3" width="2250" height="1613" class="img-cover">

                    <div class="panel-on-image">
                    <p>Nunc commodo in lectus eu accumsan. Phasellus ac libero eu urna feugiat tempor. Nunc sit amet turpis lacus. Nam ultrices ac dolor quis rhoncus. Aliquam ac porttitor neque.</p>
                    </div>

                </div>
                <div class="col-12 p-0 all-vh overflow-hidden ic__image--two">
					
                    <img src="https://picsum.photos/600/800?random=4" width="2250" height="1613" class="img-cover">
                    
                </div>
            </div>
        </div>
    </section>
    <!-- END IMAGE COVERUP COMPONENT -->


    <!-- PAGE SPLIT COMPONENT -->
    <section>
        <div class="container-fluid p-0">
			<div class="row cmpnt--page-split">
				<div class="col-12 col-lg-7 p-0 all-vh cmpnt--page-split--image">

					<img src="https://picsum.photos/600/800?random=5" width="600" height="540" class="ps__image--one" style="">

					<img src="https://picsum.photos/600/800?random=6" width="000" height="540" class="ps__image--two" style="">

				</div>
				<div class="col-12 col-lg-5 all-vh cmpnt--page-split--text">
					<div class="vertical-center vh">
						<div class="vertical-el">

							<p>Nam ac turpis nec nisi suscipit facilisis. Donec ac ligula sed quam pulvinar venenatis in non sem. Nunc pharetra ex non mi tincidunt, sit amet accumsan lacus lacinia. Aliquam in imperdiet orci, eget tristique sapien. Aliquam malesuada vel dolor consequat finibus.</p>

						</div>
					</div>
				</div>

			</div>
        </div>
    </section>
    <!-- END PAGE SPLIT COMPONENT 7/5 -->
	
	  <!-- IMAGE COVERUP COMPONENT -->
    <section>
        <div class="container-fluid p-0">
            <div class="row cmpnt--image-coverup m-0">
                <div class="col-12 p-0 all-vh ic__image--one">

                    <img src="https://picsum.photos/600/800?random=3" width="2250" height="1613" class="img-cover">

                    <div class="panel-on-image">
                    
                        <p>Nunc commodo in lectus eu accumsan. Phasellus ac libero eu urna feugiat tempor. Nunc sit amet turpis lacus. Nam ultrices ac dolor quis rhoncus. Aliquam ac porttitor neque.</p>
                        
                    </div>

                </div>
                <div class="col-12 p-0 all-vh overflow-hidden ic__image--two">
					
                    <img src="https://picsum.photos/600/800?random=4" width="2250" height="1613" class="img-cover">
                    
                </div>
            </div>
        </div>
    </section>
    <!-- END IMAGE COVERUP COMPONENT -->
  
  <!-- PAGE SPLIT COMPONENT -->
    <section>
        <div class="container-fluid p-0">
			<div class="row cmpnt--page-split">
				<div class="col-12 col-lg-7 p-0 all-vh cmpnt--page-split--image">

					<img src="https://picsum.photos/600/800?random=7" width="600" height="540" class="ps__image--one" style="">

					<img src="https://picsum.photos/600/800?random=8" width="000" height="540" class="ps__image--two" style="">

				</div>
				<div class="col-12 col-lg-5 all-vh cmpnt--page-split--text">
					<div class="vertical-center vh">
						<div class="vertical-el">

							<p>Nam ac turpis nec nisi suscipit facilisis. Donec ac ligula sed quam pulvinar venenatis in non sem. Nunc pharetra ex non mi tincidunt, sit amet accumsan lacus lacinia. Aliquam in imperdiet orci, eget tristique sapien. Aliquam malesuada vel dolor consequat finibus.</p>

						</div>
					</div>
				</div>

			</div>
        </div>
    </section>
    <!-- END PAGE SPLIT COMPONENT 7/5 -->
	
    <!-- MORE COMPONENTS MAY GO HERE 
	  <section>
        <div class="container-fluid p-0">
				<p class="text-center">some other place to go</p>
		    </div>
	  </section>-->

</main>



</body>
</html>
              
            
!

CSS

              
                html,
	body {
		height:100%;
	}
	body {
		background-color: #F8F8F7;
		color: #000;
		font-size: 100%;
		font-weight: 400;
		line-height: 1.4;
		margin: 0;
		overflow-x: hidden;
		text-align: center;
	}

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

	.section {
		width: 100%;
		height: auto; 
		overflow: hidden;
		position: relative;
	}

	.container-fluid {
		padding: 0;
	}

	/*** LAYOUT ***/

	.all-vh {
		height: 100vh;
	}
	.vertical-center {
		display: table;
		position: relative;
		width: 100%;
		height: 100%;
	}
	.vertical-center.vh {
		height: 100%;
	}
	.vertical-center .vertical-el {
		display: table-cell;
		vertical-align: middle;
	}


	/*** TYPOGRAPHY ***/

	p {
		font-size: calc(1.25em + (3.5 - 1.25) * ((100vw - 20em) / (120 - 20)));
		font-weight: 300;
		line-height: 1; /* 0.85; */
		text-align: left;
	}
	@media only screen and (min-width:1920px) {
		p {
			font-size: 3.5rem; /* was 4.5rem */
		}   
	}
		
	/*** IMAGES ***/

	.img-cover {
		width: 100%;
		height: auto;
	}
	@media only screen and (min-width: 1024px) {
		.img-cover {
			object-fit: cover;
			height: 100vh;
		}
	}
	.img-sizing {
		max-width: 100%;
		height: auto;
	}
	@media only screen and (min-width:1920px) {
		.img-sizing {
			object-fit: contain;
			width: 100%; 
		}
	}


	/*** COMPONENTS ***/


	/* 2 IMAGE COVERUP */

	.cmpnt--image-coverup .all-vh {
		height: auto;
	}

  .panel-on-image {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 33;
    width: 85%;
    padding: 2rem;
  }


	/* 7/5 PAGE SPLIT */


	@media screen and (orientation: landscape) { 
		.cmpnt--page-split .all-vh {
			height: auto;
			min-height: 100vh;
		}
		.cmpnt--page-split--text {
			padding: 0 5%;
		}
	}
	.cmpnt--page-split--image {
		overflow: hidden;
		width: 100%;
	}
	.cmpnt--page-split--image img {
		width:100%;
		height:100%;
		object-fit:cover;
	}
	.cmpnt--page-split--image.rt img {
		object-position: right top;
	}
	.cmpnt--page-split--image.lt img {
		object-position: left top;
	}
	.cmpnt--page-split--image--border {
		border-style: solid;
		border-width: calc(1em + (9.375 - 1) * ((100vw - 20em) / (120 - 20)));
	}
	@media screen and (pointer: fine) {
		.ic__image--two,
		.ps__image--two {
			position: absolute;
			top: 0; 
			left:0;
		}
	}
		
	.panel-on-image {
		background-color:#D47E43;
		background:rgba(212, 126, 67, 0.8);
	}


	/*** GSAP ***/

	.pin-spacer {
	/*	background: rgba(255,0,0,0.3);*/
		margin:0 !important;
	}

              
            
!

JS

              
                document.addEventListener("DOMContentLoaded", function() {

	gsap.registerPlugin(ScrollTrigger);
	
	var ic__textWrapper,ic__text,ic__text_h,imageTwo,imageTwo_h,relevantElementsHeight,totalPinDuration,ic__textDuration,imageTwoDuration,ps__wrapper,ps__i2,ps__i2_h;
  var ic__tl = gsap.timeline();
	var ps__tl = gsap.timeline();
		
  gsap.utils.toArray("section").forEach(function(section) {

      if (section.querySelector('.cmpnt--image-coverup') !== null) {

        var ic__textWrapper = section.querySelector(".panel-on-image");
        var ic__text = section.querySelector(".panel-on-image p");
        var ic__text_h = ic__textWrapper.offsetHeight;

        var imageTwo = section.querySelector(".ic__image--two");
        var imageTwo_h = imageTwo.offsetHeight;

        var relevantElementsHeight = ic__text_h*2 + imageTwo_h;
        var totalPinDuration = relevantElementsHeight + ((relevantElementsHeight*0.1)*5);
        var ic__textDuration = ic__text_h/relevantElementsHeight;
        var imageTwoDuration = imageTwo_h/relevantElementsHeight;

        gsap.set(ic__text,{opacity:0});

        var ic__tl = gsap.timeline({ paused: true })
        
        ic__tl
        .from(ic__textWrapper, { duration: ic__textDuration, scaleY:0, transformOrigin:("bottom center")},"+=0.1")
        .to(ic__text, { duration: 0.1, opacity:1 })
        .from(imageTwo, { duration: imageTwoDuration, yPercent: 100 },"+=0.1")
        .to(ic__text, { duration: 0.1, opacity:0 })
        .to(ic__textWrapper, { duration: ic__textDuration, scaleY:0, transformOrigin:("bottom center") },"+=0.1")
        ;

        ScrollTrigger.create({
        animation: ic__tl,
        trigger: section.querySelector('.cmpnt--image-coverup'),
        start: "center center",
        end: () => "+=" + totalPinDuration,
        scrub: true,
        pin: true
        });

      }

      if (section.querySelector('.cmpnt--page-split') !== null) {

        var ps__wrapper = section.querySelector(".cmpnt--page-split");
        var ps__i2 = section.querySelector(".ps__image--two");
        var ps__i2_h = ps__i2.offsetHeight;

        var ps__tl = gsap.timeline({ paused: true })
        
        ps__tl.from(ps__i2, { duration: 2, yPercent: 100 },"+=0.1");

        ScrollTrigger.create({
        animation: ps__tl,
        //id: 'ps__' + i__ps,
        trigger: section.querySelector('.cmpnt--page-split'),
        start: "center center",
        end: () => "+=" + ps__i2_h,
        scrub: true,
        pin: true
        });

      }

    });

});
              
            
!
999px

Console