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

              
                <header>
	<div class="text">
		<h1 class="expanding-text">Parallax Expanding &amp; Blurred Title</h1>
		
	</div>
</header>
<main role="main">
	<div class="contained">
		<h2>Increase the line-height when the page scrolls.</h2>
		<p>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Nulla vitae elit libero, a pharetra augue. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
		<p>Curabitur blandit tempus porttitor. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
		<h3>It might be too many effects, so maybe just choose one</h3>
		<p>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit sit amet non magna. Nulla vitae elit libero, a pharetra augue. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
		<p>Curabitur blandit tempus porttitor. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
</main>
              
            
!

CSS

              
                /* --- General Pen Styles --- */
body{
	font-size: 18px;
	line-height: 1.5;
	font-family: 'Bitter', serif;
}
h1,h2,h3,h4{
	font-family: 'Dosis', sans-serif;
	
}

.contained{
	margin: 0 auto;
	width: 90%;
	@media (min-width: 500px){
		width: 80%;
	}
	@media (min-width: 600px){
		width: 60%;
	}
}
main{
	padding: 3em 0 5em;
	position: relative;
	background: #f5f5f5;
	color: #444444;
	box-shadow: 0px -10px 60px rgba(0,0,0,0.25);
}
header{
	background-image: url(https://unsplash.it/1200/800?image=876);
	overflow: hidden;
	//padding-bottom determines the height of the header
	padding-bottom: 80vh
	
}


header{
	position: relative;
}
header .text{
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	text-align: center;
	width: 60%;
	@media (min-width: 700px){
		width: 40%;
	}
	h1{
		color: #f5f5f5;
		font-size: 40px;
		line-height: 1.25;//must match JS starting #
		letter-spacing: 3px;
		transition: font-size 300ms linear;
		@media (min-width: 500px){
			font-size: 50px;
		}
		@media (min-width: 750px){
			font-size: 65px;
		}
	}
}

              
            
!

JS

              
                
$(window).scroll(function() {
  var scroll = $(window).scrollTop();
	$("header .expanding-text").css({
		'line-height': 1.25 + (scroll/400),
		'opacity': 1 - (scroll/500),
		"-webkit-filter": "blur(" + (scroll/200) + "px)",
		filter: "blur(" + (scroll/200) + "px)"

	});
});

              
            
!
999px

Console