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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <header class="page-header">
	<h1>Scroll down to trigger the animation</h1>
</header>
<section id="scroll-section">
	<svg class="line-svg" role="presentational" preserveAspectRatio="xMidYMin slice" width="100%" fill="none" viewBox="-480 0 2300 2241">
			<path class="anim-overview-stroke" stroke="#C7DBF4" stroke-width="200" d="M-841 100H584c124 0 225 101 225 225v0c0 124-101 225-225 225h-95a281 281 0 00-281 281v0c0 155 125 281 281 281h442c167 0 304 136 304 304v0c0 168-137 304-304 304H795a439 439 0 00-439 439v82" opacity=".45"></path>
	</svg>
	<div class="container">
		<h2>Section Heading</h2>
		<div class="layout-container">
			<div class="box box-1">
				<h3>Box Heading</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus mauris a diam maecenas sed enim ut sem. Sapien pellentesque habitant morbi tristique senectus et netus et. Eget arcu dictum varius duis at. Orci ac auctor augue mauris augue neque gravida.</p>
				<a href="#" class="btn">Find out more</a>
			</div>
			<img class="image-1" src="https://assets.codepen.io/732/matthew-deltoro-LdFvvpjnB2A-unsplash-800.jpg" width="400" height="400" />
			<div class="box box-2">
				<h3>Box Heading</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus mauris a diam maecenas sed enim ut sem. Sapien pellentesque habitant morbi tristique senectus et netus et. Eget arcu dictum varius duis at. Orci ac auctor augue mauris augue neque gravida.</p>
				<a href="#" class="btn">Find out more</a>
			</div>
			<img class="image-2" src="https://assets.codepen.io/732/viviana-rishe-6fNZ7QtXiCs-unsplash-800.jpg" width="400" height="600"/>
			<div class="box box-3">
				<h3>Box Heading</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus mauris a diam maecenas sed enim ut sem. Sapien pellentesque habitant morbi tristique senectus et netus et. Eget arcu dictum varius duis at. Orci ac auctor augue mauris augue neque gravida.</p>
				<a href="#" class="btn">Find out more</a>
			</div>
			<img src="https://assets.codepen.io/732/colton-sturgeon-FiCPutl_aog-unsplash-800.jpg" class="image-3" width="400" height="400"/>
			<div class="box box-4">
				<h3>Box Heading</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tellus mauris a diam maecenas sed enim ut sem. Sapien pellentesque habitant morbi tristique senectus et netus et. Eget arcu dictum varius duis at. Orci ac auctor augue mauris augue neque gravida.</p>
				<a href="#" class="btn">Find out more</a>
			</div>
		</div>
	</div>
</section>
<section class="bottom"></section>
  
              
            
!

CSS

              
                html {
	background-color: rgb(32, 91, 173);
}

body {
	font-family: 'Montserrat', sans-serif;
	font-size: 100%;
	font-weight: 400;
	margin: 0;
}

img {
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
	display: block;
	height: auto;
	max-width: 100%;
}

.btn {
	background-color: rgb(32, 91, 173);
	border-radius: 99px;
	color: white;
	display: block;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: .02em;
	line-height: 42px;
	height: 42px;
	padding: 0 40px;
	text-decoration: none;
	transition: background-color .4s ease-out;
	width: fit-content;
	
	&:hover {
		background-color: rgb(222, 40, 112);
	}
}

.page-header {
	align-items: center;
	display: flex;
	height: 50vh;
	justify-content: center;
}

#scroll-section {
	position: relative;
	min-height: 2700px;
}

.line-svg {
	position: absolute;
  height: calc(100% - 10rem);
  top: 0;
  min-width: 300px;
  z-index: -1;
}

.container {
	margin: 0 auto;
	max-width: 1272px;
}

h1 {
	color: white;
	-webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h2 {
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
	color: white;
	font-size: 62px;
	font-weight: 900;
	letter-spacing: .02em;
	margin: 0;
	padding-top: 72px;
	position: relative;
	width: 50%;
	text-align: right;
	-webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layout-container {
	padding-top: 8rem;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
/*	grid-template-columns: 1fr 1.2fr 4rem 1.2fr 1.2fr 8rem;
grid-template-rows: auto 6.5rem 6.5rem 5rem auto 6.5rem 5rem 5rem auto 7rem; */
}

.box {
	background-color: white;
	color: #333;
	padding: 4rem;
	
	h3 {
		font-size: 42px;
		font-weight: 900;
		line-spacing: .02em;
		margin: 0 0 18px;
		-webkit-font-smoothing: antialiased;
  	-moz-osx-font-smoothing: grayscale;
	}
	
	p {
		font-size: 18px;
		line-height: 1.25;
		margin: 0 0 2em;
	}
}

.box-1 {
	grid-column: 3 / span 3;
	grid-row: span 2;
}

.image-1 {
	grid-column: 1 / span 2;
	grid-row: 2 /span 2;
	margin-top: 100px;
}

.image-2 {
	align-self: end;
	grid-column: 6 / span 1;
	grid-row: 5;
}

.image-3 {
	grid-column: 1 / span 2;
	justify-self: end;
	margin-top: 3rem;
}

.box-2 {
	grid-column: 2 / span 3;
	margin-top: 3rem;
	grid-row: span 2;
}

.box-3 {
	grid-column: 3 / span 3;
	margin-top: 8em;
}

.box-4 {
	grid-column: 1 / span 3;
	margin-top: 12rem;
	margin-bottom: -5rem;
}

.bottom {
	height: 50vh;
}


// Add text-stroke for h2
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin, GSDevTools);
const main = gsap.timeline({
	scrollTrigger: {
		trigger: '#scroll-section',
		scrub: true,
		start: "top center",
    end: "bottom center"
	}
});

main
	.from('.line-svg path', {drawSVG: 0, duration: 8.44},0)
	.to('body', {backgroundColor: 'rgb(178, 203, 235)', duration: 7.44}, 1)
	.from('h2', {clipPath:'polygon(0 0, 0% 0, 0% 100%, 0 100%)', duration: .55},.83)
	.from('.box-1', {opacity: 0, duration: .5, ease: 'power3.out'}, 1.5)
	.from('.image-1', {clipPath: 'polygon(0 100%, 100% 100%, 100% 100%, 0% 100%)', opacity: 0, duration: .5, ease: 'power3.out'}, 2.15)
	.from('.box-2', {opacity: 0, duration: .5, ease: 'power3.out'}, 2.7)
	.from('.image-2', {clipPath: 'polygon(0 100%, 100% 100%, 100% 100%, 0% 100%)', opacity: 0, duration: .5, ease: 'power3.out'}, 3.7)
	.from('.box-3', {opacity: 0, duration: .5, ease: 'power3.out'}, 5.21)
	.from('.image-3', {clipPath: 'polygon(0 100%, 100% 100%, 100% 100%, 0% 100%)', opacity: 0, duration: .5, ease: 'power3.out'}, 6.2)
	.from('.box-4', {opacity: 0, duration: .5, ease: 'power3.out'}, 7.37)

 // GSDevTools.create({animation: main});
              
            
!
999px

Console