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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <header>
  <h1>Carly M. Ho <span class="blink"></span></h1>
  <p class="subtitle">Multilingual full-stack web development</p>
</header>

<aside class="bio">
  <p>By day, I'm a full-stack engineer at <a href="http://cliquestudios.com/" rel="external" target="_blank">Clique Studios</a>; by night I'm a writer, <a href="https://soundcloud.com/yaysunshine" rel="external" target="_blank">musician</a>, crafter, and gamer. Oh, and I write code for fun, too; you can find some examples on my <a href="https://github.com/cmho" rel="external" target="_blank">Github</a>.</p>
  <p class="links">Find me on: <a href="https://twitter.com/carlymho" rel="external" target="_blank">Twitter</a>  <a href="https://codepen.io/cmho" rel="external" target="_blank">CodePen</a> <a href="https://www.linkedin.com/in/carlymho" rel="external" target="_blank">LinkedIn</a> <a href="http://instagram.com/carlymho" rel="external" target="_blank">Instagram</a> <a href="https://soundcloud.com/yaysunshine" rel="external" target="_blank">SoundCloud</a>
</aside>

<nav>
  <span>Works:<span> 
  <ul>
    <li><a href="#" data-cat="" class="current">All</a></li>
    <li><a href="#/category/php" data-cat="php">PHP</a></li>
    <li><a href="#/category/wordpress" data-cat="wordpress">Wordpress</a></li>
    <li><a href="#/category/ruby" data-cat="ruby">Ruby</a></li>
    <li><a href="#/category/ruby-on-rails" data-cat="rails">Ruby on Rails</a></li>
    <li><a href="#/category/sinatra" data-cat="sinatra">Sinatra</a></li>
    <li><a href="#/category/front-end" data-cat="front-end">Front-End Development</a></li>
    <li><a href="#/category/back-end" data-cat="back-end">Back-End Development</a></li>
  </ul>
</nav>
    
<main class="main">
  
</main>
      
<aside class="overlay">
  <a href="#" class="close">x</a>
  <h2></h2>
  <div class="image-wrapper"><img src="" class="image" /></div>
  <div class="navigation"><a href="#" class="prev">&lt; Prev</a><span class="nav-separator"> &bull; </span><a href="#" class="next">Next &gt;</a>
  <div class="desc"></div>
</aside>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Inconsolata:400,700');

body {
  background-color: #2B1F32;
  color: #FFFFFF;
  font-family: "Inconsolata", monospace;
  padding: 30px 40px;
  
  &.lock-scroll {
    height: 100vh;
    overflow: hidden;
  }
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  
  49% {
    opacity: 1;
  }
  
  50% {
    opacity: 0;
  }
  
  99% {
    opacity: 0;
  }
  
  100% {
    opacity: 1;
  }
}

.blink {
  display: inline-block;
  animation: blink 2s infinite;
  color: #bd1c14;
  
  &:before {
    content: "▏";
  }
}

b, strong {
  color: #0AACC5;
}

i, em {
  color: #E15D97;
}

a {
  color: #0aacc5;
  transition: .3s;
  
  &:visited {
    color: #0aacc5;
  }
  
  &:hover, &:active {
    color: #35ba66;
  }
}

h1 {
  font-weight: bold;
  margin: 0;
  
  &:first-letter {
    color: #e00061;
  }
}

p.subtitle {
  margin: 0;
}

header {
  margin: 0 0 25px;
}

aside.bio {
  margin-bottom: 25px;
  max-width: 50%;
}

nav {
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-block;
    
    li {
      display: inline-block;
      
      a.current {
        color: #35ba66;
      }
      
      &:after {
        content: " / ";
      }
      &:last-child {
        &:after {
          content: "";
        }
      }
    }
  }
}

main.main {
  margin: 50px 0;
}

.work {
  margin-bottom: 40px;
  margin-left: 25px;
  h2 {
    margin: 0;
    text-indent: -24px;
    
    a {
      color: #9b5fe0;
      
      &:hover {
        color: #e00061;
      }
    }
    
    &:before {
      content: "> ";
    }
  }
  
  .gallery {
    margin: 25px 0;
    display: flex;
    flex-wrap: wrap;
    
    a {
      display: none;
      position: relative;
      
      img {
        width: 300px;
        height: 200px;
        object-fit: cover;
      }
      
      &:first-child {
        display: block;
      }
    }
  }
  
  .desc {
    margin: 1em 0;
    display: none;
    max-width: 50%;
  }
  
  footer {
    margin: 1em 0;
  }
  
  &.show-detail {
    .desc {
      display: block;
    }
    .gallery {
      a {
        display: block;
        margin-right: 10px;
        margin-bottom: 10px;
      }
    }
  }
}

.overlay {
  width: 100vw;
  height: 100vh;
  padding: 40px 30px;
  box-sizing: border-box;
  background-color: #4A1386;
  color: #FFFFFF;
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(100%, 0);
  transition: .5s;
  transition-timing-function: ease-in-out;
  text-align: center;
  overflow: auto;
  
  &:after {
    content: "";
    display: block;
    clear: both;
  }
  
  &.show {
    transform: translate(0);
  }
  
  .close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 24px;
  }
  h2 {
    width: 100%;
    min-width: 100%;
    color: #FFFFFF;
  }
  .image-wrapper {
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    flex-grow: 1;
    
    img {
      max-width: 100%;
      max-height: 400px;
    }
  }
  
  a {
    color: #ffb86c;
    
    &:hover {
      color: #e15d97;
    }
  }
  
  .navigation {
    margin: 1em 0;
  }
  
  .desc {
    flex-grow: 1;
    text-align: left;
    margin: 1em auto;
    max-width: 75%;
  }
}

@media only screen and (max-width: 960px) {
  aside.bio {
    max-width: 75%;
  }
  
  article.work .desc {
    max-width: 75%;
  }
}

@media only screen and (max-width: 768px) {
  aside.overlay {
    display: block;
    overflow: auto;
    .image-wrapper {
      max-width: 100%;
      min-width: 0;
      
      img {
        width: 100%;
        max-width: 100%;
      }
    }
    .desc {
      max-width: 100%;
    }
  }
}

@media only screen and (max-width: 568px) {
  main.main {
    article.work {
      margin-left: 0;
      .gallery {
        width: 100%;
        a {
          img {
            max-width: 100%;
            width: 100%;
          }
        }
      }
      .desc {
        max-width: 100%;
      }
    }
  }
  aside.bio {
    max-width: 100%;
  }
}
              
            
!

JS

              
                $(document).ready(function() {
  var converter = new showdown.Converter();
  $.ajax({
    method: 'GET',
    url: 'https://api.trello.com/1/lists/588a7cf1db8c84540d2873bc/cards',
    success: function(data) {
      var newContent = "";
      var labels;
      var htmlDesc;
      for (var i = 0; i < data.length; i++) {
        labels = data[i]['labels'].map(function(x) {
          return x['name'];
        });
        htmlDesc = converter.makeHtml(data[i]['desc']);
        newContent = `
<article id="${data[i]['id']}" class="work ${labels.join(' ')}">
  <h2><a href="#/work/${data[i]['id']}">${data[i]['name']}</a></h2>
  <div class="desc">${htmlDesc}</div>
  <div class="gallery"></div>
  <footer class="work-footer">Completed <span class="completed-date"></span> | <a href="" class="view-link" rel="external" target="_blank">View Site</a> | <a href="#/work/${data[i]['id']}">More Details</a>
</article>`;
        $('main.main').append(newContent);
        // get metadata
        $.ajax({
          method: 'GET',
          url: 'https://api.trello.com/1/cards/'+data[i]['id']+'/pluginData',
          success: function(cardData) {
            if (cardData[0]) {
              var values = JSON.parse(cardData[0].value);
              var completedDate = new Date(values['fields']['nASZliew-nnsxQQ']);
              var url = values['fields']['nASZliew-Tlp0xf'];
              if (completedDate) {
                $('main.main article.work#'+cardData[0]['idModel']).find('.completed-date').text(completedDate.getMonth()+1+"/"+completedDate.getDate()+"/"+completedDate.getFullYear());
              }
              $('main.main article.work#'+cardData[0]['idModel']).find('.view-link').attr('href', url);
              $.ajax({
                method: 'GET',
                cardId: cardData[0]['idModel'],
                url: 'https://api.trello.com/1/cards/'+cardData[0]['idModel']+'/attachments',
                success: function(galData) {
                  if (galData.length > 0) {
                    var newImage = "";
                    for (var j = 0; j < galData.length; j++) {
                      newImage = `
  <a href="#/work/${this.cardId}/detail/${galData[j].id}" id="${galData[j].id}" data-full="${galData[j].previews[5].url}"><img src="${galData[j].previews[4].url}" /></a>
  `;
                      $('article#'+this.cardId+'  .gallery').append(newImage);
                    }
                  }
                }
              });
            }
          }
        });
      }
    }
  });
  var viewCategory = function(categoryName) {
  	$('.main .work').removeClass('show-detail');
	  var category = categoryName;
	  if (category) {
      $('nav ul li a[data-cat="'+category+'"]').addClass('current').parent().siblings().find('a').removeClass('current');
	    $('.main .work').each(function() {
	      if ($(this).hasClass(category)) {
	        $(this).fadeIn();
	      } else {
	        $(this).fadeOut();
	      }
	    });
	  }
  }
  
  var viewWork = function(workId) {
    var work = $('.work#'+workId);
    if (work.length > 0) {
      work.addClass('show-detail').siblings().removeClass('show-detail');
      $('body,html').animate({
        scrollTop: work.offset().top
      },300);
    }
    $('.overlay').removeClass('show');
    $('body').removeClass('lock-scroll');
  }

  var viewDetail = function(workId, detailId) {
    var detail = $('article.work#'+workId+' .gallery #'+detailId);
    var prevDetail = detail.prev().attr('id');
    var nextDetail = detail.next().attr('id');
    var work = $('article.work#'+workId);
    var title = work.find('h2').text();
  	var source = detail.data('full');
	  var desc = work.find('.desc').html();
	  $('.overlay img').attr('src', source);
	  $('.overlay .desc').html(desc);
    $('.overlay h2').text(title);
	  $('a.close').attr('href', '#/work/'+workId);
    if (prevDetail) {
      $('a.prev').attr('href', '#/work/'+workId+'/detail/'+prevDetail).show();
    } else {
      $('a.prev').hide();
    }
    if (nextDetail) {
      $('a.next').attr('href', '#/work/'+workId+'/detail/'+nextDetail).show();
    } else {
      $('a.next').hide();
    }
    if (prevDetail && nextDetail) {
      $('.nav-separator').show();
    } else {
      $('.nav-separator').hide();
    }
	  $('.overlay').addClass('show');
	  $('body').addClass('lock-scroll');
  }

  var routes = {
    '/': function() {
      $('body').removeClass('lock-scroll');
      $('.overlay').removeClass('show');
      $('nav ul li a').removeClass('current');
      $('nav ul li:first-child a').addClass('current');
    },
    '/work/:workId/detail/:detailId': viewDetail,
    '/work/:workId': viewWork,
    '/category/:categoryName': viewCategory
  };

  var router = Router(routes);

  router.init();
});
              
            
!
999px

Console