Garden build — baseline and delivery-delay scenarios with a fixed planting date
HTML for this example
Select the code and use your copy shortcut. Changes in this preview are temporary.
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Garden build — dependency review</title><style>*{box-sizing:border-box}body{margin:0;color:#24303b;font:16px/1.6 Arial,sans-serif}main{max-width:1000px;padding:24px;margin:auto}h1{font-size:25px;line-height:1.25;margin:0 0 10px}h2{font-size:20px;line-height:1.3;margin:0 0 12px}p{margin:0 0 14px}button,input{font:inherit}button{cursor:pointer;min-height:44px;padding:8px 12px;border:1px solid #6a7780;border-radius:4px;background:#fff;color:#24303b}button:focus-visible,input:focus-visible{outline:3px solid #345978;outline-offset:3px}[hidden]{display:none!important}button[aria-pressed=true]{background:#243d53;color:white}.small{font-size:13px}.muted{color:#51606c}.controls{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.label{font-size:12px;font-weight:bold;letter-spacing:.8px;text-transform:uppercase}mark{background:#d5f525;color:#24303b} @media(max-width:560px){main{padding:16px}h1{font-size:23px}h2{font-size:19px}}body{background:#f0f4f3;color:#293d37}.summary{border-left:4px solid #537366;background:white;padding:14px 18px;margin:16px 0}.weekhead,.task{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px}.weekhead{margin-top:22px}.weeks{display:grid;grid-template-columns:repeat(6,1fr);font-size:12px;text-align:center}.task{padding:16px 0;border-bottom:1px solid #b8c8c1}.task h2{font-size:17px;margin-bottom:6px}.meta{font-size:13px}.dates{font-size:14px;font-weight:bold;margin:6px 0}.track{position:relative;align-self:center;height:34px;background:repeating-linear-gradient(90deg,#dde6e1 0,#dde6e1 calc(16.666% - 1px),#bccac3 calc(16.666% - 1px),#bccac3 16.666%)}.bar{position:absolute;top:6px;height:22px;background:#557c6b;min-width:4px}.fixed{padding:16px 0;border-bottom:2px solid #537366}.fixed b{font-size:17px}.legend{font-size:13px;margin-top:18px}@media(max-width:600px){.weekhead,.track{display:none}.task{display:block;background:white;padding:16px;margin:12px 0;border:1px solid #c2d0c9;border-radius:5px}.meta{font-size:14px}}</style></head><body><main><p class="small muted">Fictional garden, owners and dates · calendar-day comparisons</p><h1>What moves if the lumber arrives late?</h1><p><b>Fixed planting day:</b> April 17, 2027. All task dates are illustrative.</p><div class="controls" role="group" aria-label="Delivery-delay scenarios"><button data-delay="0" aria-pressed="true">Baseline</button><button data-delay="7" aria-pressed="false">Delivery +7 days</button><button data-delay="14" aria-pressed="false">Delivery +14 days</button></div><div class="summary" role="status" id="result">Water check: April 8 · 9 calendar days before planting.</div><div class="fixed"><b>◇ Lumber delivery:</b> <span id="delivery">March 22, 2027</span><br><span class="small">Milestone assumed for this plan; not a confirmed supplier booking.</span></div><div class="weekhead"><span class="label">Task and dependency</span><div class="weeks"><span>Mar 22</span><span>Mar 29</span><span>Apr 5</span><span>Apr 12</span><span>Apr 19</span><span>Apr 26</span></div></div><section class="task" data-task="build"><div><h2>Build the beds</h2><div class="meta">Owner: Priya · Planned<br>Starts after: Lumber delivery</div><div class="dates" id="dates-build"></div></div><div class="track" aria-hidden="true"><div class="bar" id="bar-build"></div></div></section><section class="task" data-task="fill"><div><h2>Fill the beds</h2><div class="meta">Owner: Luis · Planned<br>Starts after: Build the beds</div><div class="dates" id="dates-fill"></div></div><div class="track" aria-hidden="true"><div class="bar" id="bar-fill"></div></div></section><section class="task" data-task="irrigation"><div><h2>Install irrigation</h2><div class="meta">Owner: Sam · Planned<br>Starts after: Build the beds</div><div class="dates" id="dates-irrigation"></div></div><div class="track" aria-hidden="true"><div class="bar" id="bar-irrigation"></div></div></section><section class="task" data-task="check"><div><h2>Check water coverage</h2><div class="meta">Owner: Priya · Planned<br>Starts after: Fill the beds + Install irrigation</div><div class="dates" id="dates-check"></div></div><div class="track" aria-hidden="true"><div class="bar" id="bar-check"></div></div></section><div class="fixed"><b>◇ Planting day: April 17, 2027</b><br><span class="small">Fixed target; comparison buttons do not move or approve it.</span></div><p class="legend">Bars show inclusive calendar dates. Filling and irrigation can run in parallel after the beds are built. The water check waits for both. Last updated: October 13, 2026.</p></main><script>const tasks=[{"id":"build","name":"Build the beds","owner":"Priya","start":"2027-03-23","end":"2027-04-02","after":"Lumber delivery"},{"id":"fill","name":"Fill the beds","owner":"Luis","start":"2027-04-03","end":"2027-04-06","after":"Build the beds"},{"id":"irrigation","name":"Install irrigation","owner":"Sam","start":"2027-04-03","end":"2027-04-07","after":"Build the beds"},{"id":"check","name":"Check water coverage","owner":"Priya","start":"2027-04-08","end":"2027-04-08","after":"Fill the beds + Install irrigation"}];const day=86400000;const anchor=Date.UTC(2027,2,22);const target=Date.UTC(2027,3,17);const parse=s=>Date.parse(s+'T00:00:00Z');const label=t=>new Date(t).toLocaleDateString('en-US',{month:'short',day:'numeric',timeZone:'UTC'});function render(delay){document.getElementById('delivery').textContent=label(anchor+delay*day)+', 2027';tasks.forEach(t=>{const start=parse(t.start)+delay*day,end=parse(t.end)+delay*day;document.getElementById('dates-'+t.id).textContent=label(start)+' – '+label(end)+', 2027';const bar=document.getElementById('bar-'+t.id);bar.style.left=((start-anchor)/day/42*100)+'%';bar.style.width=(((end-start)/day+1)/42*100)+'%';});const finish=parse('2027-04-08')+delay*day;const gap=(target-finish)/day;document.getElementById('result').textContent='Water check: '+label(finish)+' · '+(gap>=0?gap+' calendar days before planting.':'Misses fixed planting day by '+(-gap)+' calendar days.');document.querySelectorAll('[data-delay]').forEach(b=>b.setAttribute('aria-pressed',String(Number(b.dataset.delay)===delay)));}document.querySelectorAll('[data-delay]').forEach(b=>b.addEventListener('click',()=>render(Number(b.dataset.delay))));render(0);</script></body></html>