susy实现Dashboard

@import "compass/reset";
@import "compass/css3/border-radius";
@import "susy";

$heade-text-color: #888;
$section-body-bgcolor: #fafafa;

$susy: (
  columns: 12,  // The number of columns in your grid
);
@include border-box-sizing;

h1, h2 {
  font-weight: 100;
}

h1{
  margin-top:20px;
}

h2{
  margin-bottom: 10px;
}

header {
  text-align: center;
  letter-spacing: 1em;
  color: $heade-text-color;
  text-transform: uppercase;
  h1 {
    font-size: 4em;
  }
}

.g-progress {
  @include container;
  width: span(8);
}

.g-container {
  @include container;
  width: span(11);
  margin-top: 30px;
  h2 {
    margin-top: 0;
  }
}

.g-col{
  padding: 40px;
  min-height: 250px;
  background-color: $section-body-bgcolor;
  @media only screen and (min-width: 640px){
    @include span(4 of 12);
    &:nth-child(3n){
      @include span(last 4 of 12);
    }
  }
  @media only screen and (min-width: 900px){
    @include span(3 of 12);
    &:nth-child(3n){
      @include span(3 of 12);
    }
    &:nth-child(4n){
      @include span(last 3 of 12);
    } 
  }
}

/* 进度条 */
progress {  
  background-color: #444;
  @include border-radius(8px);
  width: 100%;
  position: relative;
  height: 30px;
  &:after {
    position: absolute;
    width: 100%;
    margin-top: -60px;
    content: '' attr(value) '%';
    text-align: center;
    display: block;
    background-color: transparent;
  }
} 

progress::-webkit-progress-bar {  
  border-radius: 8px;
  background-color: darken(#007DD5, 20%);
}  
progress::-webkit-progress-value {  
  border-radius: 8px;
  background-color: #007DD5;
}

@keyframes pvalue {
  from {
    width: 0;
  }
  to {
    width: 62%;
  }
}

progress::-webkit-progress-value {
  animation: pvalue 3s;
}

.blogroll {
  display: block;
  padding: 12px;
  background-color: #ccc;
  color: #444;
  text-decoration: none;
  border-bottom: 1px solid #c0c0c0;
  transition: all 0.2s;
  &:hover {
    background-color: #ddd;
  }
}

.avatar {
  @include span(4 of 12);
  &:nth-child(3n) {
    @include span(last 4 of 12);
  }
  display: inline-block;
  position: relative;
  img {
    max-width: 100%;
    border-radius: 50%;
    transition: all 0.8s;
  }
  span {
    display: block;
    position: absolute;
    top: 50%;
    text-align: center;
    color: #222;
    line-height: 16px;
    margin-top: -8px;
    left: 0;
    width: 100%;
    opacity: 0;
  }
  &:hover img {
    filter: blur(2px);
    opacity: .2;
  }
  &:hover span {
    opacity: 1;
  }
}


.tag {
  padding: 8px 10px;
  margin-top:10px;
  display: inline-block;
  border-radius: 6px;
  background-color: #4D4D4D;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
  &:hover {
    background-color: #007DD5;
  }
}



    <header>
        <h1>Dashboard</h1>
    </header>

    <div class="g-progress">
        <h2>Shipped:</h2>
        <progress value="62" max="100"></progress>
    </div>

    <section class="g-container">
        <div class="g-col">
            <h2>Blogroll:</h2>
            <div>
                <a href="" class="blogroll">How Susy Makes Sense</a>
                <a href="" class="blogroll">Things you can do with Susy</a>
                <a href="" class="blogroll">Susy Q? More Like Susy Awesome.</a>
            </div>
        </div>
        <div class="g-col">
            <h2>Latest Sign-ins</h2>
            <div class="avatars">
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
                <div class="avatar"></div>
            </div>
        </div>
        <div class="g-col">
            <h2>Tags:</h2>
            <div >
                <a href="" class="tag">Foo</a>
                <a href="" class="tag">Bar</a>
                <a href="" class="tag">Something else</a>
                <a href="" class="tag">Odd</a>
            </div>
        </div>
        <div class="g-col">
            <h2>Shipped:</h2>
            <progress value="62" max="100"></progress>
        </div>
    </section>

    <script   src="http://code.jquery.com/jquery-2.2.2.min.js"   integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI="   crossorigin="anonymous"></script>
    <script>
    	$('.avatar').each(function(i,el){
    	  var av = el;
    	  $.getJSON("http://uifaces.com/api/v1/random", function(data){
    	    console.log(data);
    	    $(av).append('<img src="' + data.image_urls.epic + '"><span>'+ data.username +'</span>')
    	  });
    	});
    </script>
标签: 点击数:8368