css+js实现iphone手机支持明暗模式切换的待办事项app代码
代码语言:html
所属分类:布局界面
代码描述:css+js实现iphone手机支持明暗模式切换的待办事项app代码,支持拖拽、进度设置、完成设置。
代码标签: css js iphone 手机 支持 明暗 模式 切换 待办 事项 app 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; } body { background-color: #f0f0f0; color: #fff; display: flex; justify-content: center; align-items: center; min-height: 100vh; transition: background-color 0.3s; } body.light-mode { background-color: #f0f0f0; } body.dark-mode { background-color: #121212; } .iphone { width: 375px; height: 812px; background-color: #1c1c1e; border-radius: 40px; overflow: hidden; position: relative; box-shadow: 0 0 0 10px #2c2c2e, 0 0 0 13px #000, 0 20px 50px rgba(0, 0, 0, 0.5); transition: background-color 0.3s, box-shadow 0.3s; } .light-mode .iphone { background-color: #ffffff; box-shadow: 0 0 0 10px #e0e0e0, 0 0 0 13px #bdbdbd, 0 20px 50px rgba(0, 0, 0, 0.2); } .notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 200px; height: 30px; background-color: #000; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; z-index: 1000; } .status-bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 20px; font-size: 14px; background-color: rgba(0, 0, 0, 0.3); transition: background-color 0.3s, color 0.3s; } .light-mode .status-bar { background-color: rgba(255, 255, 255, 0.3); color: #000; } .time { font-weight: bold; } .icons span { margin-left: 5px; } .app-container { height: calc(100% - 30px); overflow-y: auto; padding: 20px; color: #fff; transition: color 0.3s; } .light-mode .app-container { color: #000; } h1 { font-size: 32px; margin-bottom: 20px; font-weight: 700; } #task-form { display: flex; margin-bottom: 20px; } #task-input { flex-grow: 1; padding: 10px; border: none; background-color: #2c2c2e; color: #fff; border-radius: 10px 0 0 10px; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .light-mode #task-input { background-color: #f0f0f0; color: #000; } button { border: none; background-color: #0a84ff; color: #fff; padding: 10px 15px; font-size: 16px; cursor: pointer; transition: background-color 0.3s; } #add-btn { border-radius: 0 10px 10px 0; } #reset-btn { border-radius: 10px; margin-left: 10px; background-color: #ff453a; } button:active { opacity: 0.8; } .task-list { list-style-type: none; } .task-item { background-color: #2c2c2e; border-radius: 10px; margin-bottom: 10px; overflow: hidden; transition: background-color 0.5s; } .completed { background-color: #22222255; color: #8888ff55; } .light-mode .completed { background-color: #0000ff55; color: #44449955; } .light-mode .task-item { background-color: #f0f0f0; } .task-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: #3a3a3c; transition: background-color 0.3s; } .light-mode .task-header { background-color: #e0e0e0; } .task-title { font-weight: 600; font-size: 18px; } .task-actions { display: flex; gap: 10px; } .task-content { padding: 15px; } .task-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .completed .task-label { color: #8888ff55; } .light-mode .completed .task-label { color: #44449955; } .task-label { font-weight: 500; color: #8e8e93; transition: color 0.3s; } .light-mode .task-label { color: #6e6e73; } .progress-container { display: flex; align-items: center; width: 100%; margin-left: 10px; } progress { flex-grow: 1; height: 6px; border-radius: 3px; -webkit-appearance: none; } progress::-webkit-progress-bar { background-color: #48484a; border-radius: 3px; } .light-mode progress::-webkit-progress-bar { background-color: #d1d1d6; } progress::-webkit-progress-value { background-color: #30d158; border-radius: 3px; } .progress-value { margin-left: 10px; font-size: 14px; color: #8e8e93; transition: color 0.3s; } .light-mode .progress-value { color: #6e6e73; } input[type="date"] { background-color: #3a3a3c; border: none; color: #fff; padding: 5px; border-radius: 5px; transition: background-color 0.3s, color 0.3s; } .light-mode input[type="date"] { background-color: #e0e0e0; color: #000; } .completed .task-title { text-decoration: line-through; color: #8888ff55; } .light-mode .completed .task-title { background-color: #e0e0e0; color: #44449950; } .drag-handle { cursor: move; padding: 0 5px; color: #8e8e93; } .light-mode .drag-handle { color: #6e6e73; } #theme-toggle { position: absolute; top: 40px; right: 20px; background: none; border: none; font-size: 24px; cursor: pointer; z-index: 1001; } .delete-btn { background: none; border: none; cursor: pointer; padding: 5px; color: inherit; } .light-mode #theme-toggle { color: #000; } .due-date-row { display: flex; align-items: center; } .due-date-row input[type="checkbox"] { margin-right: 10px; } .due-date-row .task-label { margin-right: 10px; } </style> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css"> </head> <body translate="no"> <div class="iphone"> <div class="notch"></div> <div class="status-bar"> <span class="time">9:41</span> <div class="icons"> <span>📶</span> <span>📊</span> <span>🔋</span> </div> </div> <button id="theme-toggle"><i class="fa-regular fa-moon"></i></button> <div class="app-container"> <h1>Todo List</h1> <form id="task-form"> <input type="text" id="task-input" placeholder="Add a new task".........完整代码请登录后点击上方下载按钮下载查看
网友评论0