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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="wrapper">
    <div class="contents">
        <h1>Todo</h1>
        <div class="main todoList">
            <input type="text" placeholder="タスクを記入" class="add" v-model="newTask" v-on:keyup.enter="addTask">
            <ul class="lists">
                <li v-for="todo in filteredTodos">
                    <label><input type="checkbox" name="check" v-model="todo.check" ><span class="icon-checkmark-circle"></span></label>
                    <input type="text" name="task" v-model="todo.title">
                    <span class="delete icon-trash"  v-on:click="deleteTask(todo)"></span>
                </li>
            </ul>
            <div class="filters">
                <select name="todoChange" v-model="filterTask" >
                    <option value="all">All Tasks</option>
                    <option value="incomplete">Incompelete Tasks</option>
                    <option value="complete">Complete Tasks</option>
                </select>
            </div>
        </div>
    </div>
<!--//wrapper --></div>
              
            
!

CSS

              
                html { font-size: 62.5%; }
html,body,#wrapper {height: 100%;}
/* body */

body
{
    font-size: 1.4rem; 
    line-height: normal;
    letter-spacing: normal;
    background-color: #f9f9f9;
    background-image: url(https://www.pakutaso.com/shared/img/thumb/Photoelly037_TP_V.jpg);
    background-position: center center;
    -webkit-background-size: cover;
         -o-background-size: cover;
            background-size: cover;
}

.wrapper
{
	margin: 0px auto;
	width: 100%;
	position: relative;
	display: flex;
}
.contents {
	width: 80%;
	max-width: 600px;
	margin: 0 auto;
	margin-top: 10vh;
	max-height: 80vh;
	background-color: #fff;
	-webkit-border-radius: 20px;
	        border-radius: 20px;
	-webkit-box-shadow: 0px 1px 10px #777;
	        box-shadow: 0px 1px 10px #777;
	
}
.contents h1 {
	text-align: center;
	border-bottom: 1px solid #ddd;
	padding: 15px 0;
	font-size: 1.6rem;
	/*height: 40px;*/
}
.main {
	padding: 10px 20px;
	overflow: hidden;
	width: 100%;
}
.add {
	width: 100%;
	padding: 10px;
	height: 40px;
	font-size: 14px;
  border-bottom: 1px solid #ddd;
	-webkit-transition: 0.3s;
	   -moz-transition: 0.3s;
	    -ms-transition: 0.3s;
	     -o-transition: 0.3s;
	        transition: 0.3s;
}
.add:focus {
	outline: none;
  border-bottom-color: #bbb;
  letter-spacing: 1px;
}
.lists {
	margin-top: 10px;
	overflow: auto;

	width: 575px;
	height: calc(80vh - 164px );
}
.lists li {
	width: 560px;
	/*border-top: 1px solid #ccc;*/
	display: flex;
	padding: 6px 10px;
	align-items:center;
	
}

.lists li * {
	font-size: 1.6rem;
	color: #555;
}
.lists li label {
	cursor: pointer;
	
}
.lists li label input {
	display: none;
}
.lists li label span {
	font-size: 2rem;
	display: inline-block;
	-webkit-transition: all 0.2s;
	   -moz-transition: all 0.2s;
	    -ms-transition: all 0.2s;
	     -o-transition: all 0.2s;
	        transition: all 0.2s;
  color: #999;
}
.lists li label span:hover {
	-webkit-transform: scale(1.08);
	   -moz-transform: scale(1.08);
	    -ms-transform: scale(1.08);
	     -o-transform: scale(1.08);
	        transform: scale(1.08);
}
.lists li label input:checked ~ span {
	color: #3498db;
}
.lists li input[type=text] {
	flex-grow: 1;
	margin: 0 10px;
	padding: 5px 8px;
	
}
.lists li input[type=text]:focus {
	-webkit-box-shadow: 0 0 3px #ccc;
	        box-shadow: 0 0 3px #ccc;
	
	outline: none;
}
.lists li .delete {
	cursor: pointer;
	opacity: 0;
}
.lists li:hover .delete {
	opacity: 1;
}
.filters {
	width: 100%;
	border-top: 1px solid #ddd;
	padding: 10px 10px 10px 0;
	text-align: right;
}
.filters select {
	border: none;
	background-color: #fff;
	font-size: 1.4rem;
}
.filters select:focus {
	outline: none;
}

@media screen and (max-width: 768px) {
	.contents {
		margin-top: 5vh;
		max-height: 90vh;
		width: 90%;
	}
	.main {
		padding: 15px;
	}
	.lists {
		height: calc(90vh - 170px );
	}
}

@font-face {
  font-family: 'icomoon';
  src:  url('https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.eot');
  src:  url('https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.eot?#iefix') format('embedded-opentype'),
    url('https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.ttf') format('truetype'),
    url('https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.woff') format('woff'),
    url('https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.svg#Linearicons-Free') format('svg');
  font-weight: normal;
  font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: 'icomoon' !important;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.icon-checkmark-circle:before {
  content: "\e87f";
}

.icon-pencil:before {
  content: "\e802";
}
.icon-trash:before {
  content: "\e811";
}

              
            
!

JS

              
                var todoListLS = [];
//ローカルストレージ関係
var todoStorage = {
  get: function (todos) {
    todoListLS = JSON.parse(localStorage.getItem('simpleTodo') || '[]');
    return todoListLS;
  },
  save: function (todos) {
    todoListLS = todos;
    localStorage.setItem('simpleTodo', JSON.stringify(todoListLS));
  }
}

new Vue({
  el: '.todoList',
  data: {
    todos: todoStorage.get(),
    newTask: '',
    filterTask: "all"
  },
  watch: {
    todos: {
      handler: function (val) {
        todoStorage.save(val);
      },
      deep: true
    }
  },
  computed: {
    filteredTodos: function () {
      var task = this.todos;
      if(this.filterTask == "all"){
        task = this.todos;
        
      }else if(this.filterTask == "complete"){
        task = this.todos.filter(function(element) {
          return element.check;
        });

      }else if(this.filterTask == "incomplete"){
        task = this.todos.filter(function(element) {
          return !element.check;
        });
      }
      return task;
    }
  },
  methods: {
    addTask: function () {
      if(!this.newTask) return false;
      if(event.keyCode !== 13) return false;
      this.todos.push({
        title: this.newTask,
        check: false
      });
      this.newTask = '';
    },
    editTask: function (todo){
      this.editingTask = todo;
      if (!this.editingTask) {
        return
      }
      this.editingTask = todo;
    },
    deleteTask: function (todo){
      this.todos.splice(this.todos.indexOf(todo), 1);
    }
  }
});

              
            
!
999px

Console