Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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 class="main">

	<div class="float-mask"></div>

	<div class="h-scroll__container">
		<div class="h-scroll">

			<section class="section section--one">
				<p>Passages, like many things, begin without announcement.</p>
			</section>

			<section class="section section--two">
				<p>Mine was less of a crossing and more a shade of cornflower (the feeling of being at sea). It’s possible we only think about time when we fear that times are changing. If we remember anything, then, we should remember how it started with salt. Memory
					itself must lie somewhere deeper.</p>
			</section>

		</div>
	</div>

</main>
              
            
!

CSS

              
                html,
body {
	font-family: "Sporting Grotesque_Regular", sans-serif;
	background-color: black;
	color: white;

	font-size: 3em;
}

.scrollmagic-pin-spacer{
   top: 0 !important
}

.h-scroll__container {
	width: 100vw;
}

.h-scroll {
	position: fixed;
	overflow: auto;
	display: flex;
}

.float-mask {
	position: fixed;
	display: block;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	background-position: center center;
	background-repeat: no-repeat;
	mix-blend-mode: exclusion;

	z-index: 100;

	background-image: url("https://images.unsplash.com/photo-1525498128493-380d1990a112?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3024&q=80");
	background-size: 35%;
}

.section {
	height: 100vh;
	display: flex;
	align-items: center;
	white-space: nowrap;
	position: relative;
	padding: 0 50vw;
	overflow: hidden;

	&--one {
		position: relative;
	}

	&--two {
		background: rgb(202, 184, 238);
		background-color: #044365;
		color: #f1e6d9;
		position: relative;
	}

	&--wrap {
		display: block;
		white-space: normal;
		overflow: scroll;
		padding: 0;
		font-size: 64px;
		line-height: 1.45;
		p {
			padding: 5vw 10vw;
			width: 75vw;
			margin: 0 auto;
		}
	}
}

              
            
!

JS

              
                $(function() {
	var hScroll = $(".h-scroll"),
		hScrollContain = $(".h-scroll__container"),
		scrollPercent = 200;

	function checkWidth() {
		var windowHeight = $(window).height(),
			calc = scrollPercent * 100 + windowHeight;
		hScrollContain.css({
			height: calc
		});
	}
	checkWidth();
	$(window).resize(checkWidth);

	$(window).scroll(function() {
		var scroll = $(this).scrollTop();
		hScroll.css({
			transform: "translateX(-" + scroll / scrollPercent + "%)"
		});
	});

	/// SCROLL MAGIC ///
		var controller = new ScrollMagic.Controller({
			vertical: false
		});

		var horizontalScroll = TweenMax.to(".float-mask", 0.5, {
			scale: 1.2,
			rotate: '360deg'
		});

		var scene = new ScrollMagic.Scene({
			triggerElement: ".section--two",
			triggerHook: 0,
		})
			.setTween(horizontalScroll)
			.addTo(controller);
});

              
            
!
999px

Console