9. 作業
待辦事項(To-Do List)
介面
第一步:基本介面及 text 欄位事件
<article class="task_container">
<h1 class="title1">任務管理</h1>
<div class="task_add_block">
<input type="text" class="task_name" placeholder="輸入待辦事項…">
<button type="button" class="task_add">新增</button>
</div>
<div class="task_list_parent">
<ul class="task_list">
</ul>
</div>
</article>/* 基本 CSS */
* {
box-sizing: border-box;
}
html{
font-size: 62.5%;
}
body{
margin: 0;
background: rgb(10,0,36);
background: radial-gradient(circle, rgba(10,0,36,0.1110819327731093) 0%, rgba(9,9,121,0.1110819327731093) 5%, rgba(0,212,255,0.04665616246498594) 100%);
}
article.task_container{
width: 600px;
margin: 50px auto;
border-radius: 5px;
padding: 10px;
box-shadow: 1px 1px 5px gray;
}
h1.title1{
font-size: 2.4rem;
margin: 0 0 10px 0;
}
/* ===== 任務新增 ===== */
div.task_add_block{
font-size: 0;
transition: transform .5s, box-shadow .5s;
}
div.task_add_block.-on{
box-shadow: 0 0 5px gray;
transform: scale(1.01);
transform-origin: center center;
}
div.task_add_block input.task_name{
width: calc(100% - 50px);
border: 1px solid lightgray;
border-radius: 3px 0 0 3px;
height: 40px;
font-size: 2rem;
padding: 5px 10px;
outline: none;
display: inline-block;
vertical-align: top;
}
input.task_name::placeholder{
color: lightgray;
}
div.task_add_block button.task_add{
display: inline-block;
width: 50px;
height: 40px;
vertical-align: top;
border: 1px solid lightgray;
border-left: 0;
background-color: white;
box-shadow: none;
font-size: 1.6rem;
cursor: pointer;
outline: none;
border-radius: 0 3px 3px 0;
}
div.task_add_block button.task_add:active{
box-shadow: 1px 1px 3px lightgray inset, -1px -1px 3px lightgray inset;
background-color: #fcfcfc;
font-size: 1.5rem;
}第二步:新增待辦事項
第三步:移除與清空
第四步:更新待辦事項
第五步:排序
第六步:重要性的星號
資料更新至 localStorage
第一步:新增資料至 localStorage
第二步:從 localStorage 取得資料
第三步:移除 localStorage 裡的資料
第四步:更新 localStorage 中,name 的資料
第五步:更新 localStorage 中的排序
第六步:更新 localStorage 中,star 的資料
繳交期限
繳交方式
參考作法
Last updated