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. 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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="all">
<div id="loader"></div>

<div id='warning'>
	<p>Click 'start' and use the arrow keys to navegate (up and down)</p>
</div>

<div id='wrapper'>
	<header class='card zero'>
		<h1>Hello, I'm a card</h1>
		<p class='description'>
			And I have a really short subtitle. Isn't this font nice?
			A bit stupid, I know..
		</p>	
		<button id='start'>start</button>
	</header>

	<div class="card one">
		<div class='side-info'>
			<p class="description"> Avocados </p>

			<ol>
				<li>They make a great smoothie</li>
				<li>They are really soft inside, nice texture</li>
				<li>Amazing color pallete</li>
				<li>Guacamole</li>
			</ol>
		</div>

		<div class='avocado'>
			<div class='seed'>
				<div class='face'></div>
			</div>
		</div>
	</div>

	<div class="card two">
		<div class='star' style='left: 20%; top: 50%;'></div>
		<div class='star' style='left: 75%; top: 20%;'></div>
		<div class='star' style='left: 85%; top: 35%;'></div>
		<div class='star' style='left: 35%; top: 18%;'></div>
		<div class='star' style='left: 70%; top: 60%;'></div>

		<div class='sun'>
			<div class='face'></div>
			<div class='shadow'></div>
		</div>
		<div class='textBlock bottom'>
			<p>"Billions and billions of stars...</p>
			<p>most of them are dead by now"</p>
		</div>
	</div>

	<div class="card twopointfive">
		<div class='textBlock top'><p>You don't need to search for your other half</p></div>
		<div class="egg">
			<div class='top'>
				<div class='face'>﹏</div>
			</div>
			<div class='yolk'></div>
			<div class='bottom'></div>
		</div>
		<div class='textBlock bottom'><p>Be the <i>one</i> for you</p></div>
	</div>

	<div class="card three">
		<div class="personal_header">
			<div class="photo"></div>
			<p class="title">Gabriel Cyrillo, 19 years, Brazilian</p>
			<p class="info">Computer Science student at ICMC-USP</p>
		</div>
		<p class='citation'>"I love potatoes because they <b>never</b> disappoint me"</p>
	</div>

	<div class="card four"><p>~ Fin ~</p></div>
</div>
</div>
              
            
!

CSS

              
                body {
	margin: 0px;
	padding: 0px;
	font-family: 'Work Sans', sans-serif;
	overflow: hidden;
}

#loader {
	position: fixed;
	z-index: 2;

	width: 0px;
	height: 10px;

	top: 0px;
	left: 0px;
	transition: 1s ease;
	background: linear-gradient(30deg, hsl(80, 50%, 50%), hsl(150, 50%, 50%));
}

#warning {
	position: fixed;
	z-index: 3;

	width: 500px;
	height: 40px;

	font-size: 13px;
	padding: 0px;

	top: 20px;
	left: calc(50% - 250px);
	
	border-radius: 20px;
	text-align: center;
	background: linear-gradient(45deg, hsl(0, 50%, 50%), hsl(30, 50%, 50%));
	color: #fff;
	opacity: 0.8;
	transition: 1s ease;
}

#wrapper {
	display: block;
	margin: calc(50vh - 200px) calc(50vw - 400px);
	width: 800px;
	height: 400px;
	font-family: 'Work Sans', sans-serif;
	transition: 1.2s ease;
	font-size: 20px;
}

#wrapper:hover {
	transform-origin: 50% 50%;
	transform: scale(1.02);
}

.card {
	position: relative;
	width: 100%;
	height: 100%;
	text-align: center;
	box-shadow: 0px 7px 10px 10px rgba(0,0,0,0.2);
	transition: 0.6s ease-in-out;
	opacity: 0;
	background: #fff;
	overflow: hidden;
}

.description {
	padding: 50px 20px 20px 20px;
	display: block;
	margin-top: 60px;
	text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.zero {
	width: 100%;
	height: 100%;
	background: linear-gradient(30deg, #f0a, #ff0);
	text-align: center;
	color: #fff;
	opacity: 1;
	cursor: auto;
	transition: 0.5s ease;

}

.zero h1 {
	position: relative;
	display: block;
	top: 100px;
}

.zero button {
	margin-top: -20px;
	background: linear-gradient(45deg, #f05a, transparent);
	font: 15px 'Work Sans', sans-serif;
	border: none;
	width: 30%;
	height: 40px;
	border-radius: 15px;
	transition: 0.5s ease;
}

.side-info {
	float: left;
	width: 40%;
	height: 100%;
	background: #0007;
	color: #fff;
	transition: 0.8s ease;
}

.side-info:hover, .textBlock:hover{
	background: #000a;
}

.side-info .description{
	margin-top: 25px;
  padding: 0px;
	font-size: 30px;
}

.zero button:hover{
	width: 50%;
	cursor: pointer;
}

.one {
	background: linear-gradient(20deg, hsl(100, 50%, 50%), hsl(200, 50%, 50%));
}

li {
	margin: 10px 20px 10px 10px;
	padding: 10px 20px 10px 20px;
	transition: 2s ease;
	border-bottom: 1px solid transparent;
}

li:hover {
	border-bottom-color: #fff;
}

.avocado {
	float: right;
	margin-right: 18%;
	margin-top: 5%;
	width: 200px;
	height: 320px;
	background: radial-gradient(ellipse at 100px 200px, #d5d99a, #ccdb6b 55%, #7a9441);
	border-radius: 50% 50% 50% 50% / 80% 80% 30% 30%;
	box-shadow: 0px 7px 10px 5px rgba(0,0,0,0.2), inset 0px 0px 20px 5px rgb(55, 61, 47, 0.3), inset 0px -8px 3px 3px #628535;
	transition: 0.5s ease-in-out;
	transform: rotate(5deg);
}

.avocado:hover {
	transform: rotate(-15deg);
}

.avocado .seed{
	width: 130px;
	height: 130px;
	margin: 65% calc(50% - 65px);
	background: radial-gradient(circle at 60px 20px, #d6a26d 5%, #b35820 30%, #662513 60%, #472a19);
	border-radius: 50%;
	box-shadow: 0px 5px 10px 5px rgba(0,0,0,0.2), inset 0px -7px 30px 8px rgba(82,0,0,0.8);
}

.avocado .face{
	position: absolute;
	display: block;
	margin: 30% calc(25% + 5px);
	width: 20px;
	height: 10px;
	border-radius: 5px 5px 100% 100% ;
	background-image: linear-gradient(#000, #f00);
	animation: 5s moveEyes alternate infinite;
}

.avocado .face:before {
	content: "";
	position: absolute;
	display: block;
	margin-top: -10px;
	margin-left: -30px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #000;
	animation: 3.5s wink alternate infinite;
}

.avocado .face:after {
	content: "";
	position: absolute;
	display: block;
	margin-top: -10px;
	margin-left: 50px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #000;
	transform: translateX(-10px);
	animation: 3.5s wink alternate infinite;
}

.two {
	background-image:	linear-gradient(45deg, hsl(300, 50%, 30%), hsl(200, 50%, 40%));
}

.two p {
	margin-top: -15px;
	color: #fff;
	text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
	transition: 1s ease;
}

.textBlock {
	width: 100%;
	padding: 10px;
	background: #0007;
	clear: both;
	transition: 1s ease;
}

.textBlock.top {
	position: absolute;
	top: 0px;
}

.textBlock.bottom {
	position: absolute;
	bottom: 0;
}

.textBlock p {
	transition: 1s ease;
	margin: 10px;
}

.textBlock p:hover {
	font-size: 30px;
}

.star {
	position: fixed;
	z-index: 2;
	background: hsla(50, 80%, 60%, 0.5);
	border-radius: 50%;
	width: 5px;
	height: 5px;
	transition: 7s ease;
	animation: 3s starlight alternate infinite;
}

.star:hover{
	cursor: pointer;
	background: hsla(50, 90%, 90%, 1);
	transform: scale(2.5);
}

.sun {
	display: block;
	margin: 5% auto;
	padding: 0px;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background-image: radial-gradient(circle at 90px 90px, hsl(40, 60%, 80%) 10%, hsl(50, 80%, 50%) 50%, hsl(20, 80%, 50%), hsl(20, 80%, 10%));
	transform-origin: calc(0% + 100px) 0% 0px;	
	animation: 2s sunlight alternate infinite;
	box-shadow: 0px 0px 30px 5px hsla(30, 80%, 50%, 0.5), inset 0px 0px 30px 30px rgba(0,0,0,0.5);
}

.sun .face {
	position: absolute;
	display: block;
	margin: 150px 90px;
	width: 20px;
	height: 10px;
	border-radius: 100% 100% 10px 10px ;
	background-image: linear-gradient(#000, #f90);
}

.sun .face:before {
	content: "";
	position: absolute;
	display: block;
	margin-top: -10px;
	margin-left: -50px;
	width: 13px;
	height: 10px;
	border-radius: 50% 50% 100% 100%;
	background: #000;
	animation: 4s wink alternate infinite;
}

.sun .face:after {
	content: "";
	position: absolute;
	display: block;
	margin-top: -10px;
	margin-left: 60px;
	width: 13px;
	height: 10px;
	border-radius: 50% 50% 100% 100%;
	background: #000;
	animation: 4s wink alternate infinite;
}

@keyframes wink {
	0% {
		height: 10px;
	} 10% {
		height: 0px;
	} 20% {
		height: 10px;
	}
}

@keyframes moveEyes {
	0% {
		transform: translateX(-10px);
	} 100% {
		transform: translateX(10px);
	}
}

@keyframes starlight {
	0% {
		box-shadow: 0px 0px 30px 5px hsla(50, 80%, 60%, 0.8);
	} 100% {
		box-shadow: 0px 0px 10px 5px hsla(50, 80%, 60%, 0.2);
	}
}

@keyframes sunlight {
	0% {
		transform: translateY(0px);
		box-shadow: 0px 0px 100px 15px hsla(40, 80%, 50%, 1);
	} 100% {
		transform: translateY(30px);
		box-shadow: 0px 0px 30px 5px hsla(40, 80%, 50%, 0.8);
	}
}

.twopointfive {
	background: linear-gradient(20deg, hsl(50, 100%, 50%), hsl(150, 50%, 50%));
	color: #fff;
	text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.egg .face {
	display: block;
	width: 200px;
	margin-left: calc(50% - 100px);
	color: #000;
	font-size: 50px;
	padding-top: 25%;
}

.egg .face::before {
	content: "";
	position: absolute;
	top:80px;
	left: 120px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #000;
	animation: 3.5s wink alternate infinite;
}

.egg .face::after {
	content: "";
	position: absolute;
	top:80px;
	left: 30px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #000;
	animation: 3.5s wink alternate infinite;
}

.egg {
	width: 100%;
	height: 300px;
	font-size: 17px;
}

.egg .top {
	position: absolute;
	z-index: 5;
	margin: 12% calc(50% - 80px);
	width: 160px;
	height: 140px;
	background: radial-gradient(ellipse at 100px 120px, #fff 50%, #aaa);
	-webkit-border-radius: 50% 50% 50% 50% / 80% 80% 10% 10%;
	border-radius: 50% 50% 50% 50% / 100% 100% 10% 10%;
	box-shadow: 0px 10px 30px 2px rgba(0,0,0,0.25) inset, 0px -10px 5px 2px rgba(0,0,0,0.25);
	transition: 0.5s ease-in-out;
}

.yolk {
	position: absolute;
	z-index: 3;
	margin: calc(12% + 80px) calc(50% - 40px);
	width: 80px;
	height: 40px;
	background: radial-gradient(circle, #fc0, #f90);
	-webkit-border-radius: 50px;
	border-radius: 50px 50px 12px 12px ;
	box-shadow: 0px 10px 10px 2px rgba(0,0,0,0.25) inset;
	transition: 0.5s ease-in-out;
}

.egg .bottom::before {
	content: "";
	position: absolute;
	top: -18px;
	left: 0px;
	z-index: 2;
	margin: 0px;
	width: 160px;
	height: 30px;
	background: radial-gradient(ellipse at 100px 0px, #ddd, #fff);
	-webkit-border-radius: 50% 50% 50% 50%;
}

.egg .bottom {
	position: absolute;
	z-index: 1;
	margin: calc(12% + 120px) calc(50% - 80px);
	width: 160px;
	height: 100px;
	background: radial-gradient(ellipse at 90px -80px, #fff 50%, #aaa);
	-webkit-border-radius: 0% 0% 100px 100px;
	border-radius: 0% 0% 100px 100px;
	box-shadow: 0px -10px 30px 2px rgba(0,0,0,0.25) inset;
}

.egg .top:hover {
	transform: translateY(-70px);
}

.three {
	background: linear-gradient(20deg, hsl(0, 100%, 50%), hsl(320, 50%, 50%));
}

.personal_header {
	width: 110%;
	height: 50%;
	background: #fff;
	margin-top: 80px;
	box-shadow: 0px 0px 4px 3px rgba(0,0,0,0.25);
	transform: rotate(4deg) translateX(-15px);
}

.personal_header .title {
	padding-top: 70px;
	font-size: 30px;
	font-weight: bold;
}

.personal_header .info {
	margin: -20px;
}

.citation {
	color: #fff;
	margin: 50px;
	text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.personal_header p {
	margin-left: 50px;
	transform: rotate(-4deg);
}

.personal_header .photo {
	position: absolute;
	z-index: 2;
	margin: 25px 55px 55px 55px;
	width: 150px;
	height: 150px;
	border-radius: 50%;
	background-image: url(https://pbs.twimg.com/media/DYDK6crWAAAihDs.jpg:large);
	background-size: 100%;
	box-shadow: -2px -2px 8px 8px rgba(0,0,0,0.25) inset;
	transform: rotate(-4deg);
	transition: 0.5s ease;
}

.personal_header .photo:hover {
	transform: scale(1.2) rotate(3deg);
}

.four {
	background: linear-gradient(20deg, #333, #000);
	color: #fff;
}

.four p {
	position: absolute;
	font-family: 'Great Vibes', cursive;
	width: 300px;
	margin-left: calc(50% - 150px);
	margin-top: 20%;
	text-align: center;
	font-size: 80px;
	color: #fff;
}
              
            
!

JS

              
                let wrapper = document.getElementById('wrapper');
let button = wrapper.querySelector('button');
let loader = document.getElementById('loader');
let warning = document.getElementById('warning');
let cards = wrapper.getElementsByClassName('card');
let i = 0;

function foward(){
	if(i > cards.length - 2) return;

	cards[++i].style.transform = "translateY(-"+ 390*i +"px)";
	wrapper.style.transform = "translateY(-"+10*i+"px)";
	cards[i].style.opacity = 1;
	loader.style.width = 100*i/(cards.length-1) + "%";
}

function backwards(){
	if(i <= 0) return;

	cards[i].style.opacity = 1;
	cards[i].style.transform = "translateY("+ 430*i--/cards.length +"vh)";
	cards[i].style.opacity = 1;
	wrapper.style.transform = "translateY(-"+2*i+"vh)";
	loader.style.width = 100*i/(cards.length-1) + "%";
}

button.onclick = function(){
	warning.style.opacity = 0;
	warning.style.transform = "translateY(-200px)";

	window.onkeydown = function(e){
		if(e.keyCode == 32 || e.keyCode == 40 || e.keyCode == 13 || e.keyCode == 83)
			foward();
		if(e.keyCode == 38 || e.keyCode == 87)
			backwards()
	}

	window.onclick = foward;
}
              
            
!
999px

Console