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="wrapper">
	<div class="page">
		<div class="parallax">
			<ul class="parallax__list" id="scene" data-friction-x="0.1">
				<li data-depth="0.10">
					<div class="parallax__bg"></div>
				</li>
				<li data-depth="0.15">
					<div class="parallax__rope parallax__rope_1">
						<div class="parallax__element parallax__element_1"><span></span></div>
						<div class="parallax__element parallax__element_2"><span></span></div>
						<div class="parallax__element parallax__element_3"><span></span></div>
						<img src="https://i.ibb.co/17cP6ss/rope.png" alt="" />
					</div>
				</li>
				<li data-depth="0.30">
					<div class="parallax__rope parallax__rope_2">
						<div class="parallax__element parallax__element_4"><span></span></div>
						<div class="parallax__element parallax__element_5"><span></span></div>
						<img src="https://i.ibb.co/17cP6ss/rope.png" alt="" />
					</div>
				</li>
				<li data-depth="0.60">
					<div class="parallax__rope parallax__rope_3">
						<div class="parallax__element parallax__element_6"><span></span></div>
						<div class="parallax__element parallax__element_7"><span></span></div>
						<div class="parallax__element parallax__element_8"><span></span></div>
						<img src="https://i.ibb.co/17cP6ss/rope.png" alt="" />
					</div>
				</li>
				<li data-depth="0.30">
					<div class="parallax__wave parallax__wave_1"></div>
				</li>
				<li data-depth="0.40">
					<div class="parallax__wave parallax__wave_2"></div>
				</li>
				<li data-depth="0.50">
					<div class="parallax__wave parallax__wave_3"></div>
				</li>
				<li data-depth="0.60">
					<div class="parallax__litehouse"></div>
				</li>
				<li data-depth="0.60">
					<div class="parallax__wave parallax__wave_4"></div>
				</li>
				<li data-depth="0.80">
					<div class="parallax__wave parallax__wave_5"></div>
				</li>
				<li data-depth="0.6">
					<div class="parallax__wave parallax__wave_6"></div>
				</li>
			</ul>
		</div>
		<div class="content">
		</div>
	</div>
</div>
              
            
!

CSS

              
                body,
html {
	background: #000;
}

.wrapper {
	height: 100%;
	overflow: hidden;
	opacity: 0;
	transition: all 1s ease 0s;
}

.wrapper.active {
	opacity: 1;
}

.wrapper.active .parallax__wave {
	opacity: 1;
	transition: all 1s ease 1s;
}

.wrapper.active .parallax__rope {
	opacity: 1;
	transition: all 1s ease 1.8s;
}

.wrapper.active .parallax__litehouse {
	bottom: 130px;
	transition: all 0.8s ease 2.5s;
}

.page,
.parallax:after {
	position: absolute;
	width: 100%;
}

.page {
	height: 100%;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	min-height: 360px;
}

.page,
.parallax {
	overflow: hidden;
}

.parallax:after {
	content: "";
	bottom: 0;
	height: 100px;
	background: linear-gradient(transparent 0, #000 60%);
}

.parallax__bg,
.parallax__list,
.parallax__list li {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.parallax__bg {
	width: 110%;
	height: 110%;
	top: -5%;
	left: -5%;
	background: url(https://i.ibb.co/1v11wW5/background.jpg) 50% 100% / cover
		no-repeat;
}

.parallax__rope {
	position: absolute;
	width: 120%;
	left: -10%;
	opacity: 0;
}

.parallax__rope img {
	width: 100%;
}

.parallax__rope_1 {
	top: 5%;
	transform: scale(1);
}

.parallax__rope_2 {
	top: -1.66667%;
	transform: scale(1.05556);
}

.parallax__rope_3 {
	top: -11.66667%;
	transform: scale(1.13889);
}

.parallax__rope_1 .parallax__element {
	transform: scale(0.7);
}

.parallax__rope_2 .parallax__element {
	transform: scale(0.82);
}

.parallax__rope_3 .parallax__element {
	transform: scale(0.98889);
}

.parallax__element {
	position: absolute;
}

.parallax__element span {
	display: inline-block;
	transform-origin: 50% 0;
	width: 280px;
	height: 280px;
	margin-left: -140px;
	animation: swing 2s infinite alternate cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.parallax__element_1 {
	top: 28%;
	left: 20%;
}

.parallax__element_1 span {
	background: url(https://i.ibb.co/xjP7Fs8/board-cloud-2.png) 0 0/100% no-repeat;
}

.parallax__element_2 {
	top: 46%;
	left: 40%;
}

.parallax__element_2 span {
	background: url(https://i.ibb.co/PTYtfF5/board-cloud-1.png) 0 0/100% no-repeat;
}

.parallax__element_3 {
	top: 24%;
	left: 80%;
}

.parallax__element_3 span {
	background: url(https://i.ibb.co/b75h5RG/board-birds.png) 0 0/100% no-repeat;
}

.parallax__element_4 {
	left: 10%;
	top: 17%;
}

.parallax__element_4 span {
	background: url(https://i.ibb.co/PTYtfF5/board-cloud-1.png) 0 0/100% no-repeat;
}

.parallax__element_5 {
	left: 50%;
	top: 56%;
}

.parallax__element_5 span {
	background: url(https://i.ibb.co/bmNDQdq/board-cloud-4.png) 0 0/100% no-repeat;
}

.parallax__element_6 {
	left: 30%;
	top: 57%;
}

.parallax__element_6 span {
	background: url(https://i.ibb.co/b75h5RG/board-birds.png) 0 0/100% no-repeat;
}

.parallax__element_7 {
	left: 60%;
	top: 65%;
}

.parallax__element_7 span {
	background: url(https://i.ibb.co/xjP7Fs8/board-cloud-2.png) 0 0/100% no-repeat;
}

.parallax__element_8 {
	left: 80%;
	top: 45%;
}

.parallax__element_8 span {
	background: url(https://i.ibb.co/njV8dQW/board-cloud-3.png) 0 0/100% no-repeat;
}

.parallax__wave {
	position: absolute;
	background: url(https://i.ibb.co/jZnqKRK/wave-plain.png) 0 0 / auto 101%
		repeat-x;
	left: -100%;
	width: 300%;
	opacity: 0;
}

.parallax__wave_1 {
	bottom: 180px;
	height: 86px;
	animation: wave 7.11111s 0.1s infinite linear;
	background: url(https://i.ibb.co/Lv4rHNc/wave-paint.png) 0 0 / auto 101%
		repeat-x;
}

.parallax__wave_2 {
	bottom: 144px;
	height: 115px;
	animation: wave 6.66667s 0.1s infinite linear;
}

.parallax__wave_3 {
	bottom: 108px;
	height: 144px;
	animation: wave 6.22222s 0.1s infinite linear;
	background: url(https://i.ibb.co/Lv4rHNc/wave-paint.png) 0 0 / auto 101%
		repeat-x;
}

.parallax__wave_4 {
	bottom: 72px;
	height: 173px;
	animation: wave 5.77778s 0.1s infinite linear;
}

.parallax__wave_5 {
	bottom: -1px;
	height: 230px;
	animation: wave 4.0888s 0.1s infinite linear;
}

.parallax__wave_6 {
	bottom: -72px;
	height: 288px;
	animation: wave 4.5s 0.1s infinite linear;
	background: url(https://i.ibb.co/Lv4rHNc/wave-paint.png) 0 0 / auto 101%
		repeat-x;
}

.parallax__litehouse {
	background: url(https://i.ibb.co/7yY6GhY/lighthouse.png);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: 50% bottom;
	width: 26vmin;
	height: 70vmin;
	position: absolute;
	right: 12%;
	bottom: -100%;
	animation: lighthouse 4s 0.1s infinite alternate
		cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.content {
	color: #fff;
}
@keyframes swing {
	0% {
		transform: rotateZ(10deg);
	}
	to {
		transform: rotateZ(-10deg);
	}
}

@keyframes wave {
	0% {
		transform: rotateZ(0deg) translate3d(0, 10%, 0) rotateZ(0deg);
	}
	to {
		transform: rotateZ(360deg) translate3d(0, 10%, 0) rotateZ(-360deg);
	}
}

@keyframes lighthouse {
	0% {
		transform: translate3d(15%, 0, 0) rotateZ(10deg);
	}
	to {
		transform: translate3d(-15%, 0, 0) rotateZ(-10deg);
	}
}

              
            
!

JS

              
                window.onload = () => {
	const wrapper = document.getElementsByClassName("wrapper")[0];
	wrapper.classList.add("active");
	const layers = [...document.querySelectorAll("#scene>li")];
	const w = window.innerWidth;
	const h = window.innerHeight;
	layers.forEach((l) => {
		l.classList.add("layer");
		l.style.width = w + "px";
		l.style.height = h + "px";
	});
	const scene = document.getElementById("scene");
	const parallaxInstance = new Parallax(scene);
};

              
            
!
999px

Console