Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Wednesday
Grocery store
Code a todo list
Walk the dog
Pay Netflix
css
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"); *, *::before, *::after { box-sizing: border-box; margin: 0; } body { min-height: 450px; height: 100vh; margin: 0; background: radial-gradient(ellipse farthest-corner at center top, #232526 0%, #414345 100%); color: #fff; font-family: "Nunito", sans-serif; } button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } .todoList { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 320px; height: 500px; background: #171717; border-radius: 10px; box-shadow: 0 7px 30px rgba(62, 9, 11, 0.3); } .cover-img .cover-inner { background: url(https://images.pexels.com/photos/4665064/pexels-photo-4665064.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260); height: 190px; background-size: cover; background-position: 10%; border-top-left-radius: 10px; border-top-right-radius: 10px; position: relative; } .cover-img .cover-inner::after { background: rgba(0, 0, 0, 0.3); content: ""; top: 0; left: 0; position: absolute; width: 100%; height: 100%; border-top-left-radius: 10px; border-top-right-radius: 10px; } .cover-img h3 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: "Nunito", sans-serif; text-transform: uppercase; font-size: 2rem; z-index: 10; color: rgba(255, 255, 255, 0.5); font-weight: 700; } .content { padding: 10px 20px; } .content form { display: flex; justify-content: space-between; margin-bottom: 15px; padding: 0 10px 0 5px; border-bottom: 1px solid #cccccc; } .content form > * { background: transparent; border: none; height: 35px; } .content input[type="text"] { padding: 0 5px; font-weight: 700; font-size: 1.2rem; color: #c7c7c7; outline: none; } .content input-buttons a { text-decoration: none; } .content input-buttons i { margin-top: 5px; font-size: 20px; color: #6c717b; } .content ul .todos { margin-left: 0; padding: 0; letter-spacing: none; height: 220px; overflow: auto; } .align { padding: 0; } .content li { user-select: none; margin-bottom: 10px; display: flex; justify-content: space-between; } .content li i { color: #6c717b; font-size: 15px; cursor: pointer; padding: 5px 10px; } .content input[type="checkbox"] { display: none; } .content input[type="checkbox"] + label { color: #7e7e7e; font-size: 15px; cursor: pointer; position: relative; border-radius: 3px; display: inline-block; padding: 5px 5px 5px 40px; } .content input[type="checkbox"] + label:hover { color: #bebebe; background-color: #3e3e3e; } .content input[type="checkbox"] + label span.check { left: 4px; top: 50%; position: absolute; transform: translatey(-50%); width: 18px; height: 18px; display: block; background: #171717; border-radius: 3px; border: 1px solid #000000; box-shadow: -2px -2px 2px rgba(67, 67, 67, 0.5), inset 2px 2px 4px rgba(0, 0, 0, 0.5), inset -2px -2px 2px rgba(67, 67, 67, 0.3), 2px 2px 4px rgba(0, 0, 0, 0.3); } .content input[type="checkbox"]:checked + label { color: #aeb7c6; text-decoration: line-through; } .content input[type="checkbox"]:checked + label span.check { background-color: transparent; border-color: transparent; box-shadow: none; } .content input[type="checkbox"] + label span.check::after { width: 100%; height: 100%; content: ""; display: block; position: absolute; background-image: url("https://www.freepnglogos.com/uploads/tick-png/check-mark-tick-vector-graphic-21.png"); background-repeat: no-repeat; background-position: center; background-size: 16px 16px; transform: scale(0); transition: transform 300ms cubic-bezier(0.3, 0, 0, 1.5); } .content input[type="checkbox"]:checked + label span.check::after { transform: scale(1); } .content input[type="checkbox"] + label span.check::before { top: 0; left: 0; width: 100%; height: 100%; display: block; content: ""; position: absolute; border-radius: 50%; background: #8798aa; opacity: 0.8; transform: scale(0); } .content input[type="checkbox"]:checked + label span.check::before { opacity: 0; transform: scale(1.3); transition: opacity 300ms cubic-bezier(0.2, 0, 0, 1), transform 400ms cubic-bezier(0.3, 0, 0, 1.4); }
JavaScript
const submitForm = document.querySelector(".add"); const addButton = document.querySelector(".add-todo"); const todoList = document.querySelector(".todos"); const list = document.querySelectorAll(".todos li"); let listLenght = list.lenght; const generateTempalate = (todo) => { const html = `
${todo}
`; todoList.innerHTML += html; }; function addTodos(e) { e.preventDefault(); const todo = submitForm.add.value.trim(); if (todo.length) { listLenght = listLenght + 1; generateTempalate(todo); submitForm.reset(); } } submitForm.addEventListener("submit", addTodos); addButton.addEventListener("click", addTodos); function deleteTodos(e) { if (e.target.classList.contains("delete")) { e.target.parentElement.remove(); } } todoList.addEventListener("click", deleteTodos);
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>待办事项列表-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号