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.

+ add another resource

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              <nav class="menu">
  <h1 class="name brand"><i class="fa fa-fire"></i> camperNews</a></h1>
  <ul class="inline-list hide-for-small-only account-action">
    <li><a href="#" target="_blank">freeCodeCamp</a></li>
    <li class=""><a class="signup" href="https://www.freecodecamp.com/challenges/zipline-stylize-stories-on-camper-news" target="_blank">The Challange</a></li>
  </ul>
</nav>

<div class="row content" ng-app="camperNews">
  <div ng-controller="newsCtrl as news">
    <div class="row">
      <div class="loading" ng-show="news.loading"><i class="fa fa-spinner fa-pulse"></i> Loading...</div>
      <div class="small-4 columns fixed-size" ng-repeat="new in news.newsArray">
        <div class="item-wrapper">
          <div class="img-wrapper">
            <a class="button expand go-to-new" href="https://www.freecodecamp.com/news/{{new.storyLink | slug}}" target="_blank">Discuss</a>
            <a href="{{new.link}}" target="_blank"> <div class="image" style="background-image:url({{new.image === '' ? new.author.picture : new.image}})"></div> </a>
          </div>
          <div class="description-wrapper">
            <a href="{{new.link}}" target="_blank"><p>{{new.headline}}</p></a>
            <div class="author-upvotes">
              <div class="author">Posted by <a href="https://www.freecodecamp.com/{{new.author.username}}" target="_blank">{{new.author.username}}</a> </div>
              <div class="upvotes"><a href="https://www.freecodecamp.com/news/{{new.storyLink | slug}}" target="_blank"><i class="fa fa-thumbs-o-up"></i> {{new.upVotes.length}}</a></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>


<footer class="row">
  <div class="large-12 columns">
    <hr/>
    <div class="row">
      <div class="large-6 columns">
        <p>by <a href="https://codepen.io/hezag">hezag</a>, using <a href="https://angularjs.org/">AngularJS</a> and <a href="https://foundation.zurb.com/">Foundation</a></p>
      </div>
    </div>
  </div>
</footer>

</div>
</div>
            
          
!
            
              $background-color: #292c2f;
$primary-color: #87D37C;
@import url(https://fonts.googleapis.com/css?family=Montserrat);
.brand {
  font-family: 'Montserrat', sans-serif;
}
.content {
  margin-top:5px;
  margin-bottom: 25px;
}
.loading {
  width: 100%;
  text-align:center;
  font-size:35px;
  padding:30px;
  color: #292c2f;
  i {
    color:#87D37C;
    font-size:36px;
  }
}
a {
  color:darken(#87D37C, 20%);
  &:hover {
    color:#87D37C;
  }
}
.menu {
  background-color: $background-color;
  padding: 1.5rem 3rem;
  height: auto;
  
  .inline-list {
    text-align: center;
    
    li {
      float: none;
      display: inline-block;
    }
    
    a {
      color: #fff;
      padding-bottom: 0.5rem;
      
      &:hover {
        color: $primary-color;
        transition: all .3s ease-in-out;
      }
    }
    
    .active a {
      color: $primary-color;
    }
  }
  
  .account {
    position: absolute;
    top: 3%;
    right: 3%;
    
    a , i {
      color: #fff;
    }
  }
  
  @media only screen and (min-width: 40.063em) {
  height: 5rem;
  
  .inline-list { 
    float: left;
    margin: 0 0 0 1.5rem;
    }
    
    a:hover {
      border-bottom: 2px solid $primary-color;
    }
  }
  
  .account-action {
    float: right;
    margin: -.75rem 0 0 0;
    
    li {
      margin-left: .2rem;
    }
    
    a { padding: 0.75rem 1rem;}
    
    a.signup {
      font-weight: bold;
      background-color: scale-color($background-color, $lightness: 10%);
      border-radius: 3px;
    }
  }
}

.name {
  text-align: center;
  font-size:  1.5rem;
  line-height: 1;
  margin: 0 0 1rem 0;
  color: #fff;
  
  i {
    color: $primary-color;
    margin-right: 0.5rem;
  }
  
  @media only screen and (min-width: 40.063em) {
    float: left;
  }
}
.grid-item { width: 310px; }
$primary-color: darken(#87D37C, 20%);
@media screen and (max-width: 760px) {
  .fixed-size {
    width: 49.3% !important;
  }
}
@media screen and (max-width: 500px) {
  .fixed-size {
    width: 98% !important;
    min-width: 250px;
  }
}
.fixed-size {
  width: 33%;
  height: 460px;
  margin-bottom:25px;
  margin-left:2px;
  .item-wrapper {
    width:100%;
    height:100%;
  }
}
.item-wrapper {
  overflow:hidden;
  border: 2px solid #efefef;
  border-radius: 5px;
  margin-top: 40px;
  
  &:hover {
    .img-wrapper {
      .image { opacity:1 }
      
      .go-to-new { bottom: 0; }
    }
  }
}
.description-wrapper {
  padding: 15px 20px 5px 20px;
  height:150px;
  p {
    color: #222;
    font-size: 13px;
  }
  .author-upvotes {
    position:absolute;
    bottom:-10px;
    width:80%;
    height:15px;
    color: #333;
    font-weight: bold;
    font-size: 12px;
    .author {
      position:absolute;
      left:0px;
    }
    .upvotes {
      position:absolute;
      right:5%;
    }
  }
}
.img-wrapper {
  position: relative;
  overflow: hidden;
  background: #eee;
  .go-to-new {
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    background-color: #333;
    padding: 9px 8px;
    bottom: -50px;
    position: absolute;
    z-index: 2;
    color: #fff;
    margin: 0 auto;
    border: none;
    box-shadow: none;

    &:hover { background-color: $primary-color; }
  }
  .image {
    border-radius: 5px 5px 0px 0px;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    opacity: 0.95;
    width: 100%;
    height: 315px;
    background-size: cover;
    background-position: center center;
  }
  /*img {
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    //-webkit-filter: grayscale(1);
    width: 100%;
  }*/

}  

h3 { font-size: 22px; }
h5 { font-weight: bold; }

p {
  color: #888;
  font-size: 13px;
  margin-bottom: 0;
}
footer {
  padding-bottom:15px;
}

            
          
!
            
              (function(){
  var app = angular.module('camperNews', []);
  // transform spaces into "-"
  app.filter('slug', function(){
    return function(input){
      return input.replace(/\s/g, '-');
    };
  });
  app.controller('newsCtrl', function($http){
    this.loading = true;
    this.newsArray = [];
    var scope = this;
    $http.get('https://www.freecodecamp.com/stories/hotStories?callback=?').
    success(function(data){
      data.pop();
      scope.newsArray = data;
      scope.loading = false;
    });
  });
})();
            
          
!
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