vue3实现暗色周期性待办事项列表代码

代码语言:html

所属分类:布局界面

代码描述:vue3实现暗色周期性待办事项列表代码,支持一次性任务及周期性任务,支持本地持久存储。

代码标签: vue 暗色 周期性 待办 事项 列表 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8" />
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
  />
  <title>今日待办 - Vue CDN 版</title>
  <style>
    :root{
      --bg:#0b1020;
      --bg-2:#0f172a;
      --panel:#111827;
      --panel-2:#0b1220;
      --muted:#94a3b8;
      --text:#e5e7eb;
      --primary:#6366f1;
      --primary-2:#8b5cf6;
      --danger:#ef4444;
      --success:#10b981;
      --warning:#f59e0b;
      --border:#1f2937;
      --chip:#334155;
      --overlay: rgba(2,6,23,.6);
    }
    *{ box-sizing: border-box; }
    html, body { height: 100%; }
    body{
      margin:0;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
      background: radial-gradient(1200px 600px at 10% -10%, rgba(99,102,241,.18), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2));
      color:var(--text);
    }
    .container{
      max-width: 960px;
      margin: 18px auto 100px;
      padding: 0 16px;
    }
    header{
      display:flex;
      align-items:center;
      gap:12px;
      margin-bottom: 10px;
    }
    header h1{
      font-size: 22px;
      margin:0;
      letter-spacing:.3px;
      display:flex;
      align-items:center;
      gap:10px;
    }
    .today{
      margin-left:auto;
      color:var(--muted);
      font-size: 14px;
    }
    .actions{
      display:flex;
      gap:8px;
      margin-left: 8px;
    }

    .panel{
      background: rgba(17, 24, 39, .6);
      backdrop-filter: blur(10px);
      border:1px solid var(--border);
      border-radius: 14px;
      padding: 14px;
      box-shadow: 0 10px 30px rgba(0,0,0,.25);
    }

    .toolbar{
      display:flex;
      align-items:center;
      justify-content: space-between;
      margin-bottom: 10px;
      gap:10px;
    }

    .segmented{
      background: var(--panel-2);
      border:1px solid var(--border);
      padding:4px;
      border-radius: 999px;
      display:inline-flex;
      gap:4px;
    }
    .segmented button{
      border:none;
      background: transparent;
      color: var(--muted);
      padding: 6px 12px;
      border-radius: 999px;
      font-weight:600;
      cursor:pointer;
    }
    .segmented button.active{
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color:white;
      box-shadow: 0 6px 16px rgba(99,102,241,.35);
    }

    .btn{
      border: none;
      border-radius: 10px;
      padding: 10px 14px;
      font-weight: 700;
      cursor: pointer;
      transition: .15s transform, .15s opacity, .15s box-shadow, .15s background;
      display:inline-flex;
      align-items:center;
      gap:8px;
      white-space: nowrap;
      color:var(--text);
      background: transparent;
      border: 1px solid var(--border);
    }
    .btn:hover{ opacity:.95; }
    .btn:active{ transform: translateY(1px); }
    .btn-primary{
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color:white;
      border: none;
      box-shadow: 0 6px 16px rgba(99,102,241,.35);
    }
    .btn-danger{
      background: rgba(239, 68, 68, .14);
      color:#fecaca;
      border: 1px solid rgba(239, 68, 68, .35);
    }
    .btn-success{
      background: rgba(16,185,129,.14);
      color:#bbf7d0;
      border: 1px solid rgba(16,185,129,.35);
    }
    .btn-ghost{ background: transparent; }
    .btn-sm{ padding: 6px 10px; border-radius: 8px; font-size: 13px; }

    .list{ display:flex; flex-direction: column; gap: 8px; }
    .item{
      display:grid;
      grid-template-columns: auto 1fr auto auto;
      align-items:center;
      gap: 12px;
      background: #0b1220;
      border:1px solid var(--border);
      padding: 12px;
      border-radius: 12px;
    }
    @media (max-width:720px){
      .item{ grid-template-columns: auto 1fr auto; }
      .item .meta-tag{ display:none; }
    }
    .title{
      display:flex;
      flex-direction: column;
      gap: 6px;
    }
    .title .name{
      font-weight: 700;
      font-size: 15px;
      letter-spacing:.2px;
    }
    .meta{
      font-size: 12px;
      color: var(--muted);
      display:flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items:center;
    }

    .chip{
      font-size: 12px;
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--chip);
      color: #cbd5e1;
      border: 1px solid var(--border);
    }
    .chip.work{ background: rgba(59,130,246,.15); color:#bfdbfe; border-color: rgba(59,130,246,.3); }
    .chip.study{ background: rgba(16,185,129,.15); color:#bbf7d0; border-color: rgba(16,185,129,.3); }
    .chip.life{ background: rgba(245,158,11,.15); color:#fde68a; border-color: rgba(245,158,11,.3); }
    .chip.gray{ background: rgba(148,163,184,.15); color:#e2e8f0; border-color: rgba(148,163,184,.3); }

    .empty{
      color: var(--muted);
      text-align:center;
      border:1px dashed var(--border);
      border-radius: 12px;
      padding: 18px;
    }

    .section-title{
      margin: 12px 0 8px;
      display:flex;
      align-items:center;
      gap:8px;
      color:#cbd5e1;
      font-weight:700;
    }
    .muted{ color:var(--muted); font-size: 13px; }

    /* Modal */
    .modal-overlay{
      position: fixed;
      inset: 0;
      background: var(--overlay);
      backdrop-filter: blur(4px);
      display:flex;
      align-items: center; /* <<< 此处已修改为 center 实现垂直居中 */
      justify-content: center;
      padding: 16px;
      z-index: 50;
      animation: fadeIn .15s ease-out;
    }
    .modal{
      width: 100%;
      max-width: 760px;
      background: linear-gradient(180deg, rgba(15,23,42,.95), rgba(11,18,32,.98));
      border:1px solid var(--border);
      border-radius: 16px;
      box-shadow: 0 30px 60px rgba(0,0,0,.45);
      display:flex;
      flex-direction: column;
      max-height: 82vh;
      overflow: hidden;
      animation: slideUp .16s ease-out;
    }
    .modal-header{
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      display:flex;
      align-items:center;
      justify-content: space-between;
      gap:10px;
    }
    .modal-title{ font-weight:800; letter-spacing:.2px; }
    .modal-body{
      padding: 14px 16px;
      overflow: auto;
    }
    .modal-footer{
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      display:flex;
      justify-content:flex-end;
      gap:10px;
    }
    @keyframes slideUp { from{ transform: translateY(16px); opacity:.9;} to{ transform: translateY(0); opacity:1;} }
    @keyframes fadeIn { from{ opacity:0;} to{ opacity:1;} }

    .form-grid{
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0