1262 lines
61 KiB
HTML
1262 lines
61 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>ServiceMeow — Daily & Roadmap</title>
|
||
<style>
|
||
:root {
|
||
--bg: #f6f7fb;
|
||
--card: #ffffff;
|
||
--accent: #4a6cf7;
|
||
--accent-soft: #e8edff;
|
||
--text: #1f2430;
|
||
--muted: #7a8195;
|
||
--done: #2ecc71;
|
||
--border: #e3e6ef;
|
||
}
|
||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||
background: var(--bg); color: var(--text);
|
||
}
|
||
.page { max-width: 1760px; margin: 0 auto; padding: 24px 20px 48px; }
|
||
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
|
||
.page-header h1 { font-size: 23px; font-weight: 700; }
|
||
.page-header .date { color: var(--muted); font-size: 14px; margin-top: 3px; }
|
||
.wk-pill {
|
||
display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
|
||
border-radius: 999px; padding: 3px 12px; margin-left: 8px; vertical-align: 3px;
|
||
}
|
||
|
||
.layout { display: grid; grid-template-columns: minmax(380px, 5fr) minmax(440px, 6fr); gap: 20px; align-items: start; }
|
||
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
|
||
|
||
.card {
|
||
background: var(--card); border: 1px solid var(--border); border-radius: 14px;
|
||
padding: 16px 18px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(20,30,60,.05);
|
||
}
|
||
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
|
||
.card .hint { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
|
||
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
|
||
.mini-btn {
|
||
background: none; border: 1px solid var(--border); color: var(--muted);
|
||
padding: 5px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; white-space: nowrap;
|
||
}
|
||
.mini-btn:hover { border-color: #e74c3c; color: #e74c3c; }
|
||
|
||
label.item {
|
||
display: flex; align-items: flex-start; gap: 11px;
|
||
padding: 7px 6px; border-radius: 8px; cursor: pointer;
|
||
font-size: 14px; line-height: 1.4; transition: background .15s;
|
||
}
|
||
label.item:hover { background: var(--accent-soft); }
|
||
label.item input {
|
||
appearance: none; width: 19px; height: 19px; min-width: 19px;
|
||
border: 2px solid #c4c9d9; border-radius: 6px; margin-top: 1px; cursor: pointer;
|
||
display: grid; place-content: center; transition: all .15s;
|
||
}
|
||
label.item input:checked { background: var(--done); border-color: var(--done); }
|
||
label.item input:checked::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; }
|
||
label.item.checked span.txt { text-decoration: line-through; color: var(--muted); }
|
||
.wk-badge {
|
||
font-size: 10.5px; font-weight: 600; color: #5a6478; background: #eef1f8;
|
||
border-radius: 4px; padding: 1px 6px; margin-left: auto; white-space: nowrap; margin-top: 2px;
|
||
}
|
||
button.wk-badge { font-family: inherit; cursor: pointer; border: 1px solid transparent; line-height: 1.7; }
|
||
button.wk-badge:hover { border-color: var(--accent); box-shadow: 0 1px 5px rgba(74,108,247,.25); }
|
||
.bar[draggable] { cursor: grab; }
|
||
.bar[draggable]:active { cursor: grabbing; }
|
||
table.gantt td.task-name[draggable] { cursor: grab; }
|
||
table.gantt td.task-name[draggable]:active { cursor: grabbing; }
|
||
table.gantt td.cell.drop-hi { background: #e8edff; box-shadow: inset 0 0 0 2px var(--accent); }
|
||
.wk-badge.undated { background: #f6f0fa; color: #8a6bb0; }
|
||
.del { background: none; border: none; color: #c4c9d9; cursor: pointer; font-size: 15px; padding: 2px 4px; margin-left: 4px; }
|
||
.del:hover { color: #e74c3c; }
|
||
.carry { background: none; border: none; color: #b0721f; cursor: pointer; font-size: 14px; padding: 2px 4px; margin-left: 2px; opacity: .55; }
|
||
.carry:hover { opacity: 1; }
|
||
.carry-badge { font-size: 10px; font-weight: 600; color: #b0721f; background: #fff3e0; border-radius: 4px; padding: 1px 6px; white-space: nowrap; margin-top: 3px; }
|
||
.carry-back { background: none; border: none; color: #b0721f; cursor: pointer; font-size: 14px; padding: 2px 4px; margin-left: 2px; opacity: .55; }
|
||
.carry-back:hover { opacity: 1; }
|
||
.add-row { display: flex; gap: 8px; margin-top: 8px; }
|
||
.add-row input {
|
||
flex: 1; padding: 9px 12px; border: 1px dashed #c4c9d9; border-radius: 8px;
|
||
font-size: 13.5px; font-family: inherit;
|
||
}
|
||
.add-row button { padding: 9px 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; }
|
||
.add-row button:hover { background: #3a5be0; }
|
||
.empty { color: var(--muted); font-size: 13px; padding: 8px 6px; }
|
||
.subhead { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #4a5266; padding: 10px 6px 4px; }
|
||
.subhead .dot { width: 8px; height: 8px; border-radius: 50%; }
|
||
.subhead .count { font-weight: 500; color: var(--muted); font-size: 10.5px; margin-left: auto; }
|
||
.subhead.tog { cursor: pointer; user-select: none; border-radius: 6px; }
|
||
.subhead.tog:hover { background: #eef1f8; color: var(--accent); }
|
||
.subhead .caret { font-size: 9px; width: 10px; color: var(--muted); flex: none; }
|
||
.mini-btn { border: 1px solid var(--border); background: #fff; color: #4a5266; font-size: 11.5px; padding: 4px 10px; border-radius: 7px; cursor: pointer; margin-left: 6px; }
|
||
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
|
||
.prog { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
|
||
.prog .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
|
||
.prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #7c9bff); width: 0%; transition: width .25s; }
|
||
.prog span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
|
||
|
||
/* ---------- RIGHT: focus + gantt ---------- */
|
||
.focus-card h2.now { color: #e8590c; }
|
||
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
|
||
.chip {
|
||
display: inline-flex; align-items: center; gap: 7px;
|
||
border: 1px solid var(--border); background: #fafbff; border-radius: 10px;
|
||
padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: default;
|
||
}
|
||
.chip .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
|
||
.chip.due { border-color: #f3c18f; background: #fff8ef; font-weight: 600; cursor: pointer; }
|
||
.chip.due:hover { border-color: #e8a95f; box-shadow: 0 1px 5px rgba(180,110,20,.25); }
|
||
.chip.done .chip-name { text-decoration: line-through; color: var(--muted); }
|
||
.chip .done-tag { font-size: 10px; font-weight: 700; color: #1e7b3a; background: #e7f6ec; border-radius: 4px; padding: 1px 6px; }
|
||
.chip .due-tag { font-size: 10px; font-weight: 700; color: #b0721f; background: #ffe9c8; border-radius: 4px; padding: 1px 6px; }
|
||
.chip.upcoming .soon-tag { font-size: 10px; font-weight: 700; color: #5a6478; background: #eef1f8; border-radius: 4px; padding: 1px 6px; }
|
||
.chip.upcoming { cursor: pointer; }
|
||
.chip.upcoming:hover { border-color: var(--accent); box-shadow: 0 1px 5px rgba(74,108,247,.18); }
|
||
.focus-empty { color: var(--muted); font-size: 13px; margin-top: 8px; }
|
||
.flag { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #f0dcb8; background: #fff8ef; color: #7a4d12; border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
|
||
.flag .sw { width: 9px; height: 9px; border-radius: 3px; background: #f59f00; flex: 0 0 auto; }
|
||
.flag-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; background: #fffdf8; }
|
||
.flag-item.resolved { opacity: .55; background: #f7fbf8; }
|
||
.flag-item .f-body { flex: 1; min-width: 0; }
|
||
.flag-item .f-text { font-size: 13.5px; line-height: 1.4; }
|
||
.flag-item .f-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
|
||
.flag-item .f-tag { background: #eef1f8; color: #5a6478; border-radius: 4px; padding: 1px 6px; font-weight: 600; }
|
||
.flag-item .f-date { background: #fff3e0; color: #b0721f; border-radius: 4px; padding: 1px 6px; font-weight: 600; }
|
||
.flag-btn { background: none; border: 1px solid var(--border); cursor: pointer; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
|
||
.flag-btn:hover { border-color: var(--accent); color: var(--accent); }
|
||
.flag-btn.del:hover { border-color: #e74c3c; color: #e74c3c; }
|
||
.flag-add { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 10px; }
|
||
.flag-add .f-desc { grid-column: 1 / -1; width: 100%; padding: 9px 12px; border: 1px dashed #c4c9d9; border-radius: 8px; font-size: 13.5px; font-family: inherit; }
|
||
.flag-add input, .flag-add select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: inherit; color: var(--text); background: #fff; }
|
||
.flag-add button { padding: 8px 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
|
||
.flag-add button:hover { background: #3a5be0; }
|
||
.flag-item .f-body { cursor: pointer; }
|
||
.flag-item .f-body:hover .f-text { color: var(--accent); }
|
||
.flag-item .f-taskcount { background: #eef6ff; color: #3a5be0; border-radius: 4px; padding: 1px 6px; font-weight: 600; }
|
||
.flag { cursor: pointer; }
|
||
.flag:hover { border-color: #f59f00; background: #fff3dd; }
|
||
.fe-tasks { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
|
||
.fe-task { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fffdf8; font-size: 13px; }
|
||
.fe-task input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
|
||
.fe-task .ft-text { flex: 1; min-width: 0; }
|
||
.fe-task .ft-text.done { text-decoration: line-through; opacity: .55; }
|
||
.fe-task .ft-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; flex: 0 0 auto; }
|
||
.fe-task .ft-del:hover { color: #e74c3c; }
|
||
.fe-empty { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
|
||
.fe-add { display: flex; gap: 8px; margin-top: 10px; }
|
||
.fe-add input { flex: 1; padding: 8px 10px; border: 1px dashed #c4c9d9; border-radius: 8px; font-size: 13px; font-family: inherit; }
|
||
.fe-add button { padding: 8px 14px; background: var(--accent); border: none; color: #fff; border-radius: 8px; font-size: 13px; cursor: pointer; }
|
||
.fe-add button:hover { background: #3a5be0; }
|
||
|
||
.gantt-scroll { overflow-x: auto; margin-top: 10px; }
|
||
table.gantt { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
|
||
table.gantt th, table.gantt td { border: 1px solid var(--border); padding: 0; }
|
||
table.gantt th.month { font-weight: 700; font-size: 11.5px; text-align: center; padding: 6px 2px; background: #f2f4fb; color: #3c4356; }
|
||
table.gantt th.corner { background: #f2f4fb; }
|
||
table.gantt th.week { font-weight: 600; color: var(--muted); font-size: 10.5px; text-align: center; padding: 4px 0; }
|
||
table.gantt th.week.now { background: #ffe9c8; color: #b0721f; }
|
||
table.gantt tr.proj-row td { background: #f2f4fb; padding: 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
|
||
table.gantt tr.proj-row td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
|
||
table.gantt td.task-name { padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
|
||
table.gantt td.cell { position: relative; background: #fff; height: 26px; }
|
||
table.gantt td.cell.nowcol { background: #fffaf3; }
|
||
.bar { position: absolute; left: 3px; right: 3px; top: 5px; bottom: 5px; border-radius: 7px; box-shadow: 0 1px 3px rgba(20,30,60,.18); cursor: pointer; }
|
||
.bar:hover { filter: brightness(1.12); }
|
||
.bar.span { left: 0; right: 0; border-radius: 0; box-shadow: none; }
|
||
.bar.span-first { left: 3px; border-radius: 7px 0 0 7px; box-shadow: 0 1px 3px rgba(20,30,60,.18); }
|
||
.bar.span-last { right: 3px; border-radius: 0 7px 7px 0; box-shadow: 0 1px 3px rgba(20,30,60,.18); }
|
||
.bar.ongoing { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 6px, rgba(255,255,255,0) 6px 12px); }
|
||
.wk-badge.inprog { background: #e7f6ec; color: #1e7b3a; border: 1px solid #bfe5cc; }
|
||
.wk-badge.delayed { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
|
||
.chip .delayed-tag { font-size: 10px; font-weight: 700; color: #c0392b; background: #fdecea; border-radius: 4px; padding: 1px 6px; }
|
||
.chip .inprog-tag { font-size: 10px; font-weight: 700; color: #1e7b3a; background: #e7f6ec; border-radius: 4px; padding: 1px 6px; }
|
||
.st-btn { flex: 1; padding: 9px 10px; border: 1px solid var(--border); background: #fff; color: #4a5266; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
|
||
.st-btn:hover { border-color: var(--accent); color: var(--accent); }
|
||
.st-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
|
||
.st-btn.active.done { background: var(--done); border-color: var(--done); color: #fff; }
|
||
.st-btn.active.inprog { background: #2ecc71; border-color: #2ecc71; color: #fff; }
|
||
.st-btn.active.delayed { background: #e74c3c; border-color: #e74c3c; color: #fff; }
|
||
.st-clear { background: none; border: none; color: var(--muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; }
|
||
.st-clear:hover { color: #e74c3c; }
|
||
.bar-note { position: absolute; top: -7px; right: -5px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 1.5px solid #4a6cf7; color: #4a6cf7; font-size: 9px; font-weight: 800; display: grid; place-content: center; line-height: 1; }
|
||
|
||
/* hover tooltip for task notes */
|
||
.note-tip {
|
||
position: fixed; z-index: 60; max-width: 300px; background: #fff; border: 1px solid var(--border);
|
||
border-radius: 10px; box-shadow: 0 8px 28px rgba(10,20,50,.22); padding: 10px 12px;
|
||
pointer-events: none; font-size: 12.5px; line-height: 1.5; color: var(--text);
|
||
}
|
||
.note-tip .nt-head { font-size: 12.5px; margin-bottom: 4px; }
|
||
.note-tip .nt-head span { color: var(--muted); font-weight: 600; }
|
||
.note-tip .nt-note { white-space: pre-wrap; color: #3c4356; }
|
||
.note-tip .nt-none { color: var(--muted); font-style: italic; }
|
||
|
||
.note-ico { font-size: 12px; margin-left: 4px; cursor: pointer; }
|
||
|
||
.zoom-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
|
||
.zoom-btn { border: 1px solid var(--border); background: #fff; color: #4a5266; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
|
||
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
|
||
.zoom-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
|
||
.zoom-label { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
|
||
|
||
/* notes modal */
|
||
.modal-ov { position: fixed; inset: 0; background: rgba(15,20,40,.45); display: grid; place-content: center; z-index: 50; padding: 20px; }
|
||
.modal { background: #fff; border-radius: 14px; width: min(480px, 100%); padding: 18px 20px; box-shadow: 0 10px 40px rgba(10,20,50,.3); }
|
||
.modal h3 { font-size: 15px; margin-bottom: 2px; }
|
||
.modal .m-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
|
||
.modal textarea { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit; }
|
||
.modal .m-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
|
||
.modal .m-actions button { padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: #fff; color: #4a5266; }
|
||
.modal .m-actions button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
||
.modal .m-actions button.danger:hover { border-color: #e74c3c; color: #e74c3c; }
|
||
.modal .m-actions .spacer { flex: 1; }
|
||
.legend { display: flex; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
|
||
.legend span { display: inline-flex; align-items: center; gap: 5px; }
|
||
.legend i { width: 11px; height: 11px; border-radius: 3px; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="page">
|
||
<div class="page-header">
|
||
<div>
|
||
<h1>📋 ServiceMeow — Daily & Roadmap <span class="wk-pill" id="wkPill"></span></h1>
|
||
<div class="date" id="today"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layout">
|
||
|
||
<!-- ================= LEFT ================= -->
|
||
<div>
|
||
|
||
<!-- MY DAILY TASKS (user-managed) -->
|
||
<div class="card">
|
||
<div class="card-head">
|
||
<div>
|
||
<h2>📋 My Daily Tasks</h2>
|
||
<div class="hint">Your tasks for today — resets each day. Didn't get to one? Hover it and hit → to push it to tomorrow.</div>
|
||
</div>
|
||
<button class="mini-btn" onclick="clearDaily()">Clear today</button>
|
||
</div>
|
||
<div id="dailyList"></div>
|
||
<div class="add-row">
|
||
<input type="text" id="dailyInput" placeholder="Add a task for today…"
|
||
onkeydown="if(event.key==='Enter') addDaily()">
|
||
<button onclick="addDaily()">Add</button>
|
||
</div>
|
||
<div id="tomorrowWrap" style="margin-top:6px"></div>
|
||
</div>
|
||
|
||
<!-- ROADMAP IMPACTS / FLAGS -->
|
||
<div class="card">
|
||
<div class="card-head">
|
||
<div>
|
||
<h2>🚩 Impacts & Flags</h2>
|
||
<div class="hint">Things that come up and impact the roadmap or your tasks. 💡 Click a flag to edit it and add the tasks to resolve it. Persists until you resolve/remove it.</div>
|
||
</div>
|
||
</div>
|
||
<div id="flagList"></div>
|
||
<div class="flag-add">
|
||
<input type="text" class="f-desc" id="flagDesc" placeholder="What came up? (impact, blocker, decision, risk…)">
|
||
<select id="flagRel">
|
||
<option value="">Related area (optional)</option>
|
||
</select>
|
||
<input type="date" id="flagDate" title="Date (optional)">
|
||
<button onclick="addFlag()" style="grid-column:1/-1">Add flag</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- ROADMAP TASKS -->
|
||
<div class="card">
|
||
<div class="card-head">
|
||
<div>
|
||
<h2>✅ Roadmap Tasks</h2>
|
||
<div class="hint">Web27 Roadmap (updated) — progress saves in this browser · click a section to expand / collapse · click a week badge to move / update a task</div>
|
||
</div>
|
||
<div>
|
||
<button class="mini-btn" onclick="expandAllSections(false)">Expand all</button>
|
||
<button class="mini-btn" onclick="expandAllSections(true)">Collapse all</button>
|
||
</div>
|
||
</div>
|
||
<div class="prog"><div class="bar"><i id="rbar"></i></div><span id="rlabel"></span></div>
|
||
<div id="todoList"></div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- ================= RIGHT ================= -->
|
||
<div>
|
||
|
||
<!-- FOCUS: what you need to be aware of now -->
|
||
<div class="card focus-card">
|
||
<div class="card-head">
|
||
<div>
|
||
<h2 class="now" id="focusTitle">🎯 Due This Week</h2>
|
||
<div class="hint" id="focusHint"></div>
|
||
<div class="hint" style="margin-top:1px">💡 Click a bubble to mark it in progress / complete / delayed, or move it to a different week</div>
|
||
</div>
|
||
</div>
|
||
<div id="focusChips"></div>
|
||
|
||
<div class="subhead" style="margin-top:14px">🚩 Your flags (open) <span style="font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted);font-size:11px">· click a flag to edit it</span></div>
|
||
<div class="chip-row" id="flagChips"></div>
|
||
|
||
<div class="subhead" style="margin-top:14px">📅 Up Next (following weeks) <span style="font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted);font-size:11px">· click a bubble to update</span></div>
|
||
<div id="upcomingChips"></div>
|
||
</div>
|
||
|
||
<!-- FULL GANTT -->
|
||
<div class="card">
|
||
<div class="card-head">
|
||
<div>
|
||
<h2>🗺️ Roadmap Timeline</h2>
|
||
<div class="hint">WK 1–33 · amber column = current week · 💡 drag a bubble <b>or a task row</b> to another week to move it · click for a note</div>
|
||
</div>
|
||
<div class="zoom-row" id="zoomRow">
|
||
<button class="zoom-btn active" data-view="month" onclick="setGanttView('month', this)">This month</button>
|
||
<button class="zoom-btn" data-view="2mo" onclick="setGanttView('2mo', this)">2 months</button>
|
||
<button class="zoom-btn" data-view="3mo" onclick="setGanttView('3mo', this)">3 months</button>
|
||
<button class="zoom-btn" data-view="full" onclick="setGanttView('full', this)">Full</button>
|
||
<span class="zoom-label" id="zoomLabel"></span>
|
||
</div>
|
||
</div>
|
||
<div class="gantt-scroll" id="gantt"></div>
|
||
<div class="legend" id="legend"></div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- task note modal -->
|
||
<div class="modal-ov" id="noteModal" style="display:none" onclick="if(event.target===this) closeNote()">
|
||
<div class="modal">
|
||
<h3 id="noteTitle"></h3>
|
||
<div class="m-sub" id="noteSub"></div>
|
||
<textarea id="noteText" placeholder="Add a note… (context, blocker, decision, link, owner)"></textarea>
|
||
<div class="m-actions">
|
||
<button class="danger" onclick="deleteNote()">Delete note</button>
|
||
<span class="spacer"></span>
|
||
<button onclick="closeNote()">Cancel</button>
|
||
<button class="primary" onclick="saveNote()">Save note</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- task update modal (due-this-week bubbles) -->
|
||
<div class="modal-ov" id="taskModal" style="display:none" onclick="if(event.target===this) closeTaskUpdate()">
|
||
<div class="modal">
|
||
<h3 id="tuTitle"></h3>
|
||
<div class="m-sub" id="tuSub"></div>
|
||
<div style="display:flex;flex-direction:column;gap:10px;margin-top:6px">
|
||
<div style="display:flex;gap:8px">
|
||
<button id="stInprog" onclick="tuSetStatus('inprog')" class="st-btn">▶ In progress</button>
|
||
<button id="stDone" onclick="tuSetStatus('done')" class="st-btn">✓ Complete</button>
|
||
<button id="stDelayed" onclick="tuSetStatus('delayed')" class="st-btn">⏳ Delayed</button>
|
||
</div>
|
||
<div id="stClearRow" style="display:none"><button class="st-clear" onclick="tuSetStatus(null)">clear status</button></div>
|
||
<div style="display:flex;gap:8px">
|
||
<select id="tuWk" style="flex:1;padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;color:var(--text);background:#fff"></select>
|
||
<button id="tuMoveBtn" onclick="tuMoveWeek()" style="padding:8px 14px;background:var(--accent);border:none;color:#fff;border-radius:8px;font-size:13px;cursor:pointer">Move to…</button>
|
||
</div>
|
||
<div style="font-size:11.5px;color:var(--muted)">Changes apply to the Roadmap Tasks list and the Timeline above, and save in this browser.</div>
|
||
</div>
|
||
<div class="m-actions">
|
||
<span class="spacer"></span>
|
||
<button onclick="closeTaskUpdate()">Close</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- flag edit modal -->
|
||
<div class="modal-ov" id="flagModal" style="display:none" onclick="if(event.target===this) closeFlagEdit()">
|
||
<div class="modal">
|
||
<h3>🚩 Edit flag</h3>
|
||
<div class="m-sub">Update the flag and add the tasks needed to resolve it.</div>
|
||
<textarea id="feText" placeholder="What's this flag about?" style="min-height:70px"></textarea>
|
||
<div style="display:flex;gap:8px;margin-top:10px">
|
||
<select id="feRel" style="flex:1;padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;color:var(--text);background:#fff"></select>
|
||
<input type="date" id="feDate" style="padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit">
|
||
</div>
|
||
<div class="subhead" style="margin-top:14px">🔧 Tasks to resolve <span style="font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted);font-size:11px">· double-click a task to edit it</span></div>
|
||
<div id="feTasks" class="fe-tasks"></div>
|
||
<div class="fe-add">
|
||
<input type="text" id="feTaskInput" placeholder="Add a task to resolve this flag…" onkeydown="if(event.key==='Enter') addFlagTask()">
|
||
<button onclick="addFlagTask()">Add</button>
|
||
</div>
|
||
<div class="m-actions">
|
||
<button class="danger" onclick="deleteFlag()">Remove flag</button>
|
||
<span class="spacer"></span>
|
||
<button onclick="closeFlagEdit()">Cancel</button>
|
||
<button class="primary" onclick="saveFlagEdit()">Save</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- hover tooltip: task note reader -->
|
||
<div id="noteTip" class="note-tip" style="display:none"></div>
|
||
</div>
|
||
|
||
<script>
|
||
/* ================= DATA (from Web Team ServiceMeow(updated).pdf — Web27 Roadmap) ================= */
|
||
const TOTAL_WEEKS = 33;
|
||
|
||
// WK1 starts Monday Sep 22, 2026 (roadmap "9/22 launch")
|
||
const WK1_MONDAY = new Date(2026, 8, 22);
|
||
// Month blocks exactly as printed in the updated roadmap PDF (4-week blocks,
|
||
// WK1 = Sep 22). WK 25–33 are beyond the labeled months in the roadmap.
|
||
const MONTHS = [
|
||
{ name: "September", start: 1, end: 4 },
|
||
{ name: "October", start: 5, end: 8 },
|
||
{ name: "November", start: 9, end: 12 },
|
||
{ name: "December", start: 13, end: 16 },
|
||
{ name: "January", start: 17, end: 20 },
|
||
{ name: "February", start: 21, end: 24 },
|
||
{ name: "TBD", start: 25, end: 33 }
|
||
];
|
||
const monthOf = wk => MONTHS.find(mb => wk >= mb.start && wk <= mb.end);
|
||
|
||
function currentWeek() {
|
||
const t = new Date(); t.setHours(0,0,0,0);
|
||
const diffDays = Math.round((t - WK1_MONDAY) / 86400000);
|
||
const wk = diffDays >= 0 ? Math.floor(diffDays / 7) + 1 : 1;
|
||
return Math.max(1, Math.min(TOTAL_WEEKS, wk));
|
||
}
|
||
const NOW_WK = currentWeek();
|
||
|
||
const DATA = [
|
||
{ project:"New Site Build & SBD", sections:[
|
||
{ name:"Core", color:"#4a6cf7", tasks:[
|
||
["Initial Drupal Environment Setup",1],["Internationalization",3],
|
||
["Migrate Tier 1 Dev Modules",3],["SSO",2]
|
||
]},
|
||
{ name:"Theming", color:"#5b8def", tasks:[["Site Theme",2]]},
|
||
{ name:"Content", color:"#0ca678", tasks:[
|
||
["Text Formats and Editors",4],["Translations",6],
|
||
["Initial Content Creation System Migration",6],["Mega Menu and Header",8],
|
||
["Remaining Content Type Migration",12],["New Content Blocks",10],
|
||
["Custom Content Tools ((Link Replacement, Cloning + Cloning for Translations))",13],
|
||
["myComet Customer Portal",17],["Migrate Views",17]
|
||
]},
|
||
{ name:"Commerce", color:"#e8590c", tasks:[
|
||
["Controller API",1],["Cart",5],["Checkout",10],
|
||
["Share Cart Across Domains",15],["Pricing",17],
|
||
["Bulk Order / Quick Order",18],["Quote Integration",19],
|
||
["Distributor Ordering",20],["Share Cart By Email",21]
|
||
]},
|
||
{ name:"Products", color:"#7048e8", tasks:[
|
||
["Product_index",1],["Basic Search",3],["Probes",5],["Assays",13],
|
||
["Antibodies",14],["Ancillary Products",13],
|
||
["Product Alerts / Ads",16],["Product Documents / 3E SDS",16],
|
||
["Bioz Citations",17],["Citation Hub",18],["Global Document Finder",21],
|
||
["Spectra Viewer",21],["Ancillaries",9]
|
||
]},
|
||
{ name:"Search", color:"#f59f00", tasks:[
|
||
["Polished Search",7],["Search Bar and Redirects",9],
|
||
["Compare Tool",10],["Gene Pages",11],["Custom Probe Request Form",21]
|
||
]},
|
||
{ name:"FSS", color:"#0c8599", tasks:[
|
||
["Meilisearch Development",17],["Initial Module & Service Configuration",18],
|
||
["Integration into Site Search",19],["Styling",20],["SEO",21]
|
||
]},
|
||
{ name:"SEO", color:"#e64980", tasks:[
|
||
["Initial SEO Module Setup",5],["Custom SEO Module Migration",7],
|
||
["Integration with Spoke Site",9],["DataLayer",14],["Live Chat",21],["Baidu",23]
|
||
]}
|
||
]},
|
||
{ project:"Quote Tool", sections:[
|
||
{ name:"Quote Tool", color:"#37b24d", tasks:[
|
||
["Print Quote Btn changes on RndSystems",1],
|
||
["Registration Update for Business Acct.",2],
|
||
["Request Quote Functionality",3],["Redeem Quote",5]
|
||
]}
|
||
]},
|
||
{ project:"JP on Web", sections:[
|
||
{ name:"JP on Web", color:"#1098ad", tasks:[["9/22 launch final pieces",1]]}
|
||
]},
|
||
{ project:"Distributors", sections:[
|
||
{ name:"Distributors", color:"#ae3ec9", tasks:[["Distributors finalization",2]]}
|
||
]},
|
||
{ project:"3E SDS", sections:[
|
||
{ name:"3E SDS", color:"#c2255c", tasks:[
|
||
["Finalize 3E flag update to current process",3],
|
||
["Update Request language form",4],["Styling",5]
|
||
]}
|
||
]},
|
||
{ project:"BDD", sections:[
|
||
{ name:"BDD (planned — not scheduled yet)", color:"#868e96", tasks:[] }
|
||
]}
|
||
];
|
||
|
||
/* ---- due-week overrides (tasks moved around the roadmap) ---- */
|
||
const wKey = "sm-roadmap-wk-v1";
|
||
let wkOverride = {};
|
||
try { wkOverride = JSON.parse(localStorage.getItem(wKey) || "{}"); } catch(e) { wkOverride = {}; }
|
||
function saveWkOverride() { localStorage.setItem(wKey, JSON.stringify(wkOverride)); }
|
||
(function applyWkOverrides() {
|
||
DATA.forEach((p, pi) => p.sections.forEach((s, si) => s.tasks.forEach((t, ti) => {
|
||
const id = pi + "-" + si + "-" + ti;
|
||
if (wkOverride[id] && t[2] !== "ongoing") t[1] = wkOverride[id];
|
||
})));
|
||
})();
|
||
|
||
// flat list of all dated tasks: {id, name, wk, color, section, project}
|
||
const ALL_TASKS = [];
|
||
DATA.forEach((p, pi) => p.sections.forEach((s, si) => s.tasks.forEach(([name, wk, end], ti) =>
|
||
ALL_TASKS.push({ id: pi + "-" + si + "-" + ti, name, wk, ongoing: end === "ongoing", color: s.color, section: s.name, project: p.project }))));
|
||
|
||
// task id map (same ids as the roadmap todo list: pi-si-ti)
|
||
const TASK_MAP = {};
|
||
DATA.forEach((p, pi) => p.sections.forEach((s, si) => s.tasks.forEach(([name, wk, end], ti) => {
|
||
TASK_MAP[pi + "-" + si + "-" + ti] = { name, wk, ongoing: end === "ongoing", section: s.name, project: p.project };
|
||
})));
|
||
|
||
// notes store
|
||
const nKey = "sm-tasknotes-v1";
|
||
let notes = {};
|
||
try { notes = JSON.parse(localStorage.getItem(nKey) || "{}"); } catch(e) { notes = {}; }
|
||
let noteTask = null;
|
||
|
||
/* ================= LEFT: MY DAILY TASKS ================= */
|
||
const todayKey = new Date().toISOString().slice(0, 10);
|
||
const dKey = "sm-mydaily-" + todayKey;
|
||
let daily = JSON.parse(localStorage.getItem(dKey) || "[]");
|
||
|
||
function saveDaily() { localStorage.setItem(dKey, JSON.stringify(daily)); }
|
||
|
||
function renderDaily() {
|
||
const wrap = document.getElementById("dailyList");
|
||
wrap.innerHTML = "";
|
||
if (!daily.length) {
|
||
wrap.innerHTML = '<div class="empty">Nothing yet — add your tasks for today below 👇</div>';
|
||
return;
|
||
}
|
||
daily.forEach((t, i) => {
|
||
const row = document.createElement("label");
|
||
row.className = "item" + (t.done ? " checked" : "");
|
||
const cb = document.createElement("input");
|
||
cb.type = "checkbox"; cb.checked = t.done;
|
||
cb.onchange = () => { t.done = cb.checked; saveDaily(); renderDaily(); };
|
||
const span = document.createElement("span");
|
||
span.className = "txt"; span.textContent = t.text;
|
||
if (t.carried) {
|
||
const b = document.createElement("span");
|
||
b.className = "carry-badge"; b.textContent = "carried over";
|
||
span.appendChild(b);
|
||
}
|
||
const carry = document.createElement("button");
|
||
carry.className = "carry"; carry.textContent = "→";
|
||
carry.title = "Move to tomorrow";
|
||
carry.style.marginLeft = "auto";
|
||
carry.onclick = (e) => { e.preventDefault(); moveDailyTomorrow(i); };
|
||
const del = document.createElement("button");
|
||
del.className = "del"; del.textContent = "✕";
|
||
del.title = "Remove";
|
||
del.onclick = (e) => { e.preventDefault(); daily.splice(i, 1); saveDaily(); renderDaily(); };
|
||
row.append(cb, span, carry, del);
|
||
wrap.appendChild(row);
|
||
});
|
||
}
|
||
function moveDailyTomorrow(i) {
|
||
const t = daily[i];
|
||
const tm = new Date(); tm.setDate(tm.getDate() + 1);
|
||
const k = "sm-mydaily-" + tm.toISOString().slice(0, 10);
|
||
let arr = [];
|
||
try { arr = JSON.parse(localStorage.getItem(k) || "[]"); } catch(e) { arr = []; }
|
||
t.carried = true;
|
||
arr.push(t);
|
||
localStorage.setItem(k, JSON.stringify(arr));
|
||
daily.splice(i, 1);
|
||
saveDaily(); renderDaily(); renderTomorrow();
|
||
}
|
||
|
||
/* -------- Tomorrow view (carried-over tasks) -------- */
|
||
const tmDate = new Date(); tmDate.setDate(tmDate.getDate() + 1);
|
||
const tmLabel = tmDate.toLocaleDateString(undefined, { weekday: "long", month: "short", day: "numeric" });
|
||
const tKey = "sm-mydaily-" + tmDate.toISOString().slice(0, 10);
|
||
let tomorrow = [];
|
||
function loadTomorrow() { try { tomorrow = JSON.parse(localStorage.getItem(tKey) || "[]"); } catch(e) { tomorrow = []; } }
|
||
function saveTomorrow() { localStorage.setItem(tKey, JSON.stringify(tomorrow)); }
|
||
|
||
function renderTomorrow() {
|
||
loadTomorrow();
|
||
const wrap = document.getElementById("tomorrowWrap");
|
||
if (!wrap) return;
|
||
wrap.innerHTML = '';
|
||
const head = document.createElement("div");
|
||
head.className = "subhead";
|
||
head.style.marginTop = "12px";
|
||
head.innerHTML = `🌅 Tomorrow <span style="font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted)">(${tmLabel})</span>`;
|
||
const count = document.createElement("span");
|
||
count.className = "count"; count.textContent = tomorrow.length;
|
||
head.appendChild(count);
|
||
wrap.appendChild(head);
|
||
|
||
if (!tomorrow.length) {
|
||
const em = document.createElement("div");
|
||
em.className = "empty";
|
||
em.textContent = "Nothing carried over yet — use → on a task above to push it here.";
|
||
wrap.appendChild(em);
|
||
return;
|
||
}
|
||
tomorrow.forEach((t, i) => {
|
||
const row = document.createElement("label");
|
||
row.className = "item" + (t.done ? " checked" : "");
|
||
const cb = document.createElement("input");
|
||
cb.type = "checkbox"; cb.checked = t.done;
|
||
cb.onchange = () => { t.done = cb.checked; saveTomorrow(); renderTomorrow(); };
|
||
const span = document.createElement("span");
|
||
span.className = "txt"; span.textContent = t.text;
|
||
const back = document.createElement("button");
|
||
back.className = "carry-back"; back.textContent = "←";
|
||
back.title = "Bring back to today";
|
||
back.style.marginLeft = "auto";
|
||
back.onclick = (e) => {
|
||
e.preventDefault();
|
||
const idx = tomorrow.indexOf(t);
|
||
if (idx !== -1) tomorrow.splice(idx, 1);
|
||
t.carried = false;
|
||
saveTomorrow();
|
||
daily.push(t); saveDaily();
|
||
renderDaily(); renderTomorrow();
|
||
};
|
||
const del = document.createElement("button");
|
||
del.className = "del"; del.textContent = "✕";
|
||
del.title = "Remove";
|
||
del.onclick = (e) => {
|
||
e.preventDefault();
|
||
const idx = tomorrow.indexOf(t);
|
||
if (idx !== -1) tomorrow.splice(idx, 1);
|
||
saveTomorrow(); renderTomorrow();
|
||
};
|
||
row.append(cb, span, back, del);
|
||
wrap.appendChild(row);
|
||
});
|
||
}
|
||
function addDaily() {
|
||
const inp = document.getElementById("dailyInput");
|
||
const text = inp.value.trim();
|
||
if (!text) return;
|
||
daily.push({ text, done: false });
|
||
inp.value = ""; saveDaily(); renderDaily(); inp.focus();
|
||
}
|
||
function clearDaily() {
|
||
if (!daily.length) return;
|
||
if (!confirm("Remove all tasks for today?")) return;
|
||
daily = [];
|
||
saveDaily(); renderDaily();
|
||
}
|
||
// cleanup old days (only remove days strictly before today, so tomorrow's carried-over tasks survive)
|
||
for (const k of Object.keys(localStorage)) {
|
||
const m = k.match(/^sm-mydaily-(\d{4}-\d{2}-\d{2})$/);
|
||
if (m && m[1] < todayKey) localStorage.removeItem(k);
|
||
}
|
||
renderDaily();
|
||
renderTomorrow();
|
||
|
||
/* ================= LEFT: ROADMAP IMPACTS / FLAGS ================= */
|
||
const fKey = "sm-flags-v1";
|
||
let flags = [];
|
||
try { flags = JSON.parse(localStorage.getItem(fKey) || "[]"); } catch(e) { flags = []; }
|
||
function saveFlags() { localStorage.setItem(fKey, JSON.stringify(flags)); }
|
||
|
||
// populate the related-area dropdown with all sections
|
||
(function() {
|
||
const sel = document.getElementById("flagRel");
|
||
const seen = new Set();
|
||
DATA.forEach(p => p.sections.forEach(s => {
|
||
if (seen.has(s.name)) return; seen.add(s.name);
|
||
const o = document.createElement("option");
|
||
o.value = s.name; o.textContent = s.name;
|
||
sel.appendChild(o);
|
||
}));
|
||
})();
|
||
|
||
function renderFlags() {
|
||
const wrap = document.getElementById("flagList");
|
||
wrap.innerHTML = "";
|
||
const open = flags.filter(f => !f.resolved);
|
||
if (!flags.length) {
|
||
wrap.innerHTML = '<div class="empty">No flags yet — add anything that impacts the roadmap or your day 👇</div>';
|
||
} else {
|
||
flags.slice().reverse().forEach(f => {
|
||
const div = document.createElement("div");
|
||
div.className = "flag-item" + (f.resolved ? " resolved" : "");
|
||
const body = document.createElement("div");
|
||
body.className = "f-body";
|
||
body.onclick = () => openFlagEdit(f);
|
||
body.title = "Click to edit / add resolution tasks";
|
||
const txt = document.createElement("div");
|
||
txt.className = "f-text"; txt.textContent = f.text;
|
||
body.appendChild(txt);
|
||
const meta = document.createElement("div");
|
||
meta.className = "f-meta";
|
||
if ((f.tasks || []).length) {
|
||
const doneN = f.tasks.filter(t => t.done).length;
|
||
const tc = document.createElement("span"); tc.className = "f-taskcount";
|
||
tc.textContent = doneN + "/" + f.tasks.length + " tasks";
|
||
meta.appendChild(tc);
|
||
}
|
||
if (f.rel) { const t = document.createElement("span"); t.className = "f-tag"; t.textContent = f.rel; meta.appendChild(t); }
|
||
if (f.date) { const d = document.createElement("span"); d.className = "f-date"; d.textContent = f.date; meta.appendChild(d); }
|
||
meta.appendChild(document.createTextNode("added " + f.added));
|
||
body.appendChild(meta);
|
||
const btns = document.createElement("div");
|
||
const res = document.createElement("button");
|
||
res.className = "flag-btn"; res.textContent = f.resolved ? "Reopen" : "Resolve";
|
||
res.onclick = () => { f.resolved = !f.resolved; saveFlags(); renderFlags(); };
|
||
const del = document.createElement("button");
|
||
del.className = "flag-btn del"; del.textContent = "✕"; del.title = "Remove";
|
||
del.onclick = () => { if (confirm("Remove this flag?")) { flags = flags.filter(x => x !== f); saveFlags(); renderFlags(); } };
|
||
btns.append(res, del);
|
||
div.append(body, btns);
|
||
wrap.appendChild(div);
|
||
});
|
||
}
|
||
// mirror open flags into the right-side focus card
|
||
const chipWrap = document.getElementById("flagChips");
|
||
const openNow = flags.filter(f => !f.resolved);
|
||
chipWrap.innerHTML = openNow.length
|
||
? openNow.map(f => {
|
||
const idx = flags.indexOf(f);
|
||
const doneN = (f.tasks || []).filter(t => t.done).length;
|
||
const tc = f.tasks && f.tasks.length ? ` · ${doneN}/${f.tasks.length}✓` : "";
|
||
return `<span class="flag" title="Click to edit / add resolution tasks" onclick="openFlagEdit(flags[${idx}])"><span class="sw"></span>${f.text.replace(/</g,"<")}${f.rel?" · "+f.rel.replace(/</g,"<"):""}${tc}</span>`;
|
||
}).join("")
|
||
: '<div class="focus-empty">✅ No open flags.</div>';
|
||
}
|
||
|
||
/* ---- flag edit modal: edit flag + resolution tasks ---- */
|
||
let feFlag = null;
|
||
let feTasks = [];
|
||
function openFlagEdit(f) {
|
||
if (!f) return;
|
||
feFlag = f;
|
||
feTasks = (f.tasks || []).map(t => ({ text: t.text, done: !!t.done }));
|
||
document.getElementById("feText").value = f.text;
|
||
document.getElementById("feDate").value = f.date || "";
|
||
const relSel = document.getElementById("feRel");
|
||
relSel.innerHTML = document.getElementById("flagRel").innerHTML;
|
||
relSel.value = f.rel || "";
|
||
document.getElementById("feTaskInput").value = "";
|
||
renderFeTasks();
|
||
document.getElementById("flagModal").style.display = "grid";
|
||
document.getElementById("feText").focus();
|
||
}
|
||
function closeFlagEdit() {
|
||
document.getElementById("flagModal").style.display = "none";
|
||
feFlag = null; feTasks = [];
|
||
}
|
||
function renderFeTasks() {
|
||
const wrap = document.getElementById("feTasks");
|
||
wrap.innerHTML = "";
|
||
if (!feTasks.length) {
|
||
wrap.innerHTML = '<div class="fe-empty">No tasks yet — add the steps needed to resolve this flag.</div>';
|
||
return;
|
||
}
|
||
feTasks.forEach((t, i) => {
|
||
const row = document.createElement("div");
|
||
row.className = "fe-task";
|
||
const cb = document.createElement("input");
|
||
cb.type = "checkbox"; cb.checked = t.done; cb.title = "Mark task done";
|
||
cb.onchange = () => { t.done = cb.checked; renderFeTasks(); };
|
||
const sp = document.createElement("span");
|
||
sp.className = "ft-text" + (t.done ? " done" : "");
|
||
sp.textContent = t.text;
|
||
sp.title = "Double-click to edit";
|
||
sp.ondblclick = () => {
|
||
const v = prompt("Edit task", t.text);
|
||
if (v !== null && v.trim()) { t.text = v.trim(); renderFeTasks(); }
|
||
};
|
||
const del = document.createElement("button");
|
||
del.className = "ft-del"; del.textContent = "✕"; del.title = "Remove task";
|
||
del.onclick = () => { feTasks.splice(i, 1); renderFeTasks(); };
|
||
row.append(cb, sp, del);
|
||
wrap.appendChild(row);
|
||
});
|
||
}
|
||
function addFlagTask() {
|
||
const inp = document.getElementById("feTaskInput");
|
||
const v = inp.value.trim();
|
||
if (!v) return;
|
||
feTasks.push({ text: v, done: false });
|
||
inp.value = "";
|
||
renderFeTasks();
|
||
inp.focus();
|
||
}
|
||
function saveFlagEdit() {
|
||
if (!feFlag) return;
|
||
const txt = document.getElementById("feText").value.trim();
|
||
if (!txt) { alert("Flag text can't be empty."); return; }
|
||
feFlag.text = txt;
|
||
feFlag.rel = document.getElementById("feRel").value;
|
||
feFlag.date = document.getElementById("feDate").value;
|
||
feFlag.tasks = feTasks;
|
||
saveFlags(); renderFlags(); closeFlagEdit();
|
||
}
|
||
function deleteFlag() {
|
||
if (!feFlag) return;
|
||
if (!confirm("Remove this flag?")) return;
|
||
flags = flags.filter(x => x !== feFlag);
|
||
saveFlags(); renderFlags(); closeFlagEdit();
|
||
}
|
||
function addFlag() {
|
||
const desc = document.getElementById("flagDesc").value.trim();
|
||
if (!desc) return;
|
||
flags.push({
|
||
text: desc,
|
||
rel: document.getElementById("flagRel").value,
|
||
date: document.getElementById("flagDate").value,
|
||
added: new Date().toLocaleDateString(undefined, { month: "short", day: "numeric" }),
|
||
resolved: false
|
||
});
|
||
document.getElementById("flagDesc").value = "";
|
||
document.getElementById("flagDate").value = "";
|
||
saveFlags(); renderFlags();
|
||
document.getElementById("flagDesc").focus();
|
||
}
|
||
renderFlags();
|
||
|
||
/* ================= LEFT: ROADMAP TASKS ================= */
|
||
const rKey = "sm-roadmap-done-v1";
|
||
let rdone = {};
|
||
try { rdone = JSON.parse(localStorage.getItem(rKey) || "{}"); } catch(e) { rdone = {}; }
|
||
|
||
/* ---- task status ("inprog" | "delayed" — "done" lives in rdone) ---- */
|
||
const sKey = "sm-taskstatus-v1";
|
||
let tstatus = {};
|
||
try { tstatus = JSON.parse(localStorage.getItem(sKey) || "{}"); } catch(e) { tstatus = {}; }
|
||
function saveTStatus() { localStorage.setItem(sKey, JSON.stringify(tstatus)); }
|
||
function statusOf(id) { if (rdone[id]) return "done"; return tstatus[id] || null; }
|
||
function setStatus(id, st) {
|
||
if (st === "done") { rdone[id] = true; delete tstatus[id]; }
|
||
else { delete rdone[id]; if (st) tstatus[id] = st; else delete tstatus[id]; }
|
||
localStorage.setItem(rKey, JSON.stringify(rdone));
|
||
saveTStatus();
|
||
refreshAll();
|
||
if (tuTask === id) highlightTuStatus();
|
||
}
|
||
|
||
/* collapsible sections */
|
||
const cSecKey = "sm-sec-collapsed-v1";
|
||
function getCollapsed() { try { return JSON.parse(localStorage.getItem(cSecKey) || "{}"); } catch(e) { return {}; } }
|
||
function toggleSection(el, key) {
|
||
const collapsed = getCollapsed();
|
||
collapsed[key] = !collapsed[key];
|
||
localStorage.setItem(cSecKey, JSON.stringify(collapsed));
|
||
const items = document.querySelector('.sec-items[data-sec="' + key + '"]');
|
||
if (items) items.style.display = collapsed[key] ? "none" : "";
|
||
const caret = el.querySelector(".caret");
|
||
if (caret) caret.textContent = collapsed[key] ? "▸" : "▾";
|
||
}
|
||
function expandAllSections(collapse) {
|
||
const collapsed = {};
|
||
if (collapse) {
|
||
DATA.forEach((p, pi) => p.sections.forEach((s, si) => { collapsed[pi + "-" + si] = true; }));
|
||
}
|
||
localStorage.setItem(cSecKey, JSON.stringify(collapsed));
|
||
document.querySelectorAll("#todoList .sec-items").forEach(d => { d.style.display = collapse ? "none" : ""; });
|
||
document.querySelectorAll("#todoList .subhead .caret").forEach(c => { c.textContent = collapse ? "▸" : "▾"; });
|
||
}
|
||
|
||
function renderRoadmapTodos() {
|
||
const wrap = document.getElementById("todoList");
|
||
let collapsed = {};
|
||
try { collapsed = JSON.parse(localStorage.getItem(cSecKey) || "{}"); } catch(e) { collapsed = {}; }
|
||
const html = [];
|
||
let total = 0;
|
||
DATA.forEach((p, pi) => {
|
||
p.sections.forEach((s, si) => {
|
||
const key = pi + "-" + si;
|
||
const isC = !!collapsed[key];
|
||
html.push(`<div class="subhead tog" data-key="${key}" onclick="toggleSection(this, '${key}')"><span class="caret">${isC?"▸":"▾"}</span><span class="dot" style="background:${s.color}"></span>${s.name}<span class="count">${s.tasks.length}</span></div>`);
|
||
html.push(`<div class="sec-items" data-sec="${key}" style="${isC?"display:none;":""}">`);
|
||
s.tasks.forEach(([name, wk, end], ti) => {
|
||
const id = `${pi}-${si}-${ti}`;
|
||
const inprog = end === "ongoing";
|
||
const st = statusOf(id);
|
||
total++;
|
||
let bCls = inprog ? "inprog" : (wk ? "" : "undated");
|
||
let bTxt = inprog ? "in progress" : (wk ? ("WK " + wk) : "TBD");
|
||
if (st === "inprog") { bCls = "inprog"; bTxt = "in progress"; }
|
||
else if (st === "delayed") { bCls = "delayed"; bTxt = "delayed" + (wk ? (" · WK " + wk) : ""); }
|
||
html.push(
|
||
`<label class="item ${rdone[id]?"checked":""}" data-id="${id}">
|
||
<input type="checkbox" ${rdone[id]?"checked":""}>
|
||
<span class="txt">${name}</span>
|
||
<span class="note-ico" data-nid="${id}" onclick="openNote('${id}')" onmousedown="event.preventDefault()" style="display:${notes[id]?"inline":"none"}" title="View / edit note">📝</span>
|
||
<button class="wk-badge ${bCls}" onclick="openTaskUpdate('${id}')" onmousedown="event.preventDefault()" title="Click to set status or move to another week">${bTxt}</button>
|
||
</label>`);
|
||
});
|
||
html.push(`</div>`);
|
||
});
|
||
});
|
||
wrap.innerHTML = html.join("");
|
||
|
||
if (!wrap._chBound) {
|
||
wrap._chBound = true;
|
||
wrap.addEventListener("change", e => {
|
||
if (e.target.type !== "checkbox") return;
|
||
const label = e.target.closest("label.item");
|
||
rdone[label.dataset.id] = e.target.checked;
|
||
if (e.target.checked) delete tstatus[label.dataset.id];
|
||
saveTStatus();
|
||
label.classList.toggle("checked", e.target.checked);
|
||
progress();
|
||
});
|
||
}
|
||
function progress() {
|
||
let d = 0;
|
||
wrap.querySelectorAll("input[type=checkbox]").forEach(cb => { if (cb.checked) d++; });
|
||
document.getElementById("rbar").style.width = (d/total*100) + "%";
|
||
document.getElementById("rlabel").textContent = d + " / " + total + " done";
|
||
localStorage.setItem(rKey, JSON.stringify(rdone));
|
||
}
|
||
progress();
|
||
}
|
||
renderRoadmapTodos();
|
||
|
||
/* ================= RIGHT: FOCUS CHIPS ================= */
|
||
function renderFocus() {
|
||
// weeks of the current week range (Mon-Sun) for display
|
||
const mon = new Date(WK1_MONDAY); mon.setDate(mon.getDate() + (NOW_WK - 1) * 7);
|
||
const sun = new Date(mon); sun.setDate(sun.getDate() + 6);
|
||
const fmt = d => d.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
||
document.getElementById("wkPill").textContent = "WK " + NOW_WK;
|
||
document.getElementById("focusHint").textContent =
|
||
"Week of " + fmt(mon) + " – " + fmt(sun) + " · " + TOTAL_WEEKS + " week roadmap (WK1 = Sep 22)";
|
||
|
||
const due = ALL_TASKS.filter(t => (t.wk === NOW_WK) || t.ongoing).sort((a,b) => a.project.localeCompare(b.project));
|
||
|
||
const dueWrap = document.getElementById("focusChips");
|
||
if (due.length) {
|
||
dueWrap.innerHTML = due.map(t => {
|
||
const st = statusOf(t.id);
|
||
const done = st === "done";
|
||
const tag = done
|
||
? '<span class="done-tag">✓ DONE</span>'
|
||
: st === "delayed" ? '<span class="delayed-tag">⏳ DELAYED</span>'
|
||
: (st === "inprog" || t.ongoing) ? '<span class="inprog-tag">▶ IN PROGRESS</span>'
|
||
: '<span class="due-tag">DUE</span>';
|
||
return `<span class="chip due${done?" done":""}" onclick="openTaskUpdate('${t.id}')" title="Click to set status or move this task">
|
||
<span class="sw" style="background:${t.color}"></span><span class="chip-name">${t.name}</span>${tag}</span>`;
|
||
}).join("");
|
||
} else {
|
||
dueWrap.innerHTML = '<div class="focus-empty">✅ No roadmap tasks due this week.</div>';
|
||
}
|
||
|
||
const up = ALL_TASKS
|
||
.filter(t => t.wk > NOW_WK && t.wk <= NOW_WK + 3)
|
||
.sort((a,b) => a.wk - b.wk);
|
||
const upWrap = document.getElementById("upcomingChips");
|
||
if (up.length) {
|
||
upWrap.innerHTML = up.map(t => {
|
||
const st = statusOf(t.id);
|
||
const done = st === "done";
|
||
const tag = done
|
||
? '<span class="done-tag">✓ DONE</span>'
|
||
: st === "delayed" ? `<span class="delayed-tag">⏳ DELAYED · WK ${t.wk}</span>`
|
||
: st === "inprog" ? `<span class="inprog-tag">▶ IN PROGRESS · WK ${t.wk}</span>`
|
||
: `<span class="soon-tag">WK ${t.wk}</span>`;
|
||
return `<span class="chip upcoming${done?" done":""}" onclick="openTaskUpdate('${t.id}')" title="Click to set status or move this task">
|
||
<span class="sw" style="background:${t.color}"></span><span class="chip-name">${t.name}</span>${tag}</span>`;
|
||
}).join("");
|
||
} else {
|
||
upWrap.innerHTML = '<div class="focus-empty">Nothing scheduled in the next 3 weeks.</div>';
|
||
}
|
||
}
|
||
renderFocus();
|
||
|
||
/* -------- Due-this-week bubble: mark done / move week -------- */
|
||
let tuTask = null;
|
||
function openTaskUpdate(id) {
|
||
const t = TASK_MAP[id]; if (!t) return;
|
||
tuTask = id;
|
||
document.getElementById("tuTitle").textContent = t.name;
|
||
document.getElementById("tuSub").textContent =
|
||
t.project + " · " + t.section + " · currently " + (t.ongoing ? ("in progress since WK " + t.wk) : ("due WK " + t.wk));
|
||
highlightTuStatus();
|
||
const sel = document.getElementById("tuWk");
|
||
sel.innerHTML = "";
|
||
for (let w = 1; w <= TOTAL_WEEKS; w++) {
|
||
const o = document.createElement("option");
|
||
o.value = w; o.textContent = "WK " + w;
|
||
sel.appendChild(o);
|
||
}
|
||
sel.value = t.wk;
|
||
sel.disabled = !!t.ongoing;
|
||
document.getElementById("tuMoveBtn").disabled = !!t.ongoing;
|
||
document.getElementById("tuMoveBtn").title = t.ongoing ? "In-progress tasks can't be moved" : "Move this task to the selected week";
|
||
const inprogBtn = document.getElementById("stInprog");
|
||
inprogBtn.disabled = !!t.ongoing;
|
||
inprogBtn.title = t.ongoing ? "Already marked in progress" : "Mark as in progress";
|
||
document.getElementById("taskModal").style.display = "grid";
|
||
}
|
||
function highlightTuStatus() {
|
||
if (!tuTask) return;
|
||
const st = statusOf(tuTask);
|
||
const map = { inprog: "stInprog", done: "stDone", delayed: "stDelayed" };
|
||
["stInprog", "stDone", "stDelayed"].forEach(bid => {
|
||
const b = document.getElementById(bid);
|
||
b.classList.remove("active", "done", "inprog", "delayed");
|
||
if (st && map[st] === bid) b.classList.add("active", st);
|
||
});
|
||
document.getElementById("stClearRow").style.display = st ? "" : "none";
|
||
}
|
||
function closeTaskUpdate() {
|
||
tuTask = null;
|
||
document.getElementById("taskModal").style.display = "none";
|
||
}
|
||
function tuSetStatus(st) {
|
||
if (!tuTask) return;
|
||
setStatus(tuTask, st);
|
||
}
|
||
function tuMoveWeek() {
|
||
if (!tuTask) return;
|
||
const wk = parseInt(document.getElementById("tuWk").value, 10);
|
||
closeTaskUpdate();
|
||
moveTaskToWeek(tuTask, wk);
|
||
}
|
||
|
||
// shared "move task to week" — used by the update modal AND Gantt drag & drop
|
||
function moveTaskToWeek(id, wk) {
|
||
const t = TASK_MAP[id]; if (!t) return;
|
||
if (t.ongoing || !wk || wk === t.wk) return;
|
||
const parts = id.split("-").map(Number);
|
||
DATA[parts[0]].sections[parts[1]].tasks[parts[2]][1] = wk;
|
||
t.wk = wk;
|
||
const at = ALL_TASKS.find(x => x.id === id); if (at) at.wk = wk;
|
||
wkOverride[id] = wk; saveWkOverride();
|
||
refreshAll();
|
||
}
|
||
function refreshAll() {
|
||
renderRoadmapTodos();
|
||
renderFocus();
|
||
renderGantt();
|
||
}
|
||
|
||
/* ================= RIGHT: GANTT (zoomable) + TASK NOTES ================= */
|
||
const esc = s => String(s).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'");
|
||
|
||
|
||
|
||
function openNote(id) {
|
||
const t = TASK_MAP[id]; if (!t) return;
|
||
noteTask = id;
|
||
document.getElementById("noteTitle").textContent = t.name;
|
||
document.getElementById("noteSub").textContent =
|
||
t.project + " · " + t.section + " · " + (t.ongoing ? ("WK " + t.wk + " · in progress") : (t.wk ? ("WK " + t.wk) : "unscheduled"));
|
||
document.getElementById("noteText").value = notes[id] || "";
|
||
document.getElementById("noteModal").style.display = "grid";
|
||
document.getElementById("noteText").focus();
|
||
}
|
||
function closeNote() {
|
||
noteTask = null;
|
||
document.getElementById("noteModal").style.display = "none";
|
||
}
|
||
function saveNote() {
|
||
if (!noteTask) return;
|
||
const v = document.getElementById("noteText").value.trim();
|
||
if (v) notes[noteTask] = v; else delete notes[noteTask];
|
||
localStorage.setItem(nKey, JSON.stringify(notes));
|
||
closeNote(); refreshNoteIcons();
|
||
}
|
||
function deleteNote() {
|
||
if (!noteTask) return;
|
||
if (!confirm("Delete the note for this task?")) return;
|
||
delete notes[noteTask];
|
||
localStorage.setItem(nKey, JSON.stringify(notes));
|
||
closeNote(); refreshNoteIcons();
|
||
}
|
||
function refreshNoteIcons() {
|
||
renderGantt();
|
||
document.querySelectorAll("#todoList .note-ico").forEach(el => {
|
||
el.style.display = notes[el.dataset.nid] ? "inline" : "none";
|
||
});
|
||
}
|
||
|
||
// bar click → open note (delegated)
|
||
document.getElementById("gantt").addEventListener("click", e => {
|
||
const bar = e.target.closest(".bar");
|
||
if (bar && bar.dataset.task) openNote(bar.dataset.task);
|
||
});
|
||
|
||
// drag & drop → move a task to the week it's dropped on (delegated)
|
||
const ganttEl = document.getElementById("gantt");
|
||
const clearDropHi = () => ganttEl.querySelectorAll("td.cell.drop-hi").forEach(x => x.classList.remove("drop-hi"));
|
||
ganttEl.addEventListener("dragstart", e => {
|
||
const src = e.target.closest("[draggable][data-task]");
|
||
if (!src || src.classList.contains("ongoing")) { e.preventDefault(); return; }
|
||
hideNoteTip();
|
||
e.dataTransfer.setData("text/task", src.dataset.task);
|
||
e.dataTransfer.effectAllowed = "move";
|
||
});
|
||
ganttEl.addEventListener("dragover", e => {
|
||
const td = e.target.closest("td.cell[data-wk]");
|
||
if (!td) return;
|
||
e.preventDefault();
|
||
e.dataTransfer.dropEffect = "move";
|
||
clearDropHi();
|
||
td.classList.add("drop-hi");
|
||
});
|
||
ganttEl.addEventListener("dragleave", e => {
|
||
const td = e.target.closest("td.cell"); if (td) td.classList.remove("drop-hi");
|
||
});
|
||
ganttEl.addEventListener("drop", e => {
|
||
const td = e.target.closest("td.cell[data-wk]");
|
||
if (!td) return;
|
||
e.preventDefault();
|
||
clearDropHi();
|
||
const id = e.dataTransfer.getData("text/task");
|
||
if (id) moveTaskToWeek(id, parseInt(td.dataset.wk, 10));
|
||
});
|
||
ganttEl.addEventListener("dragend", clearDropHi);
|
||
|
||
// hover tooltip → read a task's note instantly (delegated)
|
||
const noteTip = document.getElementById("noteTip");
|
||
function hideNoteTip() { if (noteTip) noteTip.style.display = "none"; }
|
||
function showNoteTip(taskId, anchor) {
|
||
const t = TASK_MAP[taskId]; if (!t) return;
|
||
const st = statusOf(taskId);
|
||
const stTxt = st === "delayed" ? "DELAYED" : (st === "inprog" ? "in progress" : (st === "done" ? "complete" : null));
|
||
const wkTxt = t.ongoing ? "in progress" : ("WK " + t.wk);
|
||
noteTip.textContent = "";
|
||
const head = document.createElement("div");
|
||
head.className = "nt-head";
|
||
const b = document.createElement("b"); b.textContent = t.name;
|
||
const sub = document.createElement("span");
|
||
sub.textContent = " · " + wkTxt + (stTxt ? " · " + stTxt : "") + " · " + t.project + " / " + t.section;
|
||
head.appendChild(b); head.appendChild(sub);
|
||
noteTip.appendChild(head);
|
||
const body = document.createElement("div");
|
||
const note = notes[taskId];
|
||
body.className = note ? "nt-note" : "nt-note nt-none";
|
||
body.textContent = note || "No note yet — click the task to add one.";
|
||
noteTip.appendChild(body);
|
||
noteTip.style.display = "block";
|
||
const r = anchor.getBoundingClientRect();
|
||
const tw = noteTip.offsetWidth, th = noteTip.offsetHeight;
|
||
const left = Math.min(Math.max(8, r.left + r.width / 2 - tw / 2), (window.innerWidth || 1024) - tw - 8);
|
||
let top = r.top - th - 8;
|
||
if (top < 8) top = r.bottom + 8;
|
||
noteTip.style.left = left + "px";
|
||
noteTip.style.top = top + "px";
|
||
}
|
||
ganttEl.addEventListener("mouseover", e => {
|
||
const src = e.target.closest("[data-task]");
|
||
if (src && src.dataset.task) showNoteTip(src.dataset.task, src);
|
||
else hideNoteTip();
|
||
});
|
||
ganttEl.addEventListener("mouseleave", hideNoteTip);
|
||
window.addEventListener("scroll", hideNoteTip, true);
|
||
window.addEventListener("resize", hideNoteTip);
|
||
|
||
// zoomable view state (defaults to the current month)
|
||
const viewRange = k => {
|
||
const cur = monthOf(NOW_WK);
|
||
const idx = MONTHS.indexOf(cur);
|
||
const last = MONTHS[Math.min(idx + k - 1, MONTHS.length - 1)];
|
||
return { start: cur.start, len: last.end - cur.start + 1 };
|
||
};
|
||
let gView = viewRange(1);
|
||
|
||
function setGanttView(v, btn) {
|
||
if (v === "month") gView = viewRange(1);
|
||
else if (v === "2mo") gView = viewRange(2);
|
||
else if (v === "3mo") gView = viewRange(3);
|
||
else gView = { start: 1, len: TOTAL_WEEKS };
|
||
document.querySelectorAll(".zoom-btn[data-view]").forEach(b => b.classList.toggle("active", b === btn));
|
||
renderGantt();
|
||
}
|
||
function navGantt(dir) {
|
||
const step = gView.len;
|
||
gView.start = Math.max(1, Math.min(TOTAL_WEEKS - gView.len + 1, gView.start + dir * step));
|
||
renderGantt();
|
||
}
|
||
|
||
function renderGantt() {
|
||
const s = Math.max(1, Math.min(TOTAL_WEEKS, gView.start));
|
||
const e = Math.min(TOTAL_WEEKS, s + gView.len - 1);
|
||
const n = e - s + 1;
|
||
const colw = n <= 4 ? "84px" : (n <= 8 ? "56px" : (n <= 12 ? "42px" : ""));
|
||
|
||
let cols = "";
|
||
for (let i = 0; i < n; i++) cols += colw ? `<col style='width:${colw}'>` : "<col>";
|
||
|
||
let html = "<table class='gantt'><colgroup><col style='width:215px'>" + cols + "</colgroup>";
|
||
|
||
// month header (only visible months, partial colspan)
|
||
html += "<tr><th class='corner'></th>";
|
||
MONTHS.forEach(mb => {
|
||
const os = Math.max(s, mb.start), oe = Math.min(e, mb.end);
|
||
if (os <= oe) html += `<th class='month' colspan="${oe - os + 1}">${mb.name}</th>`;
|
||
});
|
||
html += "</tr>";
|
||
|
||
// week header
|
||
html += "<tr><th class='corner' style='font-size:10.5px;color:var(--muted)'>Task</th>";
|
||
for (let w = s; w <= e; w++)
|
||
html += `<th class='week${w===NOW_WK?" now":""}'>W${w}${w===NOW_WK?" ◀":""}</th>`;
|
||
html += "</tr>";
|
||
|
||
DATA.forEach((p, pi) => {
|
||
html += `<tr class='proj-row'><td colspan="${n+1}"><span class='dot' style='background:${p.sections[0].color}'></span>${p.project}</td></tr>`;
|
||
if (!p.sections.some(sec => sec.tasks.length)) {
|
||
html += `<tr><td colspan="${n+1}" style="padding:3px 10px 8px 26px;font-size:11px;color:var(--muted);font-style:italic">no tasks scheduled yet</td></tr>`;
|
||
}
|
||
p.sections.forEach((sec, si) => {
|
||
sec.tasks.forEach(([name, wk, end], ti) => {
|
||
const id = pi + "-" + si + "-" + ti;
|
||
const ongoing = end === "ongoing";
|
||
const st = statusOf(id);
|
||
const spanEnd = ongoing ? NOW_WK : null;
|
||
const hasNote = !!notes[id];
|
||
const noteBadge = hasNote ? "<span class='bar-note'>✎</span>" : "";
|
||
const stTip = st === "delayed" ? " — DELAYED" : (st === "inprog" ? " — in progress" : (st === "done" ? " — complete" : ""));
|
||
const tip = ongoing ? (" — in progress since WK " + wk) : (wk ? (" — WK " + wk) : " (unscheduled)") + stTip;
|
||
const stMark = st === "delayed" ? " ⏳" : (st === "inprog" && !ongoing ? " ▶" : "");
|
||
html += `<tr><td class='task-name'${ongoing ? "" : " draggable='true' data-task='" + id + "'"}>${esc(name)}${ongoing ? " ▶" : ""}${stMark}${hasNote ? " 📝" : ""}</td>`;
|
||
for (let w = s; w <= e; w++) {
|
||
const cellCls = `cell${w===NOW_WK?" nowcol":""}`;
|
||
if (ongoing && w >= wk && w <= spanEnd) {
|
||
const cls = "bar ongoing" + (w === wk ? " span-first" : (w === spanEnd ? " span-last" : " span"));
|
||
html += `<td class='${cellCls}' data-wk='${w}'><div class='${cls}' data-task='${id}' style='background:${sec.color}'>${noteBadge}</div></td>`;
|
||
} else if (!ongoing && wk === w) {
|
||
html += `<td class='${cellCls}' data-wk='${w}'><div class='bar' data-task='${id}' draggable='true' style='background:${sec.color}'>${noteBadge}</div></td>`;
|
||
} else {
|
||
html += `<td class='${cellCls}' data-wk='${w}'></td>`;
|
||
}
|
||
}
|
||
html += "</tr>";
|
||
});
|
||
});
|
||
});
|
||
html += "</table>";
|
||
document.getElementById("gantt").innerHTML = html;
|
||
|
||
const zl = document.getElementById("zoomLabel");
|
||
if (zl) zl.textContent = "WK " + s + " – WK " + e;
|
||
|
||
const seen = new Set();
|
||
let leg = "";
|
||
DATA.forEach(p => p.sections.forEach(sec => {
|
||
if (seen.has(sec.name)) return; seen.add(sec.name);
|
||
leg += `<span><i style="background:${sec.color}"></i>${sec.name}</span>`;
|
||
}));
|
||
leg += `<span style="margin-left:auto"><i style="background:#ffe9c8"></i>current week</span>`;
|
||
leg += `<span>📝 = has note · click any bar to add / edit</span>`;
|
||
document.getElementById("legend").innerHTML = leg;
|
||
}
|
||
renderGantt();
|
||
|
||
|
||
document.getElementById("today").textContent =
|
||
new Date().toLocaleDateString(undefined, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
|
||
</script>
|
||
</body>
|
||
</html>
|