css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

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

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.

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.

            
              <main>

  <div class='content'>
    <button class='toggle'>
      <div class='bar'></div>
      <div class='bar'></div>
      <div class='bar'></div>
    </button>
    <section id='home' class='section__open'>
      <div class='section--title'>HOME</div>
      <a href='https://codepen.io/phenax/full/zvVdgr' target="_parent _blank" class='red'>Please view in full screen</a>
      <div class='section--text'>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, doloribus tempore facilis eveniet autem, cupiditate nihil, modi tenetur temporibus iure accusantium voluptatum amet sunt quis ut vel. Temporibus, fugit, illo! Lorem ipsum dolor sit amet,
        consectetur adipisicing elit. Commodi, doloribus tempore facilis eveniet autem, cupiditate nihil, modi tenetur temporibus iure accusantium voluptatum amet sunt quis ut vel. Temporibus, fugit, illo!
      </div>
    </section>
    <section id='about'>
      <div class='section--title'>About me</div>
      <div class='section--text'>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laboriosam aliquid explicabo quisquam labore, minus inventore officiis consequatur pariatur quos quidem quae similique quam quod voluptates, quasi optio rem, suscipit vitae!
      </div>
    </section>
    <section id='more'>
      <div class='section--title'>Know more</div>
      <div class='section--text'>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus, velit doloremque maxime ullam animi sit molestiae beatae odio soluta eaque ducimus assumenda vel quos harum magnam quam ipsa modi. Doloribus? Lorem ipsum dolor sit amet, consectetur
        adipisicing elit. Voluptatibus, velit doloremque maxime ullam animi sit molestiae beatae odio soluta eaque ducimus assumenda vel quos harum magnam quam ipsa modi. Doloribus?
      </div>
    </section>
    <section id='contact'>
      <div class='section--title'>Get in touch</div>
      <div class='card'>
        <img src='https://scontent.fbom1-1.fna.fbcdn.net/hphotos-xtp1/v/t1.0-9/11855629_887898261302643_8925632154298589508_n.jpg?oh=53c30047bb67abbc9af038ce7dc48cf5&oe=56DDC210' class='card--face' width='80' height='80' />
        <div class='card--name'>Akshay Nair</div>
        <div class='card--links'>
          <ul>
            <li><a target='_blank _parent' href='https://github.com/phenax'>Github</a></li>
            <li><a target='_blank _parent' href='https://codepen.io/phenax'>Codepen</a></li>
            <li><a target='_blank _parent' href='https://facebook.com/einstein1997'>Facebook</a></li>
            <li><a target='_blank _parent' href='https://twitter.com/phenax5'>Twitter</a></li>
          </ul>
        </div>
      </div>
    </section>
  </div>

  <nav>
    <ul>
      <li>
        <button class='home'>Home</button>
      </li>
      <li>
        <button class='about'>About</button>
      </li>
      <li>
        <button class='more'>Know more</button>
      </li>
      <li>
        <button class='contact'>Contact</button>
      </li>
    </ul>
  </nav>

</main>
            
          
!
            
              $red:#F44336;

@import url(https://fonts.googleapis.com/css?family=Roboto:400,900);
$font:"Roboto",Helvetica,sans-serif;

@mixin transition($in) {
	transition:$in;
	-webkit-transition:$in;
	-moz-transition:$in;
	-o-transition:$in;
	-ms-transition:$in;
}
@mixin box-shadow($in) {
	box-shadow:$in;
	-webkit-box-shadow:$in;
	-moz-box-shadow:$in;
	-o-box-shadow:$in;
	-ms-box-shadow:$in;
}
@mixin transform($in) {
	transform:$in;
	-webkit-transform:$in;
	-moz-transform:$in;
	-o-transform:$in;
	-ms-transform:$in;
}
@mixin transform-style($in) {
	transform-style:$in;
	-webkit-transform-style:$in;
	-moz-transform-style:$in;
	-o-transform-style:$in;
	-ms-transform-style:$in;
}
@mixin perspective($in) {
	perspective:$in;
	-webkit-perspective:$in;
	-moz-perspective:$in;
	-o-perspective:$in;
	-ms-perspective:$in;
}
@mixin perspective-origin($in) {
	perspective-origin:$in;
	-webkit-perspective-origin:$in;
	-moz-perspective-origin:$in;
	-o-perspective-origin:$in;
	-ms-perspective-origin:$in;
}
@mixin transform-origin($in) {
	transform-origin:$in;
	-webkit-transform-origin:$in;
	-moz-transform-origin:$in;
	-o-transform-origin:$in;
	-ms-transform-origin:$in;
}

body {
	margin:0;
	padding:0;
	background-color:#222;
}
* {
	font-family:$font;
	color:#888;
	box-sizing:border-box;
}

a.red {
  color:$red;
  font-size:18px;
  text-align:center;
  display:block;
}

.toggle {
	border:none;
	outline:none;
	background-color:transparent;
	cursor:pointer;
	margin:30px;

	.bar {
		width:27px;
		margin:3px;
		height:3px;
		background-color:#888;
	}
}

nav {
	position:absolute;
	top:100px;
	left:0;
	width:100%;
	z-index:-1;

	@include transition(all 0.5s ease-in-out);

	ul {
		list-style-type:none;
		margin:0;
		padding:0;
		text-align:center;

		li {
			display:inline-block;
		}

		@for $i from 1 through 4 {
			li:nth-child(#{$i})>button {
				$d:$i/10;
				@include transition(all 0.2s cubic-bezier(0.5,1,0.5,1.5) #{$d}s);
			}
		}

		button {
			padding:10px;
			font-size:20px;
			outline:none;
			border:none;
			background-color:transparent;
			color:#fff;
			cursor:pointer;
			position:relative;
			background-color:#222;
			margin:3px;

			@include transform(translateY(-150px));
			@include box-shadow(0 5px 10px 2px rgba(0,0,0,0.6));

			&::after {
				position:absolute;
				content:" ";
				bottom:0;
				left:50%;
				width:0;
				height:3px;
				background-color:$red;
				@include transition(all 0.2s ease-in-out);
			}

			&:hover {
				&::after {
					width:100%;
					left:0;
				}
			}
		}
	}
}

.nav__move {
	z-index:10;

	button {
		@include transform(translateY(0px));
	}
}

main {
	position:absolute;
	width:100%;
	height:100%;
	@include transform-style(preserve-3d);
	@include perspective(500px);
	@include perspective-origin(50% 50%);
}

.content {
	position:absolute;
	width:100%;
	height:100%;
	overflow:auto;
	background-color:#fff;
	@include transform-origin(50% 50%);
	@include transition(all 0.8s ease-in-out);
	@include box-shadow(0 0 30px 10px rgba(0,0,0,0.5));
}

.content__move {
	@include transform(scale(0.8) translateY(50px) rotateX(10deg));
}

section {
	visibility:hidden;
	position:absolute;
	opacity:0;
	width:100%;
	
	@include transition(all 0.3s ease-in-out 0.3s);
	@include transform(translateY(100px));
}

.section__open {
	visibility:visible;
	opacity:1;
	@include transform(translateY(0px));
}

.section--title {
	font-size:28px;
	margin:40px;
	text-align:center;
}

.section--text {
	min-width:200px;
	max-width:800px;
	padding:20px;
	font-size:16px;
	margin:auto;


	&:first-letter {
		font-weight:bold;
		font-size:18px;
		display:inline-block;
		padding-left:30px;
	}
}


.card {
	width:250px;
	padding:50px 30px;
	margin:70px auto;
	background-color:#222;
	position:relative;
	@include box-shadow(0 0 5px 2px rgba(0,0,0,0.3));

	* {
		color:#fff;
	}
}

$w:80px;

.card--face {
	border-radius:50%;
	position:absolute;
	top:-$w/2;
	left:50%;
	margin-left:-$w/2;
	border-top:2px solid #fff;
	
	@include transition(all 0.2s ease-in-out);
	@include box-shadow(0 0 10px 1px rgba(0,0,0,0.3));
}

.card--name {
	font-size:25px;
	font-weight:900;
	margin:20px 0 30px;
	text-align:center;
}

.card--links {
	ul {
		list-style-type:none;
		padding:0;
		margin:0;

		li,a {
			display:block;
			text-align:center;
			width:100%;
			font-size:18px;
			text-decoration:none;
			padding:5px;
			@include transition(all 0.3s ease-in-out);

			&:hover {
				color:$red;
			}
		}
	}
}
            
          
!
            
              (function($) {

	var bring_nav= function() {
		$('.content').toggleClass('content__move');
		$('nav').toggleClass('nav__move');
	};

	var go_to_section= function() {
		var id= $(this).attr('class');
		$('section').removeClass('section__open');
		$('section#'+id).addClass('section__open');
		bring_nav();
	};

	$(document).ready(function() {
		$('.toggle').on('click',bring_nav);
		$('nav').find('button').on('click',go_to_section);
	});
})(jQuery);

  alsolike(
    "XbOvpw", "Pure CSS Toggle Nav", 
    "gaZwVr", "TicTacToe Game", 
    "EVOwmq", "Simple Physics sim" 
  )
            
          
!
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