Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .todolist#app
  .head 
    .title Todo-代辦事項
    .donepercent {{donetext}}
  .top
    label.list(v-for="todo in todos")
      input(type="checkbox" v-model="todo.done")
      .checkbtn
      .title {{todo.name}}
      .date {{todo.date}}
    
  .bottom
    .lastnum
              
            
!

CSS

              
                $color_orange: #FAA2CB


*
  //border: solid 2px
  font-family: 微軟正黑體
  position: relative
  
@mixin size($w,$h)
  width: $w
  height: $h

@mixin center
  position: absolute
  left: 50%
  top: 50%
  transform: translateX(-50%) translateY(-50%)
  
@mixin text($size,$space,$color)
  font-size: $size
  letter-spacing: $space
  color: $color
  
html,body
  +size(100%,100%)
  padding: 0px
  margin: 0px
  background-color: #eee
  
  
.todolist
  +size(280px,initial)
  +center
  background-color: #fff
  border-radius: 4px
  overflow: hidden
  box-shadow: 0px 30px 40px -20px rgba(0,0,0,0.25)
  box-sizing: border-box
  transition: 0.5s
  &:hover
    transform: translateX(-50%) translateY(-51%)
  // &:hover
  //   .top
  //     height: 300px
  
.top
  // height: 0px
  overflow: hidden
  transition: 1s
  border-bottom: solid 1px white
  
  & .list
    padding: 6px
    padding-left: 20px
    padding-right: 20px
    border: none
    border-top: solid 1px #bbb
    display: block
    cursor: pointer
    +text(14px,2px,#888)
    transition: background-color 1s,transform 0.5s
      
    &:hover
      background-color: #eee
      transform: translateY(-2px)
    
    .checkbtn,.title
      display: inline-block
      vertical-align: middle
    .date
      position: absolute
      right: 10px
      top: 50%
      transform: translateY(-50%)
      +text(12px,1px,#999)
    .title
      margin-left: 10px
    & .checkbtn
      border: solid 2px $color_orange
      +size(14px,14px)
      cursor: pointer
      
.head
  +size(100%,70px)
  background-image: linear-gradient(141deg,#FAA2CB,#FFC966)
  
  
  padding: 15px
  box-shadow: 0px 0px 15px rgba(0,0,0,0.2), 0px 0px 20px #FFA617
  
  & .title
    +text(26px,2px,white)
  & .donepercent
    margin-top: 7px
    +text(15px,2px,white)
      
     
.bottom
  +size(100%,10px)
  background: linear-gradient(141deg,#FAA2CB,#FFC966)
      
input
  display: none
input[type="checkbox"]:checked + .checkbtn
  &::before
    +text(26px,0px,#f24)
    line-height: 0px
    content: "✓"
    color: #FAA2CB
  
              
            
!

JS

              
                var list=[
  {   name:"倒垃圾", date:"2016/08/26" ,done: false },
  {   name:"整理房間", date:"2016/08/27" ,done: false},
  {   name:"買飲料", date:"2016/09/04" ,done: false},
  {   name:"出去玩", date:"2016/10/24" ,done: false},
  {   name:"加選課程", date:"2016/09/07" ,done: false},
  {   name:"購買糧食", date:"2016/10/12" ,done: false},
  {   name:"逛街", date:"2017/01/31" ,done: false},
];
var vm = new Vue({
  el: "#app",
  data: {
    todos: list
  },
  computed:{
    donetext: function(){
      var done=0;
      var total=this.todos.length;
      for(var i=0;i<total;i++)
        if (this.todos[i].done)
          done++;
      return "("+done+"/"+total+")已完成";
    }
  }
});
              
            
!
999px

Console