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="main-container">

	<div class="title-container">

		<div class="startImage">

			<img src="https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/gifs/start_game.gif" alt="Super Mario Bros Start Game GIF">

		</div>

		<div class="main-title">

			<div class="logo">

				<img src="https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/logo.png" alt="Super Mario Bros Title">

			</div>

			<!--<div class="title"> -->

			<h1>SUPER MARIO BROS TIMELINE:</h1>

			<!-- </div> -->

		</div>

		<div class="endImage">

			<img src="https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/group_photo.jpg">

		</div>

	</div>

	<div class="timeline-container">
		<iv class="timeline-slide-container">

			<div class="slide year1985">

				<div class="cover-art"></div>

				<h2>1985</h2>

			</div>

			<div class="slide year1986">

				<div class="cover-art"></div>

				<h2>1986</h2>

			</div>

			<div class="slide year1988-1">

				<div class="cover-art"></div>

				<h2>1988</h2>

			</div>

			<div class="slide year1988-2">

				<div class="cover-art"></div>

				<h2>1988</h2>

			</div>

			<div class="slide year1989">

				<div class="cover-art"></div>

				<h2>1989</h2>

			</div>

			<div class="slide year1992">

				<div class="cover-art"></div>

				<h2>1992</h2>

			</div>

			<div class="slide year1995">

				<div class="cover-art"></div>

				<h2>1995</h2>

			</div>

			<div class="slide year1996">

				<div class="cover-art"></div>

				<h2>1996</h2>

			</div>

			<div class="slide year2002">

				<div class="cover-art"></div>

				<h2>2002</h2>

			</div>

			<div class="slide year2006">

				<div class="cover-art"></div>

				<h2>2006</h2>

			</div>

			<div class="slide year2007">

				<div class="cover-art"></div>

				<h2>2007</h2>

			</div>

			<div class="slide year2009">

				<div class="cover-art"></div>

				<h2>2009</h2>

			</div>

			<div class="slide year2010">

				<div class="cover-art"></div>

				<h2>2010</h2>

			</div>

			<div class="slide year2011">

				<div class="cover-art"></div>

				<h2>2011</h2>

			</div>

			<div class="slide year2012-1">

				<div class="cover-art"></div>

				<h2>2012</h2>

			</div>

			<div class="slide year2012-2">

				<div class="cover-art"></div>

				<h2>2012</h2>

			</div>

			<div class="slide year2013">

				<div class="cover-art"></div>

				<h2>2013</h2>

			</div>

			<div class="slide year2015">

				<div class="cover-art"></div>

				<h2>2015</h2>

			</div>

			<div class="slide year2016">

				<div class="cover-art"></div>

				<h2>2016</h2>

			</div>

			<div class="slide year2017">

				<div class="cover-art"></div>

				<h2>2017</h2>

			</div>

			<div class="slide year2019">

				<div class="cover-art"></div>

				<h2>2019</h2>

			</div>

			<div class="slide year2021">

				<div class="cover-art"></div>

				<h2>2021</h2>

			</div>

	</div>

</div>

</div>
              
            
!

CSS

              
                .main-container,
.title-container,
.main-title,
.timeline-slide-container,
.slide {
	display: flex;
}

.main-container {
	flex-direction: column;

	justify-content: center;

	align-items: center;
}

.main-title {
	flex-direction: column;

	text-align: center;
}

.year1985 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/1985.jpg");
}

.year1985 .cover-art:hover {
	animation: rotateCover1 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1986 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/lost_levels.png");
}

.year1986 .cover-art:hover {
	animation: rotateCoverLost 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1988-1 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario2.png");
}

.year1988-1 .cover-art:hover {
	animation: rotateCover2 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1988-2 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario3.png");
}

.year1988-2 .cover-art:hover {
	animation: rotateCover3 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1989 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_land.png");
}

.year1989 .cover-art:hover {
	animation: rotateCoverLand 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1992 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_land6.jpg");
}

.year1992 .cover-art:hover {
	animation: rotateCoverLand2 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1995 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_world_2.jpg");
}

.year1995 .cover-art:hover {
	animation: rotateCoverYoshi 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year1996 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_64.png");
}

.year1996 .cover-art:hover {
	animation: rotateCoverSuperMario64 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2002 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_sunshine.png");
}

.year2002 .cover-art:hover {
	animation: rotateCoverSunshine 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2006 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros.png");
}

.year2006 .cover-art:hover {
	animation: rotateCoverNewDS 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2007 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_galaxy.jpg");
}

.year2007 .cover-art:hover {
	animation: rotateCoverGalaxy 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2009 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bros_wii.jpg");
}

.year2009 .cover-art:hover {
	animation: rotateCoverNewWii 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2010 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_galaxy2.png");
}

.year2010 .cover-art:hover {
	animation: rotateCoverGalaxy2 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2011 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_3d_land.png");
}

.year2011 .cover-art:hover {
	animation: rotateCover3DLand 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2012-1 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros2.jpg");
}

.year2012-1 .cover-art:hover {
	animation: rotateCoverNew2 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2012-2 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_u.png");
}

.year2012-2 .cover-art:hover {
	animation: rotateCoverSuperMarioU 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2013 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_3d_world.png");
}

.year2013 .cover-art:hover {
	animation: rotateCover3DWorld 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2015 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_maker.jpg");
}

.year2016 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_run.png");
}

.year2017 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_odyssey.jpg");
}

.year2017 .cover-art:hover {
	animation: rotateCoverOdyssey 1.5s linear 1;
	animation-fill-mode: forwards;
}

.year2019 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_maker2.jpg");
}

.year2021 .cover-art {
	background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bowsers_fury.jpg");
}

.year2021 .cover-art:hover {
	animation: rotateCoverBowsersFury 1.5s linear 1;
	animation-fill-mode: forwards;
}

/* 320px */
@media screen and (min-width: 320px) {
	.title-container,
	.timeline-slide-container {
		flex-direction: column;

		width: 90vw;
	}

	.title-container {
		margin-bottom: 2%;
	}

	. .startImage,
	.endImage {
		display: none;
	}

	.startImage img,
	.endImage img {
		width: 0;
	}

	.logo img {
		width: 50%;
	}

	h1,
	h2 {
		font-size: 0.8em;
	}

	.timeline-container {
		overflow-x: hidden;

		overflow-y: hidden;
	}

	.timeLine-slide-container {
		width: 90%;
	}

	.slide {
		flex-direction: column;

		height: 100vh;

		justify-content: center;

		text-align: center;
	}

	.cover-art {
		width: 100%;
		height: 100%;

		background-size: 180px;
		background-repeat: no-repeat;
		background-position: center;

		margin-top: 0.75%;
	}
}

/*640px */

@media screen and (min-width: 640px) {
	h1,
	h2 {
		font-size: 1.5em;
	}
}

/* 1200px */
@media screen and (min-width: 1200px) {
	.title-container {
		flex-direction: row;

		width: 90vw;
		height: 39vh;

		margin-bottom: 1%;
	}

	.startImage,
	.main-title,
	.endImage {
		width: 33.33%;
		height: 100%;
	}

	.main-title {
		flex-direction: column;
	}

	.startImage,
	.endImage {
		text-align: center;
	}

	.startImage img {
		width: 35%;
	}

	.logo {
		width: 100%;
		height: 100%;
	}

	.logo img {
		width: 30%;
	}

	h1 {
		margin-top: 1%;

		font-size: 1em;
	}

	.endImage img {
		width: 25%;
	}

	.timeline-container {
		width: 80vw;
		height: 50vh;

		overflow-x: scroll;

		overflow-y: hidden;

		box-shadow: 10px 10px 10px;
	}

	.timeline-slide-container {
		flex-direction: row;

		width: 575vw;
		height: 105%;
	}

	.slide {
		flex-direction: column;

		width: 10%;
		height: 100%;
	}

	.slide h2 {
		text-align: center;
	}

	.cover-art {
		width: 100%;
		height: 100%;

		background-position: center;
		background-repeat: no-repeat;
	}
}

@media screen and (min-width: 1600px) {
	h1,
	h2 {
		font-size: 1.75em;
	}

	.title-container {
		height: 28vh;

		margin-bottom: 0.5%;
	}

	.startImage img {
		width: 30%;
	}

	.endImage img {
		width: 25%;
	}

	.timeline-container {
		height: 68vh;
	}

	.cover-art {
		background-size: 250px;

		margin-bottom: -10%;
	}
}

@keyframes rotateCover1 {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/1985.jpg");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bros_NES.gif");
	}
}

@keyframes rotateCover2 {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario2.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bros2_NES.gif");
	}
}

@keyframes rotateCover3 {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario3.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bros3_NES.gif");
	}
}

@keyframes rotateCoverLost {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/lost_levels2.png");
	}
}

@keyframes rotateCoverLand {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_land_gif.gif");
	}
}

@keyframes rotateCoverLand2 {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/land2GIF.gif");
	}
}

@keyframes rotateCoverYoshi {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/yoshis_island.gif");
	}
}

@keyframes rotateCoverSuperMario64 {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_64.gif");
	}
}

@keyframes rotateCoverSunshine {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/sunshine.gif");
	}
}

@keyframes rotateCoverNewDS {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros_ds.gif");
	}
}

@keyframes rotateCoverGalaxy {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_sunshine.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/galaxy.gif");
	}
}

@keyframes rotateCoverNewWii {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bros_wii.jpg");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros_wii.gif");
	}
}

@keyframes rotateCoverGalaxy2 {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_galaxy2.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/galaxy2.gif");
	}
}

@keyframes rotateCover3DLand {
	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_3DLand.gif");
	}
}

@keyframes rotateCoverNew2 {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros2.jpg");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/new_super_mario_bros2.gif");
	}
}

@keyframes rotateCoverSuperMarioU {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_u.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_u.gif");
	}
}

@keyframes rotateCover3DWorld {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_3d_world.png");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_3DWorld.gif");
	}
}

@keyframes rotateCoverOdyssey {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_odyssey.jpg");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/odyssey.gif");
	}
}

@keyframes rotateCoverBowsersFury {
	50% {
		transform: rotateY(90deg);
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/super_mario_bowsers_fury.jpg");
	}

	100% {
		background-image: url("https://adevelopersprofile.com/CodePen/Challenges/MarioTimeline/bowsers_fury.gif");
	}
}

              
            
!

JS

              
                // Horiztonal scrolling

let container = document.querySelector(".timeline-container");

window.addEventListener("wheel", function (e) {
	if (e.deltaY > 0) {
		container.scrollLeft += 100;
	} else {
		container.scrollLeft -= 100;
	}
});

              
            
!
999px

Console