dashful

by gangadharjannu

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.4.2/angular-ui-router.min.js"></script>
<header>
  <nav class="nav-bar">
    <h1 id="brand">dashful</h1>
    <i id="settings-icon" class="fa fa-cog" aria-hidden="true"></i>
  </nav>
</header>
<main class="dashboard">
  <section class="dashboard" ng-controller="IndexCtrl">
    <section class="widgets">
      <article class="widget" ng-repeat="widget in widgets">
        <news-widget widget="widget"></news-widget>
      </article>
    </section>



  </section>
</main>
<footer class="footer dashboard-footer">Copyright &copy; 739688, MMXVII</footer>
<!-- template.html -->
<script type="text/ng-template" id="views/index.html">
  <section class="widgets">
    <article class="widget" ng-repeat="widget in widgets">
      <news-widget widget="widget"></news-widget>
    </article>
  </section>
</script>

<script type="text/ng-template" id="partials/news.html">
  <span>{{widget}}</span>
</script>

CSS

/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}


/* HTML5 display-role reset for older browsers */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

* {
  padding: 0;
  margin: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.5em;
}

h3 {
  font-size: 1.17em;
}

h4 {
  font-size: 1.12em;
}

p {
  font-size: .875rem;
}

span {
  font-size: .875em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  width: 100%;
}

input {
  width: 100%;
  padding: 2%;
}

html {
  height: 100%;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #282c34;
  color: #abb2bf;
  display: flex;
  flex-flow: column;
  height: 100%;
}

header {
  flex: 0 0 auto;
}

main {
  flex: 1 0 auto;
}

footer {
  flex: 0 0 auto;
}

.nav-bar {
  background-color: #21252b;
  padding: 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#brand {
  color: #806f49;
  font-style: italic;
  display:...

JavaScript

angular.module('app', []);
angular
  .module('app')
  .controller('IndexCtrl', function($scope, $http, $timeout) {
    $timeout(function() {
      $scope.widgets = [1, 2, 3];
    }, 2000);
    $timeout(function() {
      $scope.widgets = [1, 2, 3, 4];
    }, 1000);
  })
  .directive('newsWidget', function() {
    return {
      restrict: 'E',
      templateUrl: 'partials/news.html',
      controller: 'IndexCtrl',
      scope: {
        widget: '='
      }
    }
  });