cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<div class="phone">

	<div class="screen">

		<div class="nav nav-top">
			<div class="nav-location" data-bodyclass="blank">
				<div class="fa fa-map-marker"></div>
			</div>
			<div class="nav-settings" data-bodyclass="settings">
				<div class="fa fa-gear"></div>
			</div>
		</div>

		<div class="feed-meta">
			<div class="feed-page">PAGE</div>
			<div class="feed-sort">SORT <i class="fa fa-caret-down"></i></div>
		</div>

		<div class="feed">
			<div class="post left">
				<div class="header">
					<div class="title"></div>
					<div class="actions">
						<div class="fa fa-comment" data-target="comments"></div>
						<div class="fa fa-mail-forward" data-target="share"></div>
						<div class="fa fa-flag" data-target="flag"></div>
					</div>
				</div>

				<div class="post-image"></div>
				<div class="main-btn">
					<div class="double vote-up">UP</div>
	       			<div class="double vote-down">DOWN</div>
				</div>
			</div>

			<div class="post center">
				<div class="header">
					<div class="title"></div>
					<div class="actions">
						<div class="fa fa-comment" data-target="comments"></div>
						<div class="fa fa-mail-forward" data-target="share"></div>
						<div class="fa fa-flag" data-target="flag"></div>
					</div>
				</div>

				<div class="post-image"></div>
				<div class="main-btn">
					<div class="double vote-up">UP</div>
	       			<div class="double vote-down">DOWN</div>
				</div>
			</div>

			<div class="post right">
				<div class="header">
					<div class="title"></div>
					<div class="actions">
						<div class="fa fa-comment" data-target="comments"></div>
						<div class="fa fa-mail-forward" data-target="share"></div>
						<div class="fa fa-flag" data-target="flag"></div>
					</div>
				</div>

				<div class="post-image"></div>
				<div class="main-btn">
					<div class="double vote-up">UP</div>
	       			<div class="double vote-down">DOWN</div>
				</div>
			</div>


			<!--   -->
			<div class="act comments">
				<div class="header">
					<div class="title">3 COMMENTS</div>
					<div class="actions">
						<div class="fa fa-times"></div>
					</div>
				</div>
				<div class="main-btn">
					<div class="single comment">Add Comment</div>
				</div>
			</div>
			<div class="act share">
				<div class="header">
					<div class="title">SHARE</div>
					<div class="actions">
						<div class="fa fa-times"></div>
					</div>
				</div>
			</div>
			<div class="act flag">
				<div class="header">
					<div class="title">FLAG INAPPROPRIATE</div>
					<div class="actions">
						<div class="fa fa-times"></div>
					</div>
				</div>
				<div class="main-btn">
					<div class="single comment">Send Complaint</div>
				</div>
			</div>
		</div>

		<div class="go-back fa fa-arrow-left"></div>
		<div class="loc">
			<div class="loc-logo"></div>
			<div class="loc-info">
				<div class="loc-name">University of Southern California</div>
				<div class="loc-rank">Ranked #1 in our school rankings</div>
			</div>	
		</div>
		<div class="set-cont">
			<div class="set-group">
				<div class="header">
					<div class="title">ACCOUNT</div>
					<div class="actions">
						<div class="fa fa-times"></div>
					</div>
				</div>
				<div class="link">Liked Photos</div>
				<div class="link">Uploaded</div>
			</div>
			<div class="set-group">
				<div class="header">
					<div class="title">SETTINGS & INFO</div>
					<div class="actions">
						<div class="fa fa-times"></div>
					</div>
				</div>
				<div class="link">Autosave to Camera Roll</div>
				<div class="link">Help Center</div>
				<div class="link">Terms & Conditions</div>
				<div class="link">Privacy Policy</div>
				<div class="link">Report a problem</div>
			</div>
		</div>

		<div class="nav nav-bottom">
			<div class="fa fa-university active" data-bodyclass="uni"></div>
			<div class="fa fa-film" data-bodyclass="reel"></div>
			<div class="fa fa-camera-retro mid" data-bodyclass="photo"></div>
			<div class="fa fa-bars" data-bodyclass="cats"></div>
			<div class="fa fa-trophy" data-bodyclass="hof"></div>
		</div>
   
	</div>
</div>
            
          
!
            
              @import "lesshat";

@import url(https://fonts.googleapis.com/css?family=Arvo:400,700,400italic|Raleway:400,100,300,200,500,600,800,700);

.bg-clip(@value) {
  -moz-background-clip: @value; 
  -webkit-background-clip: @value;  
  background-clip: @value~"-box";
}

.box-shadow(@value) {
  -webkit-box-shadow: @value;
  -moz-box-shadow: @value;
  box-shadow: @value;
}

.rounded(@value) {
  -webkit-border-radius:@value;
  -moz-border-radius:@value;
  border-radius:@value;
}

.border-box() {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.transition(@prop: none; @speed: 0; @easing: linear) {

  -webkit-transition-property: @prop;
  -moz-transition-property: @prop;
  -ms-transition-property: @prop;
  -o-transition-property: @prop;
  transition-property: @prop;
    
    -webkit-transition-duration: @speed;
    -moz-transition-duration: @speed;
    -ms-transition-duration: @speed;
  -o-transition-duration: @speed;
    transition-duration: @speed;
  
  -webkit-transition-timing-function: @easing;
  -moz-transition-timing-function: @easing;
  -ms-transition-timing-function: @easing;
  -o-transition-timing-function: @easing;
  transition-timing-function: @easing;
}

@red: #BE494B;

*, :before, :after {
  .transition(all;0.4s;ease);
}
.phone {
  transform:scale(0.7);
  transform-origin:50% 0;
}
.card {
  .rounded(6px);
  width:355px;
  margin:10px auto 0;
  height:500px;
  background:white;
  position:absolute;
  .box-shadow(0 2px 6px 0 darken(#BE494B, 20%));
  .transition(all;0.6s;cubic-bezier(.4,-0.4,.6,1.4););
  backface-visibility: hidden;
  top:0;
  left:10px;
  transform:rotate(0deg) rotateY(0deg) scale(1, 1);
  -webkit-transform-origin: 50%;

  .header {
      height:36px;
      border-bottom:1px solid #eee;
      overflow:hidden;
  }

  .title {
      float:left;
      margin:9px;
      position:relative;
      font-family: "Arvo", serif;
      font-size: 15px;
      line-height: 18px;
      text-transform: uppercase;
      color:#bbb;
  }

  .fa {
    height:100%;
    line-height:36px;
    text-align:center;
    font-size:18px;
    cursor:pointer;
    border-left:1px solid #eee;
    width:36px;
    float:right;
    &:before {color:#ccc;}
    &:hover,
    &.active {
      &:before {color:@red;}
    }
  }

  .main-btn {
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
    height:45px;
    background:#eee;
    .rounded(0 0 6px 6px);
    border-top:1px solid #ccc;
    cursor: pointer;
    
    font-family: "Raleway", sans-serif;
    font-weight:300;
    line-height:45px;
    color:#aaa;
    text-align:center;
    
    .single {
      height:45px;
    }
      
    .double {
      width:50%;
      height:45px;
      float:left;
      .border-box();
      &:first-child {
        border-right:1px solid #ddd;
      }
      &:hover,
      &.active {
        color:@red;
      }
    }
  }
}

body {
  text-align:center;
  height:700px;
  overflow:hidden;
  background: #fafafa;
}

.phone {
  border:1px solid rgba(0,0,0,0.2);
  padding:90px 10px 80px;
  .rounded(30px);
  display:inline-block;
  position:relative;
  background:#323232;
  margin:30px;
  max-width:600px;
}

.screen {
  border:1px solid rgba(0,0,0,0.2);
  .rounded(6px);
  background:@red;
  width:375px;
  height:667px;
  position:relative;
  .bg-clip(padding);
  overflow:hidden;
}

.nav {
  background:white;
  height:60px;
  width:100%;
  position:absolute;
  z-index:10;
  
  .nav-location,
  .nav-settings {
    width:60px;
    height:60px;
    text-align:center;
  }

  .nav-location {float:left; border-right:1px solid #eee;}
  .nav-settings {float:right; border-left:1px solid #eee;}
  
  .fa {
    height:100%;
    color:#ccc;
    line-height:60px;
    text-align:center;
    font-size:24px;
    cursor:pointer;
    &:before {color:#ccc;}
    &:hover,
    &.active {
      &:before {
        color:@red;
      }
    }
  }

  &.nav-top .fa {
    width:100%;
    cursor:pointer;
  }

  &.nav-bottom .fa {
    width:20%;
    float:left;
    border-left:1px solid #eee;
    .border-box();

    &.mid {
      background-color:#f5f5f5;
    }
  }
}

.nav-top {
  top:0;
  .box-shadow(0 2px 6px 0 darken(#BE494B, 20%));
}

.nav-bottom {
  bottom:0;
  .box-shadow(0 -2px 6px 0 darken(@red, 20%));
}

.blank {
  .feed-meta {opacity: 0;z-index: -1}
  .nav-top {top:-66px;}
  .nav-bottom {bottom:-66px;}
  .feed {opacity: 0;transition-delay:0.1s;}
  
  .center {
    top:600px;
    transform: rotateY(90deg) scale(0.5, 0.5);
  }
  
  .act{
    top:600px;
    transform:rotateY(90deg) scale(0.5, 0.5) !important;
  }
  
  .loc {opacity: 1;transition-delay:0.4s;z-index:1;}
  .go-back.fa {opacity: 1;}
}

.settings {
  .feed-meta {opacity: 0;z-index: -1}
  .nav-top {top:-66px;}
  .nav-bottom {bottom:-66px;}
  .feed {opacity: 0;transition-delay:0.1s;}
  
  .center {
    top:600px;
    transform: rotateY(90deg) scale(0.5, 0.5);
  }
  
  .act{
    top:600px;
    transform:rotateY(90deg) scale(0.5, 0.5) !important;
  }
  
  .set-cont {
    opacity: 1;
    transition-delay:0.2s;
    z-index:1;
    top:70px;
    transform: scale(1, 1);
  }
  .go-back.fa {opacity: 1;}
}


.go-back.fa {
  opacity: 0;
  position: absolute;
  top:10px;
  left:10px;
  width:40px;
  height:40px;
  line-height: 40px;
  font-size: 21px;
  text-align: center;
  text-indent:-3px;
  .rounded(50%);
  
  cursor:pointer;
  border:3px solid darken(@red, 15%);
  &:hover {border-color:white;&:before {color:white;}}
  &:before {color:darken(@red, 15%);}
}

.set-cont {
  position: absolute;
  top:-600px;
  left:10px;
  width: 355px;
  z-index: -1;
  opacity: 0;
  transform: scale(0.5, 0.5);
  .transition(all;0.6s;cubic-bezier(.4,-0.4,.6,1.4););
}

.set-group {
  &:extend(.card all);
  position:relative;
  top:0;
  height:auto;
  left:0;
  .fa {
    visibility: hidden;
  }
}

.link {
  padding:15px !important;
  font-size:14px;
  font-family:"Raleway", sans-serif;
}

.loc {
  opacity: 0;
  width: 355px;
  position: absolute;
  top:150px;
  left:10px;
  text-align:center;
  z-index:-1;
  .loc-logo {
    margin: 50px auto 170px;
    .rounded(50%);
    width:220px;
    height:220px;
    background:darken(@red,10%);
  }
  
  .loc-name {
    color:white;
    font-style: italic;
    font-size: 18px;
    font-family: "Arvo", serif;
  }
  .loc-rank {
    color: darken(@red, 20%);
    font-family: "Raleway", sans-serif;
    font-size: 16px;
    margin-top:6px;

  }
}

.feed-meta {
  margin:70px auto 0;
  width:355px;
  overflow:hidden;
  font-size:12px;
  font-family:"Arvo", serif;
  color: darken(@red, 15%);
  .feed-page {float:left;}
  .feed-sort {float:right;} 
}

.feed {
  position:relative;
  perspective:2000px;
  -webkit-transform-style: preserve-3d;
  height:520px;
}



.post {
  &:extend(.card all);

  .title {
    &:before,
    &:after {
      content:'';
      width:6px;
      display:inline-block;
      height:18px;
    }
    &:before {
      background:red;
      margin-right:6px;
    }
    
    &:after {
      background:orange;
    }
  }

  &.left {
    left:-425px;
    top:10px;
    transform:rotate(-3deg);
  }

  &.right {
    left:425px;
    top:10px;
    transform:rotate(3deg);
  }

  &.limbo {
    display: none;
    z-index:-1;
  }
  &.out {
    transform:rotateY(-180deg) scale(1, 1);
  }
}


.act {
  &:extend(.card all);
  transform:rotateY(180deg) scale(1, 1);
  
  &.in {
    transform:rotateY(0deg) scale(1, 1);
  }
}


.post-image {
  background: #eee;
  height:320px;
  width:100%;
}
            
          
!
            
              
$(window).ready(function(){
  
  var removeLimbo = function(){
    $('.limbo').removeClass('limbo');
  }
  
  $('.vote-up, .vote-down').click(function(){    
    $('.left').addClass('limbo');
    $('.center').addClass('left').removeClass('center');
    $('.right').removeClass('right').addClass('center');
    $('.limbo').addClass('right').removeClass('left');
    setTimeout(removeLimbo, 600);
  });
  
  $('.post .actions .fa').click(function(){
    var target = $(this).attr("data-target");
    $('.act.'+target).addClass("in");
    $('.post.center').addClass("out");
  });
  
  $('.act .fa, .act .main-btn').click(function(){
    $('.in').removeClass("in");
    $('.out').removeClass("out");
  });
  
  $('.nav-location, .nav-settings').click(function(){
    var bodyClass = $(this).attr("data-bodyclass"); 
    $('body').addClass(bodyClass);
  });
  
  
  $('.go-back').click(function(){
     $('body').removeClass('blank');
    $('body').removeClass('settings');
  });
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console