cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <div id="page_container">
  
	<div id="main_content">

		<div class="front face">
    		
    		<!-- ALL THE SITE CONTENT GOES HERE -->
    		
    		<header class="clearfix">
	
				<nav class="clearfix">
					<a id="menu-toggle" class="anchor-link" href="#mobile-nav">MENU</a>
					<ul>
			        	<li><a href="#">Home</a></li>
			        	<li><a href="#">About</a></li>
			        	<li><a href="#">Collection</a></li>
			        	<li><a href="#">Blog</a></li>
			        	<li><a href="#">Contact</a></li>
			        	<li><a href="#">Directions</a></li>
			        </ul>
				</nav>
			
				<h1>The Backside Menu Flip</h1>

			</header>
			
			
			<article class="clearfix">
				
				<p>The idea behind this responsive menu is that as we get to a certain width (less than 768px), the menu goes away and we are presented with a single "menu" button. Pretty standard stuff. <em>Then</em> when that button is clicked, the entire page flips around to reveal the navigation.</p>
				
				<p>The navigation takes up the entire "backside" of the page. This gives you lots of flexibility to style the menu to however you see fit!</p>
				
				<p>I also like the user's experience here. By watching the site flip they know that they are viewing a different panel. As opposed to putting your menu in the footer and using an anchor link (which could cause an abrupt jump) this methods lets the user see what's happening. It's a similar thought process behind the "off-canvas" page slide which facebook uses.</p>
				
				<p>Right now this is just in beta. While working with navigation in responsive design, I thought it might be fun to put the menu on the "backside" of the page content. This frees us up to do whatever the hell we want with the menu on the backside of the page! <del>It might not be quite semantic and probably doesn't yet* provide a fallback solution, but that shouldn't be too hard!</del> <span style="color:red;">***Update:</span> I added a fallback for devices without Javascript OR devices that don't support CSS transformations.  If a device doesn't have JS or support CSS transforms, then the menu simply appears in the footer and the menu link at the top anchors them to that position in the footer.</p>
				
				 
			
			</article>
			
			
			<footer>
			
				<p class="copyright"><a href="http://erickar.be">erick arbe</a></p>
				
			</footer>
  		
  		</div><!-- END .front -->
  		
  		<div class="back face center">
    		
    		<!-- BACK FACING CONTENT (NAV) HERE -->
    		
    		<header class="clearfix">
    			
    			<a id="return" class="anchor-link" href="#">RETURN</a>
    			
    		</header>
    		
    		<nav id="mobile-nav">
	
				<ul>
		        	<li><a href="#">Home</a></li>
		        	<li><a href="#">About</a></li>
		        	<li><a href="#">Collection</a></li>
		        	<li><a href="#">Blog</a></li>
		        	<li><a href="#">Contact</a></li>
		        	<li><a href="#">Directions</a></li>
		        </ul>
        
		    </nav>
    		
  		</div><!-- END .back -->
  		
	</div><!-- END #main_content -->

</div><!-- END #page_container -->
            
          
!
            
              * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

header, article { max-width: 87.500em; margin: 0 auto; }
header { margin-bottom: 2em; }
header > h1 { text-align: center;  }
article { padding: 5em; }

header nav { width:100%; border-bottom: 1px solid #ccc;  padding: .6em 0; }
header ul { list-style: none; padding: 0px; margin: 0px; font-weight: bold; text-align: center; }
header ul li { display: inline-block; text-align: left; }
header ul li a { display: block; padding: 5px 10px; text-decoration: none; color: #444; }
header ul li a:hover { background-color: #ccc; }

.anchor-link { display: none; font-weight: bold; padding: 0 1em; text-align: right; text-decoration: none; color: #8A2404; float: right; }
#mobile-nav { display:none; }

p.copyright { text-align: center; }

#mobile-nav ul { list-style: none; margin: 0px; padding: 0px; }
#mobile-nav ul li { list-style: none; text-align: center; }
#mobile-nav ul li a { display: block; padding: 20px 10px; border-bottom: 1px solid #ccc; text-decoration: none; }
#mobile-nav ul li a:hover { background-color: #ccc; color: #fff; }

@media (max-width:48.000em){
  
	article { padding: 1.5em; }
	header nav { padding: 0.6em 0; }
	header nav > ul { display: none; }
	.anchor-link, #mobile-nav { display: block; }
	
	.back header { padding: .8em 0; background-color: #444; }
	.back header .anchor-link { color: #fff; }

	#page_container {
	  position: relative;
	  margin: 0px auto;
	  width: 100%;
	  z-index: 1;
	  -webkit-perspective: 1000px;
	  -moz-perspective: 1000px;
	  -o-perspective: 1000px;
	  perspective: 1000px;
	}
	#main_content {
	  width: 100%;
	  height: 100%;
	  -webkit-transform-style: preserve-3d;
	  -webkit-transition: all 1.0s linear;
	  -moz-transform-style: preserve-3d;
	  -moz-transition: all 1.0s linear;
	  -o-transform-style: preserve-3d;
	  -o-transition: all 1.0s linear;
	  transform-style: preserve-3d;
	  transition: all 1.0s linear;
	}
	
	#page_container.active #main_content {
	  -webkit-transform: rotateY(180deg);
	  -moz-transform: rotateY(180deg);
	  -o-transform: rotateY(180deg);
	  transform: rotateY(180deg);
	
	  -webkit-box-shadow: -5px 5px 5px #aaa;
	  -moz-box-shadow: -5px 5px 5px #aaa;
	  box-shadow: -5px 5px 5px #aaa;
	}
	.face {
	  position: absolute;
	  width: 100%;
	  height: 100%;
	  -webkit-backface-visibility: hidden;
	  -moz-backface-visibility: hidden;
	  -o-backface-visibility: hidden;
	  backface-visibility: hidden;
	}
	.face.back {
	  display: block;
	  -webkit-transform: rotateY(180deg);
	  -webkit-box-sizing: border-box;
	  -moz-transform: rotateY(180deg);
	  -moz-box-sizing: border-box;
	  -o-transform: rotateY(180deg);
	  -o-box-sizing: border-box;
	  transform: rotateY(180deg);
	  color: white;
	  text-align: center;
	}

	.no-js #mobile-nav, 
	.no-csstransforms #mobile-nav { display: block; border-top: 1px solid #ccc; }
	.no-js .face,
	 .no-csstransforms .face{ position: relative; }
	.no-js .face.back { 
	  -webkit-transform: inherit;
	  -moz-transform: inherit;
	  -o-transform: inherit;
	  transform: inherit;
	 }
	 .no-js .back header,
	 .no-csstransforms .back header { display:none; }
	
}
            
          
!
            
              $(document).ready(function() {
  
	window.scrollTo(0, 1);
	
	$('.js #menu-toggle').click(function (e) {
		$('#page_container').addClass('active');
		e.preventDefault();
    });
    
    $('#return').click(function(e){
    	$('#page_container').removeClass('active');
    	e.preventDefault();
    });
    
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console