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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <html>
  
  <body>
  	
		<header>
			<div class="container">
				<a href="#" class="brand">Flip menu</a>
				<a href="#" class="flip-menu">Show/hide menu</a>
			</div>
		</header>
	
	
		<div class="flip-holder">
  			<div class="flip">
				
				
				<div class="back">
					<div class="container">
						<nav>
							<ul>
								<li><a href="index.html">These</a></li>
								<li><a href="index.html">Are</a></li>
								<li><a href="index.html">Just</a></li>
								<li><a href="index.html">Some</a></li>
								<li><a href="index.html">Nice</a></li>
								<li><a href="index.html">Dummy</a></li>
								<li><a href="index.html">Links</a></li>
							</ul>
						</nav>
					</div>
				</div><!-- end .back -->
				
												
				<div class="front">
					
					<h1><span class="container">Responsive flip menu</span></h1>
					<h2><span class="container">A more sexier, 3D-tastic RWD navigation option<span></h2>
					
					<section class="content container cf">
						<div class="col-1">
							<p>Another responsive design proof of concept navigation pattern (<i>following on from <a href="http://neilcarpenter.com/demos/stack-menu/" title="'Stacking' RWD menu">this one</a></i>) made by <a href="http://neilcarpenter.com">me</a> . Resize your browser, test on a phone or use a responsive tester site as <a href="http://responsive.is/neilcarpenter.com/demos/flip-menu" title="responsive.is">such</a>. Check the <a href="http://neilcarpenter.com/labs/flip-menu">demo page</a> for more information.</p>
						
							<p>This is all now just filler text to simulate a real web page. Iusto deserunt aspernatur excepturi nihil corrupti dolorem! Lorem ipsum dolor sit amet, <a href="#">consectetur adipisicing</a> elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque <a href="#">odio aperiam</a> minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
						</div>
						
						<div class="col-2">
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio <a href="#">aperiam</a> minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa totam labore tenetur praesentium distinctio recusandae eligendi nobis inventore rerum aperiam ipsam fuga impedit quidem. Earum nemo nesciunt molestias expedita itaque.
								<ul>
									<li>Lorem ipsum dolor sit amet</li>
									<li>is inventore rerum aperiam ipsam fuga impedit </li>
									<li>nesciunt molestias expedita itaque</li>
								</ul>
							</p>							
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio <a href="#">aperiam minus cum iusto deserunt</a> aspernatur excepturi nihil corrupti dolorem! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa nam ducimus nemo velit quam enim similique ut facilis itaque odio aperiam minus cum iusto deserunt aspernatur excepturi nihil corrupti dolorem!</p>
						</div>
					</section>
					
					<footer class="cf">
						<div class="container">
							<h3>Footer stuff</h3>
							<ul>
								<li><a href="#">Some</a></li>
								<li><a href="#">More</a></li>
								<li><a href="#">Dummy</a></li>
								<li><a href="#">Links</a></li>
								<li><a href="#">Here</a></li>
							</ul>
							<small>Kind regards <a href="https://typekit.com">Typekit</a> and <a href="https://subtlepatterns.com/">Subtlepatterns</a>.</small>
						</div>
					</footer>
					
				</div><!-- end .front -->
				
				
			</div><!-- end .flip -->
		</div><!-- end .flip-holder -->

    <a href="https://github.com/neilcarpenter/Responsive-flip-menu" id="ribbon" target="_blank"><img style="position: absolute; top: 50px; right: 0; border: 0; z-index: 50;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
          
	</body>
	
</html>
            
          
!
            
              @import "compass/css3";

// SETUPS

* { 
  -moz-box-sizing: border-box; 
  -webkit-box-sizing: border-box; 
  box-sizing: border-box; 
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
	margin: 0;
	padding: 0;
	font-family: "proxima-nova", sans-serif;
	font-size: 1em;
}

a {
	color: #fff;
	text-decoration: none;
}

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 5%;
}

// TRANSITIONS

h1,
p a,
footer a,
.flip-menu {
	-webkit-transition: all .3s ease-in-out;
	   -moz-transition: all .3s ease-in-out;
		 -o-transition: all .3s ease-in-out;
			transition: all .3s ease-in-out;
}

// HEADER

header {
	width: 100%;
	height: 50px;
	position: absolute;
	top: 0;
	left: 0;
	background: url(http://neilcarpenter.com/demos/flip-menu//img/navy_blue.png);
	background: -moz-linear-gradient(top, rgba(255,255,255,0.1) 0%, rgba(19,19,19,0.5) 100%), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(19,19,19,0.5))), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(19,19,19,0.5) 100%), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(19,19,19,0.5) 100%), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* Opera 11.10+ */
	background: -ms-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(19,19,19,0.5) 100%), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* IE10+ */
	background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%,rgba(19,19,19,0.5) 100%), url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png); /* W3C */
}

.brand {
	font-size: 1.5em;
	font-weight: bold;
	padding: 10px 0;
	display: block;
	float: left;

	&:hover {
		opacity: 0.7;
	}
}

.flip-menu {
	display: none;

	position: absolute;
	right: 5%;
	top: 7px;
	width: 30px;
	height: 30px;
	background: url(http://neilcarpenter.com/demos/flip-menu//img/menu-icon.png) no-repeat bottom center;
	text-indent: -999px;

	&.on {
		background-position: center 5px;
	}
}

// HEADINGS

h1 {
	font-size: 8em;
	padding: 0.3em 0;
	margin: 0;
	background: rgba(0,0,0,0.1);

	span {
		display: block;
		padding: 0 2em 0 0;
		// color: rgba(0, 0, 0, 0.6);
		// text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
		// color: #404040;
		color: rgba(64, 64, 64, 0.9);
		text-shadow: 5px 5px 0px rgba(93, 233, 255, 0.2),
					 -5px -5px 0px rgba(237, 0, 49, 0.1);
	}
	.container {
		padding: 0 30% 0 5%;
	}
}
h2 {
	font-size: 2em;
	padding: 0.83em 0;
	margin: 0;
	background: rgba(0,0,0,0.05);

	span {
		display: block;
		padding: 0 8em 0 0;
		color: rgba(0, 0, 0, 0.6);
		// text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
	}
}

// NAV

nav {
	position: absolute;
	top: -50px;
	right: 5%;
	z-index: 3;

	ul {
		margin: 0;
		padding: 0;
	}

	li {
		display: inline-block;
	}

	a {
		font-size: 15px;
		display: block;
		padding: 15px 20px 17px;

		&:hover {
			background: rgba(0, 0, 0, 0.3);
		}
	}
}

// CONTENT

.content {
	margin-bottom: 2em;

	a {
		color: rgba(0, 0, 0, 0.5);
		border-bottom: 2px solid rgba(0, 0, 0, 0.2);

		&:hover {
			color: #000;
			border-color: #000;
		}
	}
  
  p {
    line-height: 1.4;
  }
}

.col-1,
.col-2 {
	width: 47%;
}

.col-1 {
	float: left;

	p:first-child {
		font-size: 1.4em;
		line-height: 1.4;
	}
}

.col-2 {
	float: right;
}

// FOOTER

footer {
	background: rgba(0, 0, 0, 0.01);
	padding: 1em 0 2em;
	border-top: 5px solid rgba(0, 0, 0, 0.05);	

	ul {
		list-style-type: none;
		margin: 0;
		padding: 0;
	
		li {
			margin: 0 0 5px;
		}
	}

	small {
		float: right;
	}

	a {
		color: black;
		border-bottom: 2px solid transparent;

		&:hover {
			border-bottom: 2px solid rgba(0, 0, 0, 0.2);
		}
	}	
}

// 3D FLIP STUFF

.front,
.back {
	-webkit-backface-visibility: hidden;
	   -moz-backface-visibility: hidden;
		 -o-backface-visibility: hidden;
			backface-visibility: hidden;
	position: absolute;
	top: 50px;
	left: 0;
}

.front {
	z-index: 2;
	background: white;
}

.back {

	.container {
		position: relative;
	}
}

.flip-holder {
	-webkit-perspective: 2000;
	   -moz-perspective: 2000;
		 -o-perspective: 2000;
			perspective: 2000;
}

@-webkit-keyframes scale {
	0%   {
	 	-webkit-transform: scale(1) translate3d(0, 0, 0);
	}
	50%  {
		-webkit-transform: scale(0.8) translate3d(0, 50px, 0);
	}
	100% {
	 	-webkit-transform: scale(1) translate3d(0, 0, 0);
	}
}

@-moz-keyframes scale {
	0%   {
	 	-moz-transform: scale(1) translate3d(0, 0, 0);
	}
	50%  {
		-moz-transform: scale(0.8) translate3d(0, 50px, 0);
	}
	100% {
	 	-moz-transform: scale(1) translate3d(0, 0, 0);
	}
}

@-o-keyframes scale {
	0%   {
	 	-o-transform: scale(1) translate3d(0, 0, 0);
	}
	50%  {
		-o-transform: scale(0.8) translate3d(0, 50px, 0);
	}
	100% {
	 	-o-transform: scale(1) translate3d(0, 0, 0);
	}
}

@keyframes scale {
	0%   {
	 	transform: scale(1) translate3d(0, 0, 0);
	}
	50%  {
		transform: scale(0.8) translate3d(0, 50px, 0);
	}
	100% {
	 	transform: scale(1) translate3d(0, 0, 0);
	}
}

.flip-holder.flipping {
	-webkit-animation: scale .6s ease-in-out;
	   -moz-animation: scale .6s ease-in-out;
		 -o-animation: scale .6s ease-in-out;
			animation: scale .6s ease-in-out;
}

.flip-holder.flipped .flip {
	-webkit-transform: rotateY(180deg);
	   -moz-transform: rotateY(180deg);
		 -o-transform: rotateY(180deg);
			transform: rotateY(180deg);
}

.flip-holder, .front, .back {
	width: 100%;
}

.flip {
	-webkit-transition: -webkit-transform 0.6s ease-in-out;
	   -moz-transition:    -moz-transform 0.6s ease-in-out;
		 -o-transition: 	 -o-transform 0.6s ease-in-out;
			transition:    		transform 0.6s ease-in-out;

	-webkit-transform-style: preserve-3d;
	   -moz-transform-style: preserve-3d;
		 -o-transform-style: preserve-3d;
			transform-style: preserve-3d;

	position: relative;
}

// MEDIA QUERIFY

@media (max-width: 980px) {

	h1 {
		font-size: 5em;

		span {
			text-shadow: 3px 3px 0px rgba(93, 233, 255, 0.2),
						 -3px -3px 0px rgba(237, 0, 49, 0.1);			
		}

		.container {
			padding: 0 5%;
		}
	}

	h2 {
		font-size: 1.5em;
	}

}

@media (max-width: 760px) {

	body {
		background: url(http://neilcarpenter.com/demos/flip-menu/img/navy_blue.png) repeat;
	}

	.front,
	.back {
		top: 50px;
	}

	.back {
		-webkit-transform: rotateY(180deg);
		   -moz-transform: rotateY(180deg);
			 -o-transform: rotateY(180deg);
				transform: rotateY(180deg);
	}

	nav {
		top: 0px;
		right: 0;
		width: 100%;
		position: relative;
		box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
		
		li {
			display: block;
			text-align: center;
		}

		a {
			background: #212121;
			border-bottom: 5px solid #252525;

			&:hover {
				background: rgba(33, 33, 33, 0.5);
			}
		}
	}

	.flip-menu {
		display: block;
	}

	.back .container {
		padding: 0;
	}

}

@media (max-width: 550px) {

	.container {
		padding: 0;
	}

	header {
		padding: 0 5%;
	}

	h1 {
		font-size: 3em;
		padding-left: 5%;
		padding-right: 5%;

		span {
			text-shadow: 2px 2px 0px rgba(93, 233, 255, 0.2),
						 -2px -2px 0px rgba(237, 0, 49, 0.1);
		}

		.container {
			padding: 0;
		}		
	}

	h2 {
		font-size: 1.1em;
		padding-left: 5%;
		padding-right: 5%;
		
		span {
			padding: 0;
		}
	}

	.content {
		padding-left: 5%;
		padding-right: 5%;
	}

	.col-1,
	.col-2 {
		width: 100%;
		float: none;
	}

	footer {
		padding-left: 5%;
		padding-right: 5%;
	}
  
  #ribbon {
		display: none;
	}

}

/* clearfix helper */
.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}
            
          
!
            
              /*

see here for explanation: http://neilcarpenter.com/labs/flip-menu/

*/

// typekit
try{Typekit.load();}catch(e){}

$(function() {

  // cache selectors
  var $container = $('.flip-holder'),
		$flipButton = $('.flip-menu');

	$flipButton.click(function (e) {
		e.preventDefault();

		$(this).toggleClass('on');
		
		// add flipping to toggle scale animation, then remove
		// so will work when flip back, should use transitionEnd
		$container.addClass('flipping');
		setTimeout(function() {
			$container.removeClass('flipping');
		}, 650);

		// the 3D flip bit handled by this
		$container.toggleClass('flipped');
	});

	// if window resized to big while menu open, reset
	$(window).on('resize', function() {
		if ($container.hasClass('flipped') && $flipButton.css('display') == 'none') {
			$flipButton.trigger('click');
		}
	});

});
            
          
!
999px
Loading ..................

Console