JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<html lang="en">
<head>
<meta charset="utf-8">
<title>TITLE</title>
<link rel="icon" type="image/x-icon" href="#" />
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link href='https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
</head>
<body>
<!-- SITE WRAPPER -->
<section id="site-wrapper">
<!-- CANVAS -->
<section id="site-canvas">
<!-- MENU -->
<section id="site-menu">
<section class="site-menu-content">
<a href="#" class="toggle-nav"><i class="fa fa-times"></i></a>
<a href="#"><h2>NAV 1</h2></a>
<a href="#"><h2>NAV 2</h2></a>
</section>
</section>
<!-- CANVAS CONTENT -->
<section class="content">
<!-- MENU TOGGLE -->
<a href="#" class="toggle-nav nav-icon"><i class="fa fa-bars"></i></a>
<!-- CONTENT -->
<h1>Full Page Off-Canvas Navigation Example</h1>
<p><a href="http://hipsum.co/">Oh. You need a little dummy text for your mockup? How quaint.</a> Locavore yr ugh next level cold-pressed DIY. Wolf Helvetica hella 3 wolf moon. Vice Williamsburg PBR chambray Shoreditch Carles, pop-up typewriter skateboard shabby chic High Life chia meggings. Pork belly lumbersexual cold-pressed sustainable, wayfarers jean shorts street art cornhole literally XOXO meggings kogi Brooklyn. Messenger bag chambray chia, PBR Echo Park pickled meditation shabby chic skateboard bespoke beard gluten-free stumptown try-hard. Brunch iPhone High Life direct trade slow-carb, cornhole raw denim +1 tofu selvage plaid semiotics American Apparel. +1 cray Tumblr Blue Bottle banh mi keffiyeh viral tote bag, farm-to-table banjo Neutra lo-fi.</p>
<footer>
<p><a href="https://www.twitter.com/calebvaroga">@calebvaroga</a></p>
</footer>
</section> <!-- END CANVAS CONTENT -->
</section> <!-- END SITE CONTENT -->
</section> <!-- END WRAPPER -->
<!-- ### JQUERY INCLUDE ### -->
<script src="js/jquery.min.js"></script>
<!-- ### EDITABLE JS/JQUERY INCLUDE ### -->
<script src="js/main.js"></script>
</body>
</html>
/* ### GENERAL SITE STYLES ### */
body {
background-color: #231F20;
color: #F5F5F5;
font-family: 'Roboto', sans-serif;
}
#site-wrapper {
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
}
#site-canvas {
width: 100%;
height: 100vh;
position: relative;
-webkit-transform: translateX(0);
transform: translateX(0);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.show-nav #site-canvas {
-webkit-transform: translateX(100vw);
transform: translateX(100vw);
-webkit-transform: translate3d(100vw, 0, 0);
transform: translate3d(100vw, 0, 0);
}
/* ### MENU STYLES ### */
#site-menu {
width: 100vw;
height: 100%;
position: absolute;
top: 0;
left: -100vw;
background: #56B2AB;
color: #f5f5f5;
}
.site-menu-content {
width: 100%;
max-width: 760px;
margin: 0px auto;
padding: 20px;
font-family: 'Roboto Slab', sans-serif;
}
#site-menu i {
color: #231F20;
font-size: 2em;
}
#site-menu a {
text-decoration: none;
color: rgba(35, 31, 32, 0.25);
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
}
#site-menu a:hover {
color: #f4f4f4;
}
h2 {
font-size: 80px;
text-align: center;
}
/* ### GENERAL CONTENT STYLES ### */
h1 {
font-family: 'Roboto Slab', sans-serif;
font-size: 2.25em;
}
p {
font-size: 1.25em;
}
a {
text-decoration: none;
color: rgba(86, 178, 171, 0.5);
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
}
a:hover {
color: rgb(86, 178, 171);
}
.content {
width: 90%;
max-width: 760px;
margin: 0px auto;
padding: 20px;
}
i {
font-size: 2em;
color: #F5F5F5;
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
}
.nav-icon:hover {
color: rgb(86, 178, 171);
}
/* ### FOOTER ### */
footer {
position: fixed;
left: 0px;
bottom: 0px;
height: 30px;
width: 100%;
background: #231F20;
text-align: center;
margin-bottom: 30px;
}
footer a {
color: rgba(245, 245, 245, 0.5);
font-size: 0.75em;
}
$(function() {
// Toggle Nav on Click
$('.toggle-nav').click(function() {
// Calling a function in case you want to expand upon this.
toggleNav();
});
});
function toggleNav() {
if ($('#site-wrapper').hasClass('show-nav')) {
// Do things on Nav Close
$('#site-wrapper').removeClass('show-nav');
} else {
// Do things on Nav Open
$('#site-wrapper').addClass('show-nav');
}
//$('#site-wrapper').toggleClass('show-nav');
}
Also see: Tab Triggers