5. Final Capstone Project

Capstone Project: Interactive Study Planner

Build a complete, responsive HTML + CSS + JavaScript Study Planner app that adds tasks, toggles completion, filters items, and persists data in localStorage.

5 min readUpdated 2026-11-29
In This Lesson
  • Combine semantic HTML, responsive CSS, and JavaScript in one complete app
  • Add, toggle, and delete study tasks dynamically in the DOM
  • Persist user tasks across page reloads with localStorage

Let's combine semantic HTML, responsive CSS, DOM events, and localStorage into one complete, single-file web application you can test live in your browser right now—and save locally as planner.html.

1. Test the Interactive Study Planner Live

Try adding study tasks, clicking any task to toggle completion, and deleting items inside the live preview below:

HTML / CSS / JSLive Capstone: Interactive Study Planner
Live Browser Preview
Sandboxed Preview vs Local File

The live preview uses a try/catch storage fallback because sandboxed browser iframes restrict localStorage. When you save planner.html locally on your computer and open it in Chrome/Firefox, localStorage persists tasks across refreshes automatically!

2. Full Local File (planner.html)

Save this code as planner.html and open it in your browser:

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Yadav Academy — Study Planner</title>
    <style>
      * { box-sizing: border-box; }
      body {
        margin: 0;
        font-family: system-ui, -apple-system, sans-serif;
        background: #f8fafc;
        color: #0f172a;
        padding: 24px 16px;
      }
      .app {
        max-width: 560px;
        margin: 0 auto;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 24px;
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
      }
      h1 { margin: 0 0 6px; font-size: 1.5rem; }
      .sub { margin: 0 0 20px; color: #475569; font-size: 0.9rem; }
      form { display: flex; gap: 8px; flex-wrap: wrap; }
      input {
        flex: 1 1 220px;
        padding: 10px 12px;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        font-size: 1rem;
      }
      button {
        padding: 10px 16px;
        border: none;
        border-radius: 10px;
        background: #4f46e5;
        color: white;
        font-weight: 600;
        cursor: pointer;
      }
      ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
      li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
      }
      .done { text-decoration: line-through; color: #94a3b8; }
      .del { background: #ef4444; padding: 6px 10px; font-size: 0.8rem; }
    </style>
  </head>
  <body>
    <main class="app">
      <h1>Daily Study Planner</h1>
      <p class="sub" id="summary">0 tasks completed</p>

      <form id="planner-form">
        <input id="task-input" type="text" placeholder="e.g. Finish SQL Lesson 3" required />
        <button type="submit">Add Task</button>
      </form>

      <ul id="task-list"></ul>
    </main>

    <script>
      const STORAGE_KEY = "yadav-study-planner";
      const form = document.querySelector("#planner-form");
      const input = document.querySelector("#task-input");
      const list = document.querySelector("#task-list");
      const summary = document.querySelector("#summary");

      let tasks = JSON.parse(localStorage.getItem(STORAGE_KEY) || "[]");

      function saveAndRender() {
        localStorage.setItem(STORAGE_KEY, JSON.stringify(tasks));
        const doneCount = tasks.filter((t) => t.done).length;
        summary.textContent = `${doneCount} of ${tasks.length} tasks completed`;

        list.innerHTML = "";
        tasks.forEach((task, index) => {
          const li = document.createElement("li");

          const label = document.createElement("span");
          label.textContent = task.text;
          label.style.cursor = "pointer";
          if (task.done) label.classList.add("done");
          label.addEventListener("click", () => {
            tasks[index].done = !tasks[index].done;
            saveAndRender();
          });

          const delBtn = document.createElement("button");
          delBtn.textContent = "Delete";
          delBtn.className = "del";
          delBtn.type = "button";
          delBtn.addEventListener("click", () => {
            tasks.splice(index, 1);
            saveAndRender();
          });

          li.append(label, delBtn);
          list.appendChild(li);
        });
      }

      form.addEventListener("submit", (e) => {
        e.preventDefault();
        const text = input.value.trim();
        if (!text) return;
        tasks.push({ text, done: false });
        input.value = "";
        saveAndRender();
      });

      saveAndRender();
    </script>
  </body>
</html>

Capstone Upgrades to Try

0/4 done

Congratulations on completing Web Development Foundations!