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

              
                <div id="wrapper">
	<h1>Off Canvas Menu with Animated Links</h1>
	<div class="mobile">
		<!-- Checkbox to toggle the menu -->
		<input type="checkbox" id="tm" />
		<!-- The menu -->
		<ul class="sidenav">
			<li><a href="#"><i class="fa fa-check"></i><b>Tasks</b></a></li>
			<li><a href="#"><i class="fa fa-inbox"></i><b>Messages</b></a></li>
			<li><a href="#"><i class="fa fa-pencil"></i><b>New Post</b></a></li>
			<li><a href="#"><i class="fa fa-cog"></i><b>Settings</b></a></li>
			<li><a href="#"><i class="fa fa-star"></i><b>Starred</b></a></li>
			<li><a href="#"><i class="fa fa-power-off"></i><b>Logout</b></a></li>
		</ul>
		<!-- Content area -->
		<section>
			<!-- Label for #tm checkbox -->
			<label for="tm">Click Me</label>
		</section>
	</div>
</div>
              
            
!

CSS

              
                /*Fontawesome Iconfont*/
@import url(http://thecodeplayer.com/uploads/fonts/font-awesome-4.0.1/css/font-awesome.min.css);
/*Montserrat, Open Sans*/
@import url(https://fonts.googleapis.com/css?family=Montserrat|Open+Sans:400,300);

* {
	margin: 0; padding: 0;
}

body {
	background: #333;
}

#wrapper {
	width: 645px; height: 500px; margin: 35px auto 0 auto;
}

h1 {
	color: white; font: 300 40px 'Open Sans';
	width: 300px; padding: 30px; float: left;
}

.mobile {
	float: left; position: relative;
	box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

/*Hiding the checkbox*/
#tm {display: none;}

/*Content area*/
.mobile section {
	background: url("http://thecodeplayer.com/uploads/media/mb1.png");
	width: 285px; height: 500px;
	position: relative; transition: all 0.25s;
}

.mobile section label {
	color: white; font: bold 14px Montserrat; text-align: center;
	border: 2px solid white; border-radius: 4px;
	display: block; padding: 10px 0;
	width: 60%; position: absolute; left: 20%; top: 100px;
	cursor: pointer; text-transform: uppercase;
}

/*Nav styles*/
.sidenav {
	background: rgb(50, 60, 60); width: 150px;
	position: absolute; left: 0; top: 0; bottom: 0; padding-top: 100px;
}

.sidenav li {
	list-style-type: none;
}

.sidenav a { 
	color: white; 
	text-decoration: none; 
}

.sidenav b {
	font: bold 12px/48px Montserrat; 
	display: block;
	opacity: 0; 
	-webkit-transform: translateX(50px);
	-moz-transform: translateX(50px);
	-ms-transform: translateX(50px);
	-o-transform: translateX(50px);
	transform: translateX(50px);

	-webkit-transition: all 0.4s;
	-moz-transition: all 0.4s;
	-ms-transition: all 0.4s;
	-o-transition: all 0.4s;
	transition: all 0.4s;
}

.sidenav i {
	display: block; 
	width: 50px; 
	float: left; 
	font-size: 16px; 
	line-height: 48px; 
	text-align: center;
}

/*Animation controls using checkbox hack*/
/*Animate content area to the right*/
#tm:checked ~ section {
	-webkit-transform: translateX(150px);
	-moz-transform: translateX(150px);
	-ms-transform: translateX(150px);
	-o-transform: translateX(150px);
	transform: translateX(150px);
}

/*Animate links from right to left + fade in effect*/
#tm:checked ~ .sidenav b {
	opacity: 1; 
	-webkit-transform: translateX(0);
	-moz-transform: translateX(0);
	-ms-transform: translateX(0);
	-o-transform: translateX(0);
	transform: translateX(0);
}

/*Adding delay to link animation - in multiples of .08s*/
/*One can use jQuery also for creating the delayed effect. But I will stick to manual CSS for this walkthrough.*/
#tm:checked ~ .sidenav li:nth-child(1) b {
	-webkit-transition-delay: 0.08s;
	-moz-transition-delay: 0.08s;
	-ms-transition-delay: 0.08s;
	-o-transition-delay: 0.08s;
	transition-delay: 0.08s;
}

#tm:checked ~ .sidenav li:nth-child(2) b {
	-webkit-transition-delay: 0.16s;
	-moz-transition-delay: 0.16s;
	-ms-transition-delay: 0.16s;
	-o-transition-delay: 0.16s;
	transition-delay: 0.16s;
}

#tm:checked ~ .sidenav li:nth-child(3) b {
	-webkit-transition-delay: 0.24s;
	-moz-transition-delay: 0.24s;
	-ms-transition-delay: 0.24s;
	-o-transition-delay: 0.24s;
	transition-delay: 0.24s;
}

#tm:checked ~ .sidenav li:nth-child(4) b {
	-webkit-transition-delay: 0.32s;
	-moz-transition-delay: 0.32s;
	-ms-transition-delay: 0.32s;
	-o-transition-delay: 0.32s;
	transition-delay: 0.32s;
}

#tm:checked ~ .sidenav li:nth-child(5) b {
	-webkit-transition-delay: 0.40s;
	-moz-transition-delay: 0.40s;
	-ms-transition-delay: 0.40s;
	-o-transition-delay: 0.40s;
	transition-delay: 0.40s;
}

#tm:checked ~ .sidenav li:nth-child(6) b {
	-webkit-transition-delay: 0.48s;
	-moz-transition-delay: 0.48s;
	-ms-transition-delay: 0.48s;
	-o-transition-delay: 0.48s;
	transition-delay: 0.48s;
}
              
            
!

JS

              
                
              
            
!
999px

Console