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

              
                <!-- fun CSS image and animation effects! -->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="preconnect" href="https://fonts.googleapis.com" />
	<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
	<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap" rel="stylesheet" />
	<link rel="stylesheet" href="mystyles.css" />
	<title>Parallax</title>
	<script src="https://kit.fontawesome.com/41c8573884.js" crossorigin="anonymous"></script>
</head>

<body>
	<!-- back to top button -->
	<button onclick="topFunction()" id="top-button" title="Go to top">
		<i class="fas fa-long-arrow-alt-up"></i></i>
	</button>
	<!-- PARALLAX -->
	<!-- first parallax section -->
	<section class="first">
		<!-- HEADING -->
		<section class="parallax-img-1">
			<div class="section-heading">
				<br />
				<h1>birth</h1>
				<br />
			</div>
		</section>
		<!-- lorem ipsum -->
		<h2>
			Aliqua amet esse elit eiusmod irure Lorem incididunt exercitation
			magna ullamco. Cillum occaecat eiusmod culpa duis nisi do laborum.
			Nulla et reprehenderit veniam duis dolor ullamco consectetur non
			exercitation exercitation officia in. Et id velit non id eiusmod sit
			dolor do non ex. Ipsum enim duis labore ut excepteur est esse
			incididunt.
		</h2>
		<h2>
			Velit id est tempor labore est ullamco duis non id enim nulla
			tempor. Nisi incididunt proident labore culpa velit aliquip eiusmod.
			Magna enim qui deserunt ipsum irure. Est esse deserunt esse velit
			nisi quis consequat et est.
		</h2>
		<h2>
			Irure aute dolore proident eiusmod sint minim adipisicing laborum
			excepteur. Quis aliqua magna culpa ut esse amet sint sunt. Non
			adipisicing aliquip elit officia nostrud deserunt est. Mollit
			nostrud amet officia aute nostrud dolor enim et. Ullamco eu sit
			veniam reprehenderit pariatur et cupidatat. Proident irure
			reprehenderit proident excepteur sunt cillum sit proident veniam.
		</h2>
		<!-- second parallax section -->
		<!-- HEADING -->
		<section class="parallax-img-2">
			<div class="section-heading">
				<br />
				<h1>life</h1>
				<br />
			</div>
		</section>
	</section>
	<section class="second">
		<!-- lorem ipsum -->
		<h2>
			Nostrud velit excepteur ipsum non proident incididunt sunt anim
			tempor ex laborum ea aute ut. Incididunt ex mollit irure sunt do
			minim aliquip occaecat quis. Ex dolore officia deserunt ipsum velit
			quis dolore. Id laboris ea adipisicing culpa aliqua Lorem non
			nostrud. Cillum ex amet aute dolore do ad do laboris pariatur enim
			sint sint velit in. Do pariatur consequat irure fugiat pariatur.
			Commodo id ea minim et consectetur et pariatur.
		</h2>
		<h2>
			Veniam nulla velit veniam nisi amet ullamco. Sunt aliquip nostrud
			Lorem aute. Velit ex est laboris reprehenderit. Exercitation amet
			deserunt eiusmod anim dolor ea sunt nulla mollit do ex aliquip in
			deserunt. Elit eiusmod do Lorem reprehenderit nulla cupidatat
			consequat velit ullamco aliquip cupidatat. Ipsum ex quis dolor ut
			fugiat ullamco id ad ullamco mollit dolor veniam. Voluptate minim do
			eu tempor pariatur.
		</h2>
		<h2>
			Ut cillum cupidatat pariatur laboris id. Anim adipisicing amet
			aliquip enim. Eiusmod mollit sint quis laboris enim incididunt culpa
			nulla exercitation nisi culpa.
		</h2>
		<!-- third parallax section -->
		<!-- HEADING -->
		<section class="parallax-img-3">
			<div class="section-heading">
				<br />
				<h1>death</h1>
				<br />
			</div>
		</section>
		<!-- lorem ipsum -->
		<h2>
			Non consectetur exercitation laboris mollit esse. Minim tempor duis
			eiusmod dolore aliquip aute sit deserunt reprehenderit duis aute.
			Excepteur elit cillum mollit adipisicing pariatur et mollit
			excepteur non.
		</h2>
		<h2>
			Aliqua pariatur voluptate non sunt elit fugiat sunt culpa dolore.
			Consequat ex aliqua Lorem nostrud. Magna officia ut sint ad eiusmod
			mollit. Pariatur tempor aliqua labore eu culpa amet aliquip qui
			tempor nulla adipisicing. Aliqua laborum elit cupidatat consectetur
			eiusmod incididunt exercitation amet exercitation officia magna ad
			mollit. Dolor reprehenderit amet incididunt qui officia occaecat
			amet. Enim non ipsum pariatur amet non non velit duis esse est.
		</h2>
		<h2>
			Irure deserunt exercitation tempor excepteur. Sit eu ea do ex amet
			laborum enim nostrud cupidatat. In minim aute est amet velit
			commodo.
		</h2>
	</section>
	<!-- FOOTER -->
	<footer>
		<p>Developed by Raya Bergin &copy; v2-4Feb2022</p>
		<div class="footer-flex">
			<p>Credits:</p>
			<p>1st photo by Isaac Quesada on Unsplash</p>
			<p>2nd photo by Mohamed Nohassi on Unsplash</p>
			<p>3rd photo by Kenny Orr on Unsplash</p>
		</div>
	</footer>
	<script src="myscripts.js"></script>
</body>

</html>
              
            
!

CSS

              
                /* MY TEMPLATE RESET */
* {
	/* Outline to view layout on screen while styling | Remove after styling */
	/* outline: 1px dashed #ff0075; */
	margin: 0;
	padding: 0;
	scroll-behavior: smooth;
}
html {
	box-sizing: border-box;
	font-size: 100%;
}
*,
*:before,
*:after {
	box-sizing: inherit;
}

/* color variables */
:root {
	--beige: #fef5ed;
	--dark-purple: #150050;
	--baby-blue: #e0ffff;
	--grayish-light-green: #acd1af;
	--light-purple: #af8fe9;
}

/* body styles */
body {
	font-family: "Quicksand", sans-serif;
	background-color: var(--beige);
	width: 100%;
	max-width: 100em;
	margin: 0 auto;
}

/* back to the top button */
#top-button {
	display: none;
	position: fixed;
	bottom: 1.5em;
	right: 1.5em;
	z-index: 2;
	font-size: 2rem;
	border: none;
	outline: none;
	background-color: var(--dark-purple);
	color: var(--baby-blue);
	cursor: pointer;
	padding: 0.5em;
	border-radius: 0.25em;
}
#top-button:hover {
	color: var(--dark-purple);
	background-color: var(--baby-blue);
}

/* PARALLAX */
/* first parallax section */
.parallax-img-1 {
	background: url(https://images.unsplash.com/photo-1591161555818-7b9debeccc07?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2070&q=80)
		no-repeat fixed 100%;
	background-size: cover;
	color: var(--baby-blue);
}
/* second parallax section */
.parallax-img-2 {
	background: url(https://images.unsplash.com/photo-1490730141103-6cac27aaab94?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2070&q=80)
		no-repeat fixed 100%;
	background-size: cover;
	color: var(--grayish-light-green);
}
/* third parallax section */
.parallax-img-3 {
	background: url(https://images.unsplash.com/photo-1581588525251-e1dca48e9827?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2070&q=80)
		no-repeat fixed 100%;
	background-size: cover;
	color: var(--light-purple);
}

/* PARALLAX headings */
.section-heading {
	padding-top: 25%;
	padding-bottom: 25%;
}
h1 {
	font-size: 10em;
	text-align: center;
}
h2 {
	color: var(--dark-purple);
	margin: 2em 3.25em 2em 3.25em;
	line-height: 1.5;
}

/* FOOTER */
footer {
	margin: 1em 1em;
	padding: 1em 0;
}
.footer-flex {
	display: flex;
	justify-content: center;
	flex-direction: column;
	line-height: 1.5;
}

/* laptop styles */
/* max-width 64em (1024px) */
@media (max-width: 64em) {
	/* back to the top button */
	#top-button {
		bottom: 1em;
		right: 1em;
	}

	/* PARALLAX headings */
	h2 {
		margin: 2em;
	}
}

/* tablet styles */
/* max-width 48em (768px) */
@media (max-width: 48em) {
	/* back to the top button */
	#top-button {
		bottom: 0.75em;
		right: 0.75em;
	}
	/* PARALLAX headings */
	h2 {
		margin: 1.5em;
	}
}

/* mobile styles */
/* max-width 26.5625em (425px) */
/* turn off parallax scrolling for mobile */
@media (max-width: 26.5625em) {
	/* back to the top button */
	#top-button {
		bottom: 0.5em;
		right: 0.5em;
	}
	/* PARALLAX */
	/* first parallax section */
	.parallax-img-1,
	/* second parallax section */
	.parallax-img-2,
	/* third parallax section */
	.parallax-img-3 {
		background-attachment: scroll;
	}
	/* PARALLAX headings */
	h1 {
		font-size: 6em;
	}
	h2 {
		margin: 1em;
	}
}

              
            
!

JS

              
                //Get the button
var mybutton = document.getElementById("top-button");

// When the user scrolls down 300px from the top of the document, show the button
window.onscroll = function () {
	scrollFunction();
};

function scrollFunction() {
	if (
		document.body.scrollTop > 300 ||
		document.documentElement.scrollTop > 300
	) {
		mybutton.style.display = "block";
	} else {
		mybutton.style.display = "none";
	}
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
	document.body.scrollTop = 0;
	document.documentElement.scrollTop = 0;
}

              
            
!
999px

Console