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="hero">
	<div class="image-container">
		<svg id="triangles" viewBox="0 0 785 1007" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid slice">
			
			<image class="altimeter triangle-parallax" data-depth=".2" xlink:href="https://assets.codepen.io/732/altimeter.png" alt="" height="100%" width="100%" preserveAspectRatio="xMidYMid slice"></image>
			
			<image class="shuttle" xlink:href="https://assets.codepen.io/732/shuttle-only-final.png" alt="" height="100%" width="100%" y="120" preserveAspectRatio="xMidYMid slice"></image>
			
			<image class="shuttle-bg triangle-parallax" data-depth=".55" xlink:href="https://assets.codepen.io/732/shuttle-bg.png" alt="" height="100%" width="100%" y="100" preserveAspectRatio="xMidYMid slice"></image>
			
			<image class="earth triangle-parallax" data-depth=".95" xlink:href="https://assets.codepen.io/732/earth-full.png" alt="" height="100%" width="100%" preserveAspectRatio="xMidYMid slice"></image>

		<path class="triangle-parallax triangle-1" data-depth='0.8' opacity="0.4" d="M383.715 616.247L482.308 787.015H285.122L383.715 616.247Z" fill="url(#paint0_linear_1_4)"/>

		<path class="triangle-parallax triangle-2" data-depth='0.25' opacity="0.2" d="M515.754 929.911L473.06 855.963L558.448 855.963L515.754 929.911Z" fill="url(#paint1_linear_1_4)"/>

		<path class="triangle-parallax triangle-3" data-depth='0.85' opacity="0.5" d="M114.298 762.988L212.891 933.756H15.7052L114.298 762.988Z" fill="url(#paint2_linear_1_4)"/>

		<path class="triangle-parallax triangle-4" opacity="0.3" d="M649.106 1006.49L581.024 888.573L717.188 888.573L649.106 1006.49Z" fill="url(#paint3_linear_1_4)"/>

		<path class="triangle-parallax triangle-5" data-depth='0.4' opacity="0.4" d="M184.243 597.239L233.976 683.378H134.511L184.243 597.239Z" fill="url(#paint4_linear_1_4)"/>

		<path class="triangle-parallax triangle-6" data-depth='0.4' opacity="0.4" d="M327.296 827.38L377.029 913.519H277.564L327.296 827.38Z" fill="url(#paint5_linear_1_4)"/>

		<path class="triangle-parallax triangle-7" data-depth='0.8'  opacity="0.4" d="M658.818 425.045L757.411 595.813H560.226L658.818 425.045Z" fill="url(#paint6_linear_1_4)"/>

		<path class="triangle-parallax triangle-8" data-depth='0.8'  opacity="0.4" d="M209.597 0.160156L308.19 170.928H111.005L209.597 0.160156Z" fill="url(#paint7_linear_1_4)"/>

		<path class="triangle-parallax triangle-9" data-depth='0.25' opacity="0.2" d="M670.294 161.597L627.601 87.6495L712.988 87.6495L670.294 161.597Z" fill="url(#paint8_linear_1_4)"/>

		<path class="triangle-parallax triangle-10" data-depth='0.85' opacity="0.5" d="M473.462 658.743L374.87 487.976L572.055 487.976L473.462 658.743Z" fill="url(#paint9_linear_1_4)"/>

		<path class="triangle-parallax triangle-11" data-depth='0.6'  opacity="0.3" d="M646.386 304.098L578.304 186.176L714.468 186.176L646.386 304.098Z" fill="url(#paint10_linear_1_4)"/>

		<path class="triangle-parallax triangle-12" data-depth='0.65'  opacity="0.2" d="M699.914 430.137L626.973 303.799L772.856 303.799L699.914 430.137Z" fill="url(#paint11_linear_1_4)"/>

		<path class="triangle-parallax triangle-13" data-depth='0.4' opacity="0.4" d="M530.889 375.441L580.621 461.58H481.156L530.889 375.441Z" fill="url(#paint12_linear_1_4)"/>

		<path class="triangle-parallax triangle-14" data-depth='0.4'  opacity="0.2" d="M513.066 32.0173L562.798 118.156L463.333 118.156L513.066 32.0173Z" fill="url(#paint13_linear_1_4)"/>

		<path class="triangle-parallax triangle-15" data-depth='0.45'  opacity="0.2" d="M213.989 361.524L164.257 275.385L263.722 275.385L213.989 361.524Z" fill="url(#paint14_linear_1_4)"/>

		<defs>
		<linearGradient id="paint0_linear_1_4" x1="383.715" y1="787.106" x2="383.715" y2="616.247" gradientUnits="userSpaceOnUse">
		<stop stop-color="#E64C3B"/>
		<stop offset="1" stop-color="#E64C3B" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint1_linear_1_4" x1="515.754" y1="855.924" x2="515.754" y2="929.911" gradientUnits="userSpaceOnUse">
		<stop stop-color="#E64C3B"/>
		<stop offset="1" stop-color="#E64C3B" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint2_linear_1_4" x1="224.65" y1="903.951" x2="10.9459" y2="841.265" gradientUnits="userSpaceOnUse">
		<stop stop-color="#F3906A"/>
		<stop offset="1" stop-color="#D58677" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint3_linear_1_4" x1="572.904" y1="909.154" x2="720.475" y2="952.442" gradientUnits="userSpaceOnUse">
		<stop stop-color="#F3906A"/>
		<stop offset="1" stop-color="#D58677" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint4_linear_1_4" x1="184.243" y1="682.991" x2="184.243" y2="597.239" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint5_linear_1_4" x1="327.296" y1="913.132" x2="327.296" y2="827.38" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint6_linear_1_4" x1="658.818" y1="595.904" x2="658.818" y2="425.045" gradientUnits="userSpaceOnUse">
		<stop stop-color="#E64C3B"/>
		<stop offset="1" stop-color="#E64C3B" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint7_linear_1_4" x1="209.597" y1="171.018" x2="209.597" y2="0.160156" gradientUnits="userSpaceOnUse">
		<stop stop-color="#E64C3B"/>
		<stop offset="1" stop-color="#E64C3B" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint8_linear_1_4" x1="670.294" y1="87.6103" x2="670.294" y2="161.597" gradientUnits="userSpaceOnUse">
		<stop stop-color="#E64C3B"/>
		<stop offset="1" stop-color="#E64C3B" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint9_linear_1_4" x1="363.111" y1="517.78" x2="576.815" y2="580.466" gradientUnits="userSpaceOnUse">
		<stop stop-color="#F3906A"/>
		<stop offset="1" stop-color="#D58677" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint10_linear_1_4" x1="570.184" y1="206.757" x2="717.754" y2="250.045" gradientUnits="userSpaceOnUse">
		<stop stop-color="#F3906A"/>
		<stop offset="1" stop-color="#D58677" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint11_linear_1_4" x1="699.914" y1="304.366" x2="699.914" y2="430.137" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint12_linear_1_4" x1="530.889" y1="461.193" x2="530.889" y2="375.441" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint13_linear_1_4" x1="513.066" y1="117.769" x2="513.066" y2="32.0173" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		<linearGradient id="paint14_linear_1_4" x1="213.989" y1="275.772" x2="213.989" y2="361.524" gradientUnits="userSpaceOnUse">
		<stop stop-color="#0099EF"/>
		<stop offset="1" stop-color="#0099EF" stop-opacity="0"/>
		</linearGradient>
		</defs>
		</svg>
	</div>
</div>
              
            
!

CSS

              
                body {
	background-color: rgb(30, 35, 50);
	height: 250vh;
	margin: 0;
}

.hero {
	height: 430px;
	overflow: hidden;
	position: relative;
	
	@media (min-width: 768px) {
		height: 698px;
	}
	
	@media (min-width: 1200px) {
		height: 930px;
	}
}

.earth {
	opacity: .5;
}

.altimeter {
	opacity: .2;
}

.image-container {
	opacity: .5;
	position: absolute;
	right: 0;
	height: 430px;
	
	@media (min-width: 786px) {
		height: 698px;
	}
	
	@media (min-width: 1200px) {
		opacity: 1;
		height: 930px;
	}
	
	@media (min-width: 1680px) {
		right: 50%;
		margin-right: -840px;
	}
}

#triangles {
	aspect-ratio: 785/1007;
	margin-top: -6.666%;
	height: 108.27%;
}
              
            
!

JS

              
                const tl = gsap.timeline({
	scrollTrigger: {
		trigger: "#triangles",
		start: "top top",
		end: "bottom top",
		scrub: true
	}
});

gsap.utils.toArray(".triangle-parallax").forEach(layer => {
	const depth = layer.dataset.depth;
	const movement = -(500 * depth)
	tl.to(layer, {y: movement, ease: "none"}, 0)
});

tl.to('.shuttle', {
	yPercent: -300,
	ease: 'power1.in'
}, 0)

/*
tl.to('.hero .image-container', {
	yPercent: 70,
	ease: 'none'
}, 0)

*/
              
            
!
999px

Console