cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

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.

            
              <style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
  display: none !important;
}
</style>
<div ng-app="gitRepos" ng-controller="gitReposController" breakpoint="min-width: 44.375em" ng-cloak>
    <table ng-if="matches" class="table">
        <thead>
            <tr>
                <th>Repo</th>
                <th>Watchers</th>
                <th>Forks</th>
                <th>Size</th>
                <th>Open Issues</th>
                <th>Owner</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="repo in repos">
                <td><a ng-href="{{repo.html_url}}" target="_blank">{{repo.name}}</a></td>
                <td>{{repo.watchers}}</td>
                <td>{{repo.forks}}</td>
                <td>{{repo.size}}</td>
                <td>{{repo.open_issues}}</td>
                <td><a ng-href="{{repo.owner.html_url}}" title="Repo owner" target="_blank">{{repo.owner.login}}</a></td>
            </tr>
        </tbody>
    </table>

    <div ng-if="!matches"> <!-- Wrapper required to avoid multiple-directioves/transclusion error. See https://github.com/angular-ui/angular-ui/issues/481 -->
        <article class="card" ng-repeat="repo in repos">
            <header>
                <h1><a ng-href="{{repo.html_url}}" target="_blank">{{repo.name}}</a></h1>
                <h2>owned by <a ng-href="{{repo.owner.html_url}}" title="Repo owner" target="_blank">{{repo.owner.login}}</a></h2>
            </header>
            <dl>
                <dt>Watchers</dt><dd>{{repo.watchers}}</dd>
                <dt>Forks</dt><dd>{{repo.forks}}</dd>
                <dt>Size</dt><dd>{{repo.size}}</dd>
                <dt>Open Issues</dt><dd>{{repo.open_issues}}</dd>
            </dl>
        </article>
    </div>
</section>
<aside>Stats from September 14th, 2013 (not up to date)</aside>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script>
            
          
!
            
              @import compass

@import compass/reset
@import compass/css3

$breakpoint: 44.375em

* 
    box-sizing: border-box

body
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif
    color: #33393b
    @media (max-width: $breakpoint)
        background-color: #eee
a
    text-decoration: none
    color: #005075
    font-weight: bold
.table
    width: 100%
thead
    font-size: 1.2em
    background-color: #8cbf26
    color: #1f2e3a
    padding-top: .5em
th
    font-weight: bold
tbody
    font-size: 1.1em
    tr:nth-child(even)
        background-color: #F1F1F1
tr
    line-height: 2em
    td:first-child, th:first-child
        text-indent: 1em
aside
    margin: 1.6em 1em
    color: #555
    font-style: italic

.card
    margin: 1em .8em
    padding: 1em
    border-radius: .1875em
    border: 1px solid #e2e2e2
    // border: 1px solid #8CBF26
    +box-shadow(#E2E2E2 0 2px)
    // +box-shadow(#8CBF26 0 2px)
    background-color: #fff
    a
        color: #8CBF26
    h1
        font-size: 1.6em
        margin: .25em 0 .4em
    h2
        font-size: 1.2em
        margin: .7em 0 .5em
    dl
        overflow: hidden
        width: 100%
        padding: .2em
        margin-top: 1em
    dt, dd
        float: left
        width: 25%
        line-height: 1.2em
        margin: .3em 0
    dt
        color: #5E6D74
        font-weight: bold
        padding-right: .5em
            
          
!
            
              var repos = [{"name":"bootstrap","owner":{"html_url":"https://github.com/twbs","login":"twbs"},"html_url":"https://github.com/twbs/bootstrap","size":"64893","forks":"20018","open_issues":"159","watchers":"58229"},{"name":"node","owner":{"html_url":"https://github.com/joyent","login":"joyent"},"html_url":"https://github.com/joyent/node","size":"380079","forks":"4731","open_issues":"633","watchers":"24526"},{"name":"jquery","owner":{"html_url":"https://github.com/jquery","login":"jquery"},"html_url":"https://github.com/jquery/jquery","size":"22400","forks":"4899","open_issues":"7","watchers":"23630"},{"name":"html5-boilerplate","owner":{"html_url":"https://github.com/h5bp","login":"h5bp"},"html_url":"https://github.com/h5bp/html5-boilerplate","size":"73410","forks":"5422","open_issues":"8","watchers":"22283"},{"name":"rails","owner":{"html_url":"https://github.com/rails","login":"rails"},"html_url":"https://github.com/rails/rails","size":"220428","forks":"6557","open_issues":"741","watchers":"19587"}];
//normally you'd create a service here and make a request from the controller

// var app = angular.module("gitRepos", ['ngResource']);
var app = angular.module("gitRepos", []);

app.directive("breakpoint", function () {
    return function (scope, element, attrs) {
        if (window.matchMedia) {
            var breakpoint = attrs.breakpoint;
            var mql = window.matchMedia( "(" + breakpoint + ")" );
            var mqlListener = function (mql) {
                scope.matches = mql.matches;
                if(!scope.$$phase) { //prevents it from unnecessarily calling $scope.$apply when the page first runs
                    scope.$apply(); //triggers the digest cycle
                }
            };
            mql.addListener(mqlListener); //whenever the media-query result changes, call mqlListener
            mqlListener(mql); //call mqlListener once when page loads
        } else {
            scope.matches = false;
        }
    };
});

function gitReposController($scope){
    $scope.repos = repos;
}
            
          
!
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