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="spacer">
	<span>SPACER</span>
</div>

<div class="horiz-scll wrapper d-flex flex-nowrap">
  <section class="section section--white section--large flex-shrink-0 vw-100 vh-100 d-flex justify-content-center align-items-center" data-color="#fff">
		<div class="container"> 
			<div class="row">
				<div class="col-sm-6"> 
					<img class="horiz-scll__image" src="https://cnxc.wpengine.com/wp-content/uploads/elementor/thumbs/home-work-utility-giant-pxh75d59suhjytbwlkqwk62hsdia9nti2nvjbzn53c.jpg" />
				</div>
				<div class="col-sm-6"> 
					<div class="horiz-scll__content">
						<h2 class="horiz-scll__heading"> The Staff Experience Reimagined </h2> 
						<p class="horiz-scll__text"> Discover how an energy infrastructure giant upgraded its people solutions with a new approach to technology. </p>	
						<a href="#" class="horiz-scll__btn"> Learn More </a>		
					</div>
				</div>
			</div>
		</div><!-- .container -->
  </section>
  <section class="section bg-color--teal section--dark section--large vh-100 flex-shrink-0 d-flex justify-content-center align-items-center bg-color--teal" data-color="#ffd000">
		<div class="container"> 
			<div class="row">
				<div class="col-sm-6"> 
					<img class="horiz-scll__image" src="https://cnxc.wpengine.com/wp-content/uploads/elementor/thumbs/home-work-managing-metaverse-pxh7hgcjp51ba9rr0av64m8wtrx89it82hxcj3pv2g.jpg" />
				</div>
				<div class="col-sm-6"> 
					<div class="horiz-scll__content">
						<h2 class="horiz-scll__heading"> Creating Trust in Virtual Safety </h2> 
						<p class="horiz-scll__text"> Find out how one company ensured the trust and online safety for some of the metaverse’s most vulnerable users. </p>	
						<a href="#" class="horiz-scll__btn"> Learn More </a>	
					</div>
				</div>
			</div>
		</div><!-- .container -->
  </section>
  <section class="section bg-color--green section--dark section--large vh-100 flex-shrink-0 d-flex justify-content-center align-items-center" data-color="#ff6633">
		<div class="container"> 
			<div class="row">
				<div class="col-sm-6"> 
					<img class="horiz-scll__image" src="https://cnxc.wpengine.com/wp-content/uploads/elementor/thumbs/home-work-customer-centric-app-pxh8h83fs60541t84ri20laennm36uthnjok06oia0.jpg" />
				</div>
				<div class="col-sm-6"> 
					<div class="horiz-scll__content">
						<h2 class="horiz-scll__heading"> Customer-Centric App Boosts Loyalty </h2> 
						<p class="horiz-scll__text"> To stay relevant with shifting customer expectations, a major athletic footwear brand evolved its mobile member experience. </p>	
						<a href="#" class="horiz-scll__btn"> Learn More </a>	
					</div>
				</div>
			</div>
		</div><!-- .container -->
  </section>
  <section class="section bg-color--white section--dark section--large flex-shrink-0 vw-100 vh-100 d-flex justify-content-center align-items-center" data-color="#009999">
		<div class="container"> 
			<div class="row">
				<div class="col-sm-6"> 
					<img class="horiz-scll__image" src="https://cnxc.wpengine.com/wp-content/uploads/elementor/thumbs/home-work-app-innovation-delivers-pxh8no9ko8tyrqfzh1uwmgp9dttr03f6vgthjj49l4.jpg" />
				</div>
				<div class="col-sm-6"> 
					<div class="horiz-scll__content">
						<h2 class="horiz-scll__heading"> App Innovation Delivers Improved Health </h2> 
						<p class="horiz-scll__text"> One of America’s largest healthcare companies enhanced the patient experience through personalization and a tailored mobile app. </p>	
						<a href="#" class="horiz-scll__btn"> Learn More </a>	
					</div>
				</div>
			</div>
		</div><!-- .container -->
  </section>
</div>

<div class="spacer">
	<span>SPACER</span>
</div>
              
            
!

CSS

              
                body {
/*   overflow-x: hidden; */
	font-family: 'Montserrat', sans-serif;
}

.horiz-scll__image {
	width: 100%;
	border-radius: 50%;
}

.horiz-scll__content {
	height: 100%;
	color: #000;
	display: flex;
	flex-direction: column;
	justify-content: center;
  padding-left: 1rem;	
}

.spacer {
	font-weight: bold;
/* 	padding: 12rem; */
	height: 100vh;
	text-align: center;
}

.horizontal-scroll {
/* 	display: flex!important;
	flex-wrap: no-wrap; */
}

.horiz-scll__heading {
	font-weight: 900;
	color: #414141;
	font-size: 38px;
	margin-bottom: 2rem;
}

.horiz-scll__text {
	font-size: 18px;
}

.horiz-scll__heading, 
.horiz-scll__text {
	color: #000 !important;
}

.section {
	height: 100vh!important;
	width: 100vw!important;
	display: flex!important;
	flex-shrink: 0!important;
}

.section--large {
  width: 100vw;
  color: white;
}

.section--small {
  width: 46rem;
}

/* .section--dark {
  color: white;
  background-color: black;
} */

.color-dark {
	color:#fff;
}

.wrapper {
	background-color: #fff;
}

              
            
!

JS

              
                console.clear();

gsap.registerPlugin(ScrollTrigger);

const wrapper = document.querySelector(".wrapper");
const sections = gsap.utils.toArray(".section");
let maxWidth = 0;

const getMaxWidth = () => {
	maxWidth = 0;
	sections.forEach((section) => {
		maxWidth += section.offsetWidth;
	});
};
getMaxWidth();

const t = gsap.to(sections, {
	x: () => `-${maxWidth - window.innerWidth}`,
	ease: "none",
	scrollTrigger: {
		trigger: ".wrapper",
		pin: true,
		scrub: true,
		end: () => `+=${maxWidth}`,
		invalidateOnRefresh: true,
		id: "main",
		markers: true,
	}
});
const colors = ["#fff", "#009999", "#ff6633", "#BFD62E"];
const tweenColor = (i) => {
	colors[i] && gsap.to(wrapper, { backgroundColor: colors[i] });
};

sections.forEach((sct, i) => {
	ScrollTrigger.create({
		trigger: sct.parentElement,
		start: (self) => (window.innerWidth *  (i + 1)),
		id: "section-" + i,
		markers: true,
		toggleClass: { targets: sct, className: "active" },
		onEnter: () => tweenColor(i),
		onLeaveBack: () => tweenColor(i - 1),
	});
});

              
            
!
999px

Console