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

              
                <h1>Bertie's<br /><span>Big</span><br /> Burgers</h1>

<div class="hamburger" id="hamburger">
	<div class="bun top">
		<a id="locations">Locations & Hours</a>
		<div class="seeds">
			<div class="seed s1">
				<a>New York City</a>
			</div>
			<div class="seed s2">
				<a>Chicago</a>
			</div>
			<div class="seed s3">
				<a>San Francisco</a>
			</div>
			<div class="seed s4">
				<a>Los Angeles</a>
			</div>
			<div class="seed s5">
				<a>Philadelphia</a>
			</div>
			<div class="seed s6">
				<a>Toronto</a>
			</div>
			<div class="seed s7">
				<a>Vancouver</a>
			</div>
		</div>
	</div>
	<a class="menu_link menu_1">Burgers</a>
	<div class="mid salad"></div>
	<a class="menu_link menu_2">Fries</a>
	<div class="mid burger">
		<a id="menu">Menu</a>
	</div>
	<a class="menu_link menu_3">Salads</a>
	<div class="mid tomato"></div>
	<a class="menu_link menu_4">Shakes</a>
	<div class="bun bot">
		<a>Join the big burger club</a>
		<a>Takeout & delivery</a>
		<a>Catering</a>
	</div>
</div>

<!--nav class="menu">
	<ul>
		<li>Locations & Hours
			<ul>
				<li>New York City</li>
				<li>Chicago</li>
				<li>San Francisco</li>
				<li>Los Angeles</li>
				<li>Philadelphia</li>
				<li>Toronto</li>
				<li>Vancouver</li>
			</ul>
		</li>
		<li>Menu
			<ul>
				<li>Burgers
					<ul>
						<li>The Big Cheese</li>
						<li>The Big Veg</li>
						<li>The Double Big-Big</li>
						<li>The Big Boss</li>
						<li>The Little Big</li>
					</ul>
				</li>
				<li>Fries
					<ul>
						<li>Classic Fries</li>
						<li>Seasoned Fries</li>
						<li>Curly Fries</li>
						<li>Tater Tots</li>
					</ul>
				</li>
				<li>Salads
					<ul>
						<li>The Big 'Burg</li>
						<li>The Big Ceasar</li>
						<li>The Giant Garden</li>
					</ul>
				</li>
				<li>Shakes
					<ul>
						<li>Big Vanilla</li>
						<li>Big Chocolate</li>
						<li>Big Strawberry</li>
						<li>Big Cookies & Creme</li>
					</ul>
				</li>
			</ul>
		</li>
		<li>Takeout & Delivery</li>
		<li>Catering</li>
		<li>Join the Big Burger Club</li>
	</ul>
</nav-->

<!--section class="article">
	<img src="https://assets.codepen.io/t-1/lefteris-kallergis-_TLKIVSW6Do-unsplash.jpg" alt="a vegetarian burger with a quinoa patty and lots of vegetable fixins.">
	<!-- photo by Lefteris kallergis for Unsplash. Full-size image at: https://unsplash.com/photos/_TLKIVSW6Do ->
	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Qui dicta minus molestiae vel beatae natus eveniet ratione temporibus aperiam harum alias officiis assumenda officia quibusdam deleniti eos cupiditate dolore doloribus!</p>
	<p>Ad dolore dignissimos asperiores dicta facere optio quod commodi nam tempore recusandae. Rerum sed nulla eum vero expedita ex delectus voluptates rem at neque quos facere sequi unde optio aliquam!</p>
	<img src="https://assets.codepen.io/t-1/jay-gajjar-vsYCZVef28E.jpg" alt="french fries seasoned with garlic and spices in a brown craft paper container. ">
	<!-- photo by Jay Gajjar for Unsplash. Full-size image at: https://unsplash.com/photos/vsYCZVef28E ->
	<p>Tenetur quod quidem in voluptatem corporis dolorum dicta sit pariatur porro quaerat autem ipsam odit quam beatae tempora quibusdam illum! Modi velit odio nam nulla unde amet odit pariatur at!</p>
	<img src="https://assets.codepen.io/t-1/melissa-walker-horn-NkwNp3ho-Qw-unsplash.jpg" alt="a burger, fries, and a beer on a restaurant table. ">
	<!-- photo by Melissa Walker Horn for Unsplash. Full size image at: https://unsplash.com/photos/NkwNp3ho-Qw ->
	<p>Consequatur rerum amet fuga expedita sunt et tempora saepe? Iusto nihil explicabo perferendis quos provident delectus ducimus necessitatibus reiciendis optio tempora unde earum doloremque commodi laudantium ad nulla vel odio?</p>
</section-->
              
            
!

CSS

              
                // Colors
$white: #f1f1f1;
$light-grey: #ebebeb;
$yellow: #c1a541;
$green: #72ba60;
$brown: #8e6b41;
$red: #d06767;
$blu: #616ee7;

* {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	font-family: "Bungee", sans-serif;
	color: $white;
	text-decoration: none;
}

body {
	background-color: $blu;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20px;

	h1 {
		font-size: 48px;
		line-height: 1;
		text-align: center;

		span {
			font-size: 121px;
			line-height: 0.8;
		}
	}

	.hamburger {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-size: 18px;
		height: 600px;
		width: 400px;
		overflow: hidden;

		/*
		transform: scale(0.2);
		transform-origin: top right;
		transition: 0.3s;
		position: fixed;
		top: 20px;
		right: 20px;
		cursor: pointer;

		&.active {
			transform: scale(1);
			height: 600px;
			width: 400px;
			cursor: default;

			a {
				display: initial;
			}
		}
		*/

		.bun {
			z-index: 1;
			height: 150px;
			width: 350px;
			background-color: $yellow;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			transition: 0.3s;

			&.top {
				transform-origin: bottom right;
				border-top-right-radius: 400px;
				border-top-left-radius: 400px;
				padding-top: 25px;

				.seeds {
					position: absolute;
					transition: 0.3s;

					.seed {
						width: 12px;
						height: 18px;
						background-color: $light-grey;
						border-radius: 100%;
						display: flex;
						align-items: center;
						justify-content: center;
						transition: 0.3s;

						a {
							opacity: 0;
							pointer-events: none;
							font-family: "Work Sans", sans-serif;
							position: absolute;
							text-align: center;
							white-space: nowrap;
							font-size: 16px;
							margin-top: -40px;
							transition: 0.3s;
						}

						&.s1 {
							transform: translate(-130px, 45px) rotate(31deg);

							a {
								transform: rotate(-31deg);
							}
						}
						&.s2 {
							transform: translate(-85px, 78px) rotate(17deg);

							a {
								transform: rotate(-17deg);
							}
						}
						&.s3 {
							transform: translate(-53px, -44px) rotate(23deg);

							a {
								transform: rotate(-23deg);
							}
						}
						&.s4 {
							transform: translateY(-25px);
						}
						&.s5 {
							transform: translate(48px, 14px) rotate(-9deg);

							a {
								transform: rotate(9deg);
							}
						}
						&.s6 {
							transform: translate(100px, -72px) rotate(-28deg);

							a {
								transform: rotate(28deg);
							}
						}
						&.s7 {
							transform: translate(144px, -15px) rotate(-15deg);

							a {
								transform: rotate(15deg);
							}
						}
					}
				}
			}
			&.bot {
				transform-origin: top right;
				border-bottom-right-radius: 400px;
				border-bottom-left-radius: 400px;
			}
		}
		.mid {
			z-index: 1;
			height: 22px;
			width: 370px;
			border-radius: 50px;
			transition: 0.3s;

			&.salad {
				transform-origin: center right;
				background-color: $green;
			}
			&.burger {
				background-color: $brown;
				height: 35px;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
			}
			&.tomato {
				transform-origin: center right;
				background-color: $red;
			}
		}
		a {
			z-index: 2;
			cursor: pointer;
			user-select: none;

			&.menu_link {
				z-index: 0;
				position: absolute;
				transform-origin: center center;
				font-family: "Work Sans", sans-serif;
				font-size: 18px;
				transition: 0.3s;

				&.menu_1 {
					transform: translate(170px, -40px) scale(0);
				}
				&.menu_2 {
					transform: translate(170px, -18px) scale(0);
				}
				&.menu_3 {
					transform: translate(170px, 18px) scale(0);
				}
				&.menu_4 {
					transform: translate(170px, 40px) scale(0);
				}
			}
		}
		&.open_top {
			.bun.top {
				.seeds {
					.seed {
						a {
							opacity: 1;
							pointer-events: initial;
						}

						&.s1 {
							transform: translate(-180px, -20px) rotate(31deg);
						}
						&.s2 {
							transform: translate(-205px, 51px) rotate(17deg);
						}
						&.s3 {
							transform: translate(-108px, -113px) rotate(23deg);
						}
						&.s4 {
							transform: translateY(-105px);
						}
						&.s5 {
							transform: translate(160px, -85px) rotate(-9deg);
						}
						&.s6 {
							transform: translate(113px, -165px) rotate(-28deg);
						}
						&.s7 {
							transform: translate(217px, -49px) rotate(-15deg);
						}
					}
				}
			}
		}
		&.open_side {
			.bun {
				&.top {
					transform: rotate(30deg);
				}
				&.bot {
					transform: rotate(-30deg);
				}
			}
			.mid {
				&.salad {
					transform: rotate(15deg);
				}
				&.burger {
				}
				&.tomato {
					transform: rotate(-15deg);
				}
			}
			a.menu_link {
				&.menu_1 {
					transform: translate(-115px, -160px) scale(1) rotate(22.5deg);
				}
				&.menu_2 {
					transform: translate(-145px, -60px) scale(1) rotate(7.5deg);
				}
				&.menu_3 {
					transform: translate(-145px, 60px) scale(1) rotate(-7.5deg);
				}
				&.menu_4 {
					transform: translate(-115px, 160px) scale(1) rotate(-22.5deg);
				}
			}
		}
	}
}

              
            
!

JS

              
                $("#menu").on("click", () => {
	$("#hamburger").toggleClass("open_side");
	$("#hamburger").removeClass("open_top");
});

$("#locations").on("click", () => {
	$("#hamburger").toggleClass("open_top");
	$("#hamburger").removeClass("open_side");
});

$("#hamburger").on("click", () => {
	if ($("#hamburger").hasClass("active")) {
		console.log("active");
		/*$("#hamburger").removeClass("open_top");
		$("#hamburger").removeClass("open_side");
		$("#hamburger").removeClass("active");
		$("#hamburger").addClass("idle");*/
	} else {
		console.log("idle");
		$("#hamburger").removeClass("open_top");
		$("#hamburger").removeClass("open_side");
		$("#hamburger").removeClass("idle");
		$("#hamburger").addClass("active");
	}
});

              
            
!
999px

Console