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.

Quick-add: + add another resource

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.

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.

            
              <div ng-app="app" ng-controller="Controller">
    <ul id="menu">
        <li><a navigation-link="'article'">Articles</a></li>
        <li><a navigation-link="'book'">Books</a></li>
    </ul>
<ul id="categories">
        <li><a navigation-link="'article'" to-data="{ category: 'coding' }">Coding</a></li>
        <li><a navigation-link="'article'" to-data="{ category: 'design' }">Design</a></li>
    </ul>
    <div id="content">
        <div ng-if="mode == 'articles'"> 
            <ul id="articles">
                <li ng-repeat="article in articles">
                    <a navigation-link="'select'" to-data="{ slug: article.slug }">{{article.title}}</a>
                    <div>By <span>{{article.author}}</span></div>
                </li>
            </ul>
            <div id="paging">
                <a ng-repeat="page in pages" refresh-link="{ page: page.page }" include-current-data="true">{{page.page}}</a>
            </div>
        </div>
        <div ng-if="mode == 'article'">
            <div id="article">
                <h2>{{article.title}}</h2>
                <div>By <span>{{article.author}}</span></div>
                <p>{{article.text}}</p> 
            </div>
            <div id="continue">
                <a navigation-back-link="1">Continue browsing</a>
            </div>
        </div>
    </div>
</div>

            
          
!
            
              body{
    font-family:"Segoe UI","Helvetica Neue",Arial,sans-serif;
    padding:0 2%;
    margin:0 auto 10px auto;
    max-width:600px;
    width:96%;
    background-image:url(http://media.mediatemple.netdna-cdn.com/wp-content/themes/smashing-magazine/assets/images/smbg.png);
}
#content{
    background-color:#fff;
    border-bottom-right-radius:10px;
}
ul{
    list-style-type:none;
    margin:0;
    padding:0;
    clear:both;
}
ul a {
    display:block;
    text-align:center;
}
#menu li:first-child a{
    width:150px;
    height:30px;
    padding:25px 10px;
    background-color:#fff;
    background-image:url(http://media.mediatemple.netdna-cdn.com/wp-content/themes/smashing-magazine/assets/images/logo.png);
    background-size:143px 37px;
    background-repeat:no-repeat;
    color:transparent;
    background-position:10px 20px;
}
#menu{
    height:80px;
}
#menu li{
    float:left;
}
#menu li:nth-child(2) a{
    width:80px;
    padding-top:40px;
    padding-bottom:20px;
    color:rgba(0,0,0,.3);
    border-right:1px solid #e5e5e5;
    text-decoration:none;
}            
#categories{
    padding-top:30px;
    padding-left:40px;
    height:36px;
    border-bottom:4px solid rgba(0,0,0,.06);
    background-color:#fff;
    border-top-right-radius:10px;
}
#categories li{
    float:left;
}
#categories li a{
    padding:0 15px;
    height:28px;
    padding-top:8px;
    text-transform:uppercase;
    letter-spacing:2px;
    font-size:0.75em;
    font-weight:bold;
    border-right:1px solid #e5e5e5;
    color:#000;
    text-decoration:none;
}
#categories li:first-child{
    border-bottom:4px solid #63bfb2;
}
#categories li:nth-child(2){
    border-bottom:4px solid #cdeeaa;
}
#articles{
    padding:30px;
}
#articles li{
    padding:10px 0;
    font-size:1.25em;
    border-bottom:1px solid #e5e5e5;
}
#articles a{
    font-family:Georgia,"Times New Roman",Times,serif;
    color:#000;
    text-align:left;
    text-decoration:none;
}
#articles li div{
    font-size:0.75em;
    padding-top:5px;
    color:rgba(0,0,0,.3);
}
#paging{
    border-top:5px solid #41b7d8;
    padding:20px 0 20px 40%;
}
#paging a{
    color:#41b7d8;
    padding:10px;
    margin-right:20px;
    text-decoration:none;
}
h2{
    margin:0;
    padding:0;
    font-family:Georgia,"Times New Roman",Times,serif;
}
#article{
    padding:30px 30px 10px 30px;
}
#article div {
    padding-top:5px;
    color:rgba(0,0,0,.3);
}
#article p{
    padding:7px 0 0 0;
}
#continue{
    border-top:5px solid #41b7d8;
    padding:20px 0;                
}
#continue a{
    display:block;
    margin:0 auto;
    color:#41b7d8;
    text-decoration:none;
    width:150px;
}

            
          
!
            
              var app = angular.module('app', ['NavigationAngular']);
app.controller('Controller', function ($scope) {
    $scope.mode;
    $scope.articles;
    $scope.pages;
    $scope.showArticles = function(data){
        $scope.mode ='articles';
        var articles = getArticles().filter(function name(article) {
            return !data.category ? true : article.category === data.category;
        });
        $scope.pages = [];
        for(var i = 0; i < Math.ceil(articles.length / 3); i++){
            $scope.pages.push({ page: i + 1 });
        }
        var start = (data.page - 1) * 3;
        articles = articles.slice(start, start + 3);
        $scope.articles = articles;
    };
    $scope.article;
    $scope.showArticle = function(data){
        $scope.mode = 'article';
        var article = getArticles().filter(function name(article) {
            return article.slug === data.slug;
        })[0];
        $scope.article = article;
    }
    $scope.showBooks = function(){
        $scope.mode = 'books';
    };
    
    Navigation.StateController.onNavigate(function () {
        if (!$scope.$$phase)
            $scope.$apply();
    })
    var articleDialog = Navigation.StateInfoConfig.dialogs.article;
    var articleListState = articleDialog.states.list; 
    var articleDetailsState = articleDialog.states.details; 
    articleListState.navigated = $scope.showArticles;
    articleDetailsState.navigated = $scope.showArticle;
    var bookDialog = Navigation.StateInfoConfig.dialogs.book;
    var bookListState = bookDialog.states.list; 
    bookListState.navigated = $scope.showBooks;
    Navigation.start();
});            
var articleDialog = {
    key: 'article', initial: 'list', states: [
        { key: 'list', route: '{category?}', defaults: { page: 1 }, transitions: [
            { key: 'select', to: 'details' }
        ], trackCrumbTrail: false},
        { key: 'details', route: 'article/{slug}' }
    ]
};
var bookDialog = {
    key: 'book', initial: 'list', states: [
        { key: 'list', route: 'books', trackCrumbTrail: false }
    ]
};
Navigation.StateInfoConfig.build([ articleDialog, bookDialog ]);

function getArticles(){
    return [
        { 
            title: 'Designers And Developers: No Longer A House Divided', 
            slug: 'designers-and-developers-no-longer-a-house-divided',
            text: 'As the web continues to evolve at a breakneck, Moore\'s-law pace, the divisions between traditional design and development are increasingly shifting. The "learn to code" movement is also gaining momentum among designers, but you\'d be hard pressed to find a similarly strong movement for other disciplines within a team. Perhaps there should be.',
            author: 'Ivana McConnell', 
            category: 'coding' 
        },
        { 
            title: 'A Better Way To Design For Retina In Photoshop', 
			slug: 'retina-design-in-photoshop',
			text: 'Recently, I had a project in which I needed to produce high-fidelity screens for a tablet. I was to present these screens on the device and also produce a clickable prototype. They needed to be pixel-perfect. The timeline was tight (as always), so I went with my go-to tool, Photoshop. I’ve been using it for over ten years, and it gives me the fastest high-quality output.',
            author: 'Murdoch Carpenter', 
            category: 'design' 
        },
        { 
            title: 'Extending In Sass Without Creating A Mess',
			slug: 'extending-in-sass-without-mess',
			text: 'The @extend directive in Sass is a powerful directive that facilitates the sharing of rules and relationships between selectors. However, it can produce undesirable side effects if it is not carefully implemented. Thankfully, there are many strategies for using @extend effectively that can prevent these side effects and produce clean, organized CSS.',
            author: 'David Khourshid', 
            category: 'coding' 
        },
        { 
            title: 'Creating A Complete Web App In Foundation For Apps', 
			slug: 'creating-web-app-in-foundation-for-apps',
			text: 'Foundation for Apps is a new single-page app framework from Zurb that is closely related to Foundation 5 (also known as Foundation for Sites, a widely used front-end framework). It\'s built around AngularJS and a flexbox grid framework. It\'s intended to make creating a web app very quick and simple, enabling us to quickly start writing the code that’s unique to our application, rather than boilerplate.',
            author: 'Stephen Saucier', 
            category: 'coding' 
        },
        { 
            title: 'Design Principles: Compositional Flow And Rhythm', 
			slug: 'design-principles-compositional-flow-and-rhythm',
			text: 'When someone lands on a page of your site what do you want that person to do? Where do you want them to look? What information do you want your visitors to notice and in what order?',
            author: 'Steven Bradley', 
            category: 'design' 
        },
        { 
            title: 'An In-Depth Overview Of Living Style Guide Tools', 
			slug: 'an-in-depth-overview-of-living-style-guide-tools',
			text: 'Following the market\'s demand for minimalistic and consistent UIs, and the growth in modular web development, we tend to pay more and more attention to documentation and the efficiency of designer-engineer workflow with each project we undertake. Also, since the documentation process is often the weakest spot for modern web teams, we\'re constantly looking for the right tools to help us.',
            author: 'Robert Haritonov', 
            category: 'design' 
        },
        { 
            title: 'React To The Future With Isomorphic Apps', 
            slug: 'react-to-the-future-with-isomorphic-apps',
            text: 'Things often come full circle in software engineering. The web in particular started with servers delivering content down to the client. Recently, with the creation of modern web frameworks such as AngularJS and Ember, we\'ve seen a push to render on the client and only use a server for an API. We\'re now seeing a possible return or, rather, more of a combination of both architectures happening.',
            author: 'Jonathan Creamer', 
            category: 'coding' 
        },
        { 
            title: 'Web Scraping With Node.js', 
			slug: 'web-scraping-with-nodejs',
			text: 'Web scraping is the process of programmatically retrieving information from the Internet. As the volume of data on the web has increased, this practice has become increasingly widespread, and a number of powerful services have emerged to simplify it. Unfortunately, the majority of them are costly, limited or have other disadvantages. Instead of turning to one of these third-party resources, you can use Node.js to create a powerful web scraper that is both extremely versatile and completely free.',
            author: 'Elliot Bonneville', 
            category: 'coding' 
        },
        { 
            title: 'On China\'s Bleeding Edge: Web Design Trends 2015',
			slug: 'china-web-design-trends-2015',
			text: 'There are many parallels between the volatility of the web industry and China\'s breakneck rate of change: For one thing, it\'s hard to keep a finger on the pulse of either. But add the two together and you get China\'s tech scene, a virtual landscape in such constant flux that our only hope of keeping pace is to look as far into the future as we\'re able, try to discern what\'s coming, and brace for impact.', 
            author: 'Kendra Schaefer', 
            category: 'design' 
        }
    ];
}

            
          
!
999px
Loading ..................

Console