Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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

              
                <div id="mobile">
<nav>
  <ul>
    <li id="js-home"><i class="fa fa-home"></i></li>
    <li id="js-explore"><i class="fa fa-compass"></i></li>
    <li id="js-social"><i class="fa fa-comment"></i></a></li>
    <li id="js-settings"><i class="fa fa-bars"></i></li>
  </ul>
</nav>
<div class="screen" id="home">
  <h1>My Channel</h1>
<div class="Message">
  <div class="Message-icon">
    <i class="fa fa-bell-o"></i>
  </div>
  <div class="Message-body">
    <p>Welcome to your channel!</p>
    <p>It is a little like a newsfeed of video content that is relevant to you. Click the X to close a message.</p>
  </div>
  <button class="Message-like js-messageLike"><i class="fa fa-times"></i></button>
</div>

<div class="Message Message--orange">
  <div class="Message-icon">
    <i class="fa fa-exclamation"></i>
  </div>
  <div class="Message-body">
    <p>Luke shared this video with you:</p>
    <i class="fa fa-youtube-play fa-5x"></i>
    <p class="u-italic">One way of finding content relevant to you is connecting to people with similar interests. You can be informed when they like, watch, or share a video.</p>
  </div>
  <button class="Message-like js-messageLike"><i class="fa fa-times"></i></button>
</div>

<div class="Message Message--green">
  <div class="Message-icon">
    <i class="fa fa-check"></i>
  </div>
  <div class="Message-body">
    <p>You liked the Captain America trailer, perhaps you'd like to watch the Spiderman trailer:</p>
    <i class="fa fa-youtube-play fa-5x"></i>
    <p class="u-italic">Your channel learns what you like by paying attention to what you like/dislike, much like Pandora.</p>
  </div>
  <button class="Message-like js-messageLike"><i class="fa fa-times"></i></button>
</div>

<div class="Message Message--red">
  <div class="Message-icon">
    <i class="fa fa-times"></i>
  </div>
  <div class="Message-body">
    <p>Just wondering: which genre from the following do you prefer?</p>
    <p class="u-italic">You might get asked questions like this so that your channel can learn your preferances. You can set them up in detail on the settings screen, too.</p>
    <button class="Message-button js-messageLike">Fiction</button>
    <button class="Message-button js-messageLike">Documentary</button>
  </div>
  <button class="Message-like js-messageLike"><i class="fa fa-times"></i></button>
</div>

<div class="Message">
  <div class="Message-icon">
    <i class="fa fa-bell-o"></i>
  </div>
  <div class="Message-body">
    <p>Do you know that you can receive notifications the moment your friends start watching something, and watch along with them?</p>
    <p class="u-italic">Occasional tutorial messages educate the users.</p>
    <button class="Message-button" id="js-showMe">Show me how</button>
    <button class="Message-button js-messageLike">Later</button>
  </div>
  <button class="Message-like js-messageLike"><i class="fa fa-times"></i></button>
</div>

<div class="Message Message--orange">
  <div class="Message-icon">
    <i class="fa fa-exclamation"></i>
  </div>
  <div class="Message-body">
    <p>I'm a big fan of Spotify and Pandora for discovering new music. The concept of 'relevant, good content' is relative to one's context, and I took inspiration from the social context suppoert by these apps. I dig Instagram, too.</p>
    <p class="u-italic">Thanks for reading!</p>
    <button class="Message-button" id="js-reset">Reset</button>
  </div>
</div>
</div>
<div class="screen" id="explore">
  <h1>Explore</h1>
  <p>This screen offers search functionality, and an infinite set of small thumbnails for a channel-surfing experience.</p>
</div>
<div class="screen" id="social">
  <h1>Social</h1>
  <p>This screen reveals activity of friends' channels. You can follow/unfollow friends here, or on the settings screen.</p>
</div>
<div class="screen" id="settings">
  <h1>Settings</h1>
  <p>This screen allows fine-tuning of your channel, including genre preferences (similar to hashtags in their effect) and a log of watched/liked/disliked content</p>
</div>
</div>
              
            
!

CSS

              
                @import url(https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css);
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300);

body {
  width:320px;
  margin:0 auto;
  font-family:'HelveticaNeue-UltraLight', 'Helvetica Neue UltraLight', Roboto, Arial, Sans-serif;
  color: #fff;
}

h1 {
  color: #fff;
  background-color: #444;
  text-align: center;
  padding: 5px 0;
}

p {
  padding: 30px;  
}

nav {
  position: absolute;
  top: 500px;
  z-index: 100;
  letter-spacing:1px;
}

nav ul li {
  background:#444;
  display:inline-block;
  margin-right:-4px;
  width:80px;
  text-align:center;
  line-height:50px;
  font-size:26px;
  box-shadow:inset -1px 0 0 #666;
  transition:.3s;
  cursor:pointer;
}

nav ul li:last-child {
  box-shadow:inset 0 0 0 #333;
}

nav ul li:active {
  background:#666;
}

nav ul li:active > i {
  color:#fff;
}

nav ul li i {
  text-decoration:none;
  color:#777;
}

$c-black: #111;
$c-white: #fff;
$c-blues: #2980B9, #0074D9, #009FE3;
$c-greys: #343C3F, #A2ACB0, #D9E1E4;
$c-greens: #27AE60, #2ECC40, #01FF70;
$c-reds: #C0392B, #FF4136, #E74C3C;
$c-yellows: #F39C12, #FCA624, #F1C40F;
$c-purples: #532E62, #8E44AD, #9B59B6;

* {
  box-sizing: border-box;
}

body {
  background: #2980b9;
  font-family: 'Source Sans Pro';
  font-weight: 300;
}

.Message {
  display: table;
  position: relative;
  margin: 1px auto;
  width: 100%;
  background-color: nth($c-blues, 2);
  color: #fff;
  transition: all 0.2s ease;
  
  &.is-hidden {
    opacity: 0;
    height: 0;
    font-size: 0;
    padding: 0;
    margin: 0 auto;
    display: block;
  }
}
  .Message--orange {
    background-color: nth($c-yellows, 1);
  }

  .Message--red {
    background-color: nth($c-reds, 2);
  }

  .Message--green {
    background-color: nth($c-greens, 2);
  }

  .Message-icon {
    display: table-cell;
    vertical-align: top;
    padding: 14px;
    text-align: center;
    background-color: rgba(black, 0.25);
    
    >i {
      width: 20px;
      font-size: 20px;
    }
  }
  
  .Message-body {
    display: table-cell;
    vertical-align: middle;
    padding: 30px 20px 30px 10px;
    
    > p {
      line-height: 1.2;
      margin-top: 6px;
      padding: 0
    }
  }

  .Message-button {
    position: relative;
    margin: 15px 5px -10px;
    background-color: rgba(black, 0.25);
    box-shadow: 0 3px rgba(black, 0.4);
    border:none;
    padding: 10px 15px;
    font-size: 16px;
    font-family: 'Source Sans Pro';
    color: #fff;
    outline: none;
    cursor: pointer;
     
    &:active {
      background: rgba(black, 0.3);
      box-shadow: 0 0px rgba(black, 0.4);
      top: 3px;
    }
  }

  .Message-like {
    position: absolute;
    background-color: rgba(black, 0.3);
    color: #fff;
    border: none;
    outline: none;
    font-size: 20px;
    right: 5px;
    top: 5px;
    cursor: pointer;
 }

.u-italic { font-style: italic; }

#mobile{ width: 360px; height: 600px; background: #000; border-width:60px 20px 100px 20px; border-color: #eee; border-style: solid; border-radius: 30px; margin: 30px auto; overflow: hidden; }
              
            
!

JS

              
                function closeMessage(el) {
  el.addClass('is-hidden');
}

$('.js-messageLike').on('click', function(e) {
  closeMessage($(this).closest('.Message'));
});

$('#js-showMe').on('click', function(e) {
  alert("You're off to the tutorial. See you later!");
  closeMessage($(this).closest('.Message'));
});

$('#js-reset').on('click', function(e) {
  $('*').removeClass('is-hidden');
});

$('nav li').on('click', function(e) {
  $('.screen').hide();
});

$('#js-home').on('click', function(e) {
  $('#home').show();
});

$('#js-explore').on('click', function(e) {
  $('#explore').show();
});

$('#js-social').on('click', function(e) {
  $('#social').show();
});

$('#js-settings').on('click', function(e) {
  $('#settings').show();
});

$(document).ready(function() {
  $('.screen').hide();
  $('#home').show();
});


              
            
!
999px

Console