cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <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>
            
          
!
            
              /* --- 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;
		}
	}
}

            
          
!
            
              
$(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
Loading ..................

Console