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 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.

            
              <body ng-app="newsApp">
  <div class="wrapper container-fluid" ng-controller="mainController">

    <section class="main" >
      <div class="basenews">
      <div class="row text-center">
        <h1 class=" col-md-6">Camper news </h1>
        <h3 class="col-md-6">Free code camp</h3>
      </div>
        <input class="style-4" type="text" name="search" value="Search" placeholder="Search" ng-model='search.headline'>
      </div>

      <div class="row">
      <div class="col-lg-3 col-md-4 col-sm-6 holder" ng-repeat="news in stories | filter:search">
      <div class="story row">
        <div class="headline">
          <a class="" ng-href="{{news.link}}"><span> {{news.headline}}</span></a>
        </div>
        <div class="foto col-lg-5 col-md-6 col-sm-6">
          <div class="">
            <a ng-href="https://www.freecodecamp.com/{{news.author.username}}"><img class="img-rounded" ng-src="{{news.author.picture}}" alt="author picture" width="120" height="120" /></a>
          </div>

      </div>
      <div class="info col-lg-7 col-md-6 col-sm-6">
          <p>
            <a ng-href="https://www.freecodecamp.com/{{news.author.username}}">@ {{news.author.username}}</a>
          </p>
          <div class="time" title="Posted {{news.timePosted | date:'d MMMM y H:mm:ss'}}">
              <p class="time">{{news.timePosted | amCalendar}}</p>
          <p class="time" am-time-ago="news.timePosted"></p>
            </div>
      </div>
      <small>Like {{news.rank}}</small>
      </div>
      </div>
      </div>
    </section>

  </div>
  <!-- <script src="//localhost:35729/livereload.js"></script> -->
</body>
            
          
!
            
              *{
  /*outline:1px solid red;*/
}

html {
  margin: 0 auto;
}
body{
  width: 100%;
  background-color: #3e3e3e;
  background-color: #a7ffeb;
  font-family: monospace;
  color: #000;
}
p{
  margin-top: 10px;
}
img{
  margin-top: 15px;
}
a{
  color: #000;
}
a:hover,a:focus,a:visited{
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #E91E63;
}
.basenews{
  margin: 15px auto;
  max-width: 900px;
}
.basenews h1{
  font-family: cursive;
}

@media (min-width:991px){
  .basenews>div>h1{
    text-align: right;
  }
  .basenews>div>h3{
    text-align: left;
    padding-top: 13px;
  }
}
.holder{
  padding: 15px;
}
.story{
  position: relative;
  max-width: 320px;
  margin: 5px auto;
  min-height: 245px;
  border-radius: 5px;
  background-color: #00bfa5;
  transition: 0.2s;
}
.story:hover{
  box-shadow: -2px 2px rgba(50,50,50,0.5);
  transform: translateY(-5px);
}
.story>small{
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 10px;
  background-color: rgba(224, 224, 224, 0.62);
  border-top-left-radius: 5px;
}
.headline{
  padding: 10px;
  font-family:sans-serif;
  font-size: 1.3em;
  word-wrap: break-word;
  height: 100px;
  background-color: #fff;
  line-height: 1.65;
  overflow:hidden;
}
.foto{
  margin-left: -10px;
}
.info{
  margin-left: 10px;
}
.time {
  font-size: 0.9em;
}
input {
  color: #000;
}
input[type="text"] {
  display: block;
  margin:0 auto;
  padding-left: 30px;
  width: 10%;
  min-width: 150px;
  font-family: sans-serif;
  font-size: 18px;
  font-size: 2em;
  appearance: none;
  box-shadow: none;
  /*border-radius: none;*/
  border-radius: 10em;
  border: none;
}
input[type="text"]:focus {
  outline: none;
  width: 40%;
  min-width: 250px;
  background-color: #E91E63;
}
            
          
!
            
              var app = angular.module('newsApp', [ 'ngResource', 'angularMoment']);

app.factory('newsService', function($resource) {
  return $resource('https://www.freecodecamp.com/news/hot');
});

app.controller('mainController', function($scope,newsService) {
console.log('Angular mainController');
var news=  newsService.query().$promise.then(function(a){

  $scope.stories = a;
});

});
            
          
!
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