Dashboard and Admin Interfaces

Outpatient scheduling calendar heatmap panel

Complete the calendar heatmap panel for the clinic scheduling scenario: include realistic content, interactive controls, clear status feedback, and responsive layouts across sizes.

Dashboard and Admin InterfacesCalendar heatmap panelHTMLCanvasJavaScript
With JavaScript enabled, you can edit, run, and save this example. The fixed source is as follows:
<!doctype html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Outpatient scheduling calendar heatmap panel</title>
  <style>
    :root { --ink:#252525; --paper:#f7f2e8; --accent:#247ba0; --secondary:#f4b942; --line:color-mix(in srgb, var(--ink) 18%, transparent); --shadow:0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent); color-scheme:light; }
    * { box-sizing:border-box; }
    html { min-width:320px; background:var(--paper); }
    body { min-height:100vh; margin:0; overflow-x:hidden; color:var(--ink); font-family:Didot,"Songti SC",serif; background:linear-gradient(30deg,transparent 48%,color-mix(in srgb,var(--accent) 9%,transparent) 49% 51%,transparent 52%),var(--paper);background-size:52px 90px; }
    button,input,select,textarea { color:inherit; font:inherit; }
    button,[role="button"],input,select,textarea { accent-color:var(--accent); }
    button { cursor:pointer; }
    button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
    [hidden] { display:none !important; }
    @media (max-width:700px) { .mast h1 { line-height:1.08 !important; letter-spacing:-.035em !important; overflow-wrap:anywhere; } }
    @media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
    .page{width:min(1040px,calc(100% - 36px));margin:auto;padding:64px 0}.mast{display:grid;justify-items:center;text-align:center;border-block:3px double var(--accent);padding:26px;gap:20px;margin-bottom:32px}.mast h1{font-family:Didot,"Songti SC",serif;font-weight:700;font-size:clamp(38px,8vw,86px);letter-spacing:.035em;margin:0;line-height:1}.eyebrow{display:block;color:var(--accent);font:800 11px/1 ui-monospace,monospace;letter-spacing:.3em}.intro{max-width:600px;margin-inline:auto;line-height:1.8}.scenario{padding:8px 26px;border-inline:1px solid var(--accent);letter-spacing:.16em}.demo{border:4px double var(--accent);border-radius:0;clip-path:polygon(24px 0,calc(100% - 24px) 0,100% 24px,100% calc(100% - 24px),calc(100% - 24px) 100%,24px 100%,0 calc(100% - 24px),0 24px);position:relative;min-height:440px;overflow:hidden;padding:clamp(28px,5vw,60px);background:var(--paper)}@media(max-width:700px){.page{width:calc(100% - 20px);padding:24px 0}.mast{padding:18px}.demo{padding:18px}}
    .panel{padding:16px;border:3px double var(--accent);background:var(--paper)}.stack{display:grid;gap:14px}.row{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:10px;overflow:auto}.action{padding:10px 15px;border:1px solid var(--accent);background:transparent;font-family:Didot,serif;letter-spacing:.06em}.action.primary,.action.is-active{color:var(--paper);background:var(--ink)}.metric{font-family:Didot,serif;font-size:clamp(36px,8vw,74px);letter-spacing:.04em}.status{min-height:24px;padding:9px;border-inline:1px solid var(--accent);text-align:center}.muted{line-height:1.8}.chip{padding:5px 14px;border-inline:1px solid var(--accent);letter-spacing:.1em}.meter{height:5px;background:var(--line)}.meter>i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--secondary))}
    .composition-gallery{margin:0;padding:clamp(8px,2vw,18px);border:1px solid var(--ink);background:color-mix(in srgb,var(--paper) 78%,transparent)}.gallery-caption{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;padding:15px 4px 2px;font-size:12px}.gallery-caption::before,.gallery-caption::after{content:"";height:1px;background:var(--line)}.gallery-caption strong{font:800 11px/1.2 ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase}.composition-gallery .demo{box-shadow:none}.composition-gallery .demo::before{content:"";position:absolute;inset:10px;border:1px dashed color-mix(in srgb,var(--accent) 36%,transparent);pointer-events:none}
    .calendar-heatmap-demo{display:grid;gap:12px;max-width:760px;margin:auto}.calendar-heatmap-demo header{display:flex;justify-content:space-between;gap:18px;align-items:end}.calendar-heatmap-demo h2{margin:.3em 0}.weekday-row,.calendar-heatmap{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.weekday-row{text-align:center;font-size:12px}.calendar-heatmap button{aspect-ratio:1;border:0;border-radius:8px;background:color-mix(in srgb,var(--accent) calc(var(--heat)*20%),var(--paper))}.calendar-heatmap [data-heat="0"]{--heat:0}.calendar-heatmap [data-heat="1"]{--heat:1}.calendar-heatmap [data-heat="2"]{--heat:2}.calendar-heatmap [data-heat="3"]{--heat:3}.calendar-heatmap [data-heat="4"]{--heat:4;color:var(--paper)}.calendar-heatmap button[aria-selected="true"]{outline:3px solid var(--ink);outline-offset:2px}.calendar-heatmap-demo footer{display:flex;gap:5px;justify-content:flex-end;align-items:center}.calendar-heatmap-demo footer i{width:16px;height:16px;border-radius:4px;background:var(--line)}.calendar-heatmap-demo footer i:nth-of-type(2){background:color-mix(in srgb,var(--accent) 25%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(3){background:color-mix(in srgb,var(--accent) 50%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(4){background:color-mix(in srgb,var(--accent) 75%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(5){background:var(--accent)}.workflow-session{display:grid;gap:14px}.session-command{display:grid;grid-template-columns:1fr auto minmax(170px,.45fr) auto;gap:16px;align-items:end;padding:18px;border-block:4px double var(--ink)}.session-command h2{margin:.2em 0}.session-command output{font:900 clamp(28px,5vw,54px)/1 ui-monospace,monospace}.session-command label{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:12px}.session-command input{grid-column:1/-1;width:100%}#workflowSessionProgress{height:12px;overflow:hidden;border-radius:2px;background:var(--line)}#workflowSessionProgress i{display:block;width:0;height:100%;background:var(--accent)}.session-stage{min-width:0;transition:filter .25s,transform .25s}.session-stage[data-session-phase="running"]{transform:translateY(-3px)}.session-stage[data-session-phase="paused"]{filter:grayscale(.65)}.session-stage[data-session-phase="complete"]{filter:contrast(.78);opacity:.72}.session-log{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:start}.session-log ol{display:flex;flex-wrap:wrap;gap:7px;padding:0;margin:0;list-style:none}.session-log li{padding:5px 8px;border:1px solid var(--line);font-size:12px}@media(max-width:900px){.session-stage{order:-1}.session-command{grid-template-columns:1fr auto}.session-command label{grid-column:1/-1}.session-log{grid-template-columns:1fr}}
  </style>
</head>
<body data-aesthetic="art-deco" data-composition="gallery-frame">
  <main class="page">
    <header class="mast"><div><span class="eyebrow">art-deco / Calendar Heatmap Panel / BEGINNER</span><h1>Outpatient scheduling calendar heatmap panel</h1><p class="intro">Complete the calendar heatmap panel for the clinic scheduling scenario: include realistic content, interactive controls, clear status feedback, and responsive layouts across sizes.</p></div><span class="scenario">Clinic schedule</span></header>
    <figure class="composition-gallery"><section class="demo" aria-label="Outpatient Scheduling Calendar Heatmap Panel Interaction Area"><div class="workflow-session"><header class="session-command"><div><span class="eyebrow">Outpatient Scheduling SESSION</span><h2>Outpatient Window Timer</h2></div><output id="workflowSessionClock">00:45</output><label>Round Duration<input id="workflowSessionLength" type="range" min="15" max="90" step="15" value="45"><span>sec</span></label><button id="workflowSessionToggle" class="action primary" type="button">Start shift duty</button></header><div id="workflowSessionProgress" role="progressbar" aria-label="Outpatient Window Progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></div><section id="workflowCore" class="workflow-core session-stage" data-session-phase="ready" tabindex="-1"><!-- 11DZ_CORE_START:dashboards-admin-calendar-heatmap --><div class="calendar-heatmap-demo"><header><span class="eyebrow">CALENDAR HEATMAP</span><h2>Outpatient Scheduling Active Calendar</h2><output id="heatmapSelection">Select a date to view activity</output></header><div class="weekday-row"><span>One</span><span>Two</span><span>Three</span><span>Four</span><span>Five</span><span>Six</span><span>Day</span></div><div class="calendar-heatmap" role="grid" aria-label="7 monthly activity"><button type="button" role="gridcell" data-heat="4" aria-label="7 month 1 day, activity 4" data-core-bridge="dashboards-admin-calendar-heatmap">1</button><button type="button" role="gridcell" data-heat="1" aria-label="7 month 2 day, activity level 1">2</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 3 day, activity level 3">3</button><button type="button" role="gridcell" data-heat="0" aria-label="7 Month 4 Day, activity level 0">4</button><button type="button" role="gridcell" data-heat="2" aria-label="7 Month 5 day, activity 2">5</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 6 day, activity level 4">6</button><button type="button" role="gridcell" data-heat="1" aria-label="7 month 7 day, activity level 1">7</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 8 day, activity level 3">8</button><button type="button" role="gridcell" data-heat="0" aria-label="7 month 9 day, activity level 0">9</button><button type="button" role="gridcell" data-heat="2" aria-label="7 Month 10 Day, Activity Level 2">10</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 11 day, activity level 4">11</button><button type="button" role="gridcell" data-heat="1" aria-label="7 month 12 day, activity level 1">12</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 13 day, activity level 3">13</button><button type="button" role="gridcell" data-heat="0" aria-label="7 month 14 day, activity 0">14</button><button type="button" role="gridcell" data-heat="2" aria-label="7 month 15 day, activity level 2">15</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 16 day, activity level 4">16</button><button type="button" role="gridcell" data-heat="1" aria-label="7 Month 17 Day, activity 1">17</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 18 day, activity level 3">18</button><button type="button" role="gridcell" data-heat="0" aria-label="7 month 19 day, activity 0">19</button><button type="button" role="gridcell" data-heat="2" aria-label="7 month 20 day, activity level 2">20</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 21 day, activity 4">21</button><button type="button" role="gridcell" data-heat="1" aria-label="7 month 22 day, activity 1">22</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 23 day, activity level 3">23</button><button type="button" role="gridcell" data-heat="0" aria-label="7 month 24 day, activity 0">24</button><button type="button" role="gridcell" data-heat="2" aria-label="7 month 25 day, activity level 2">25</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 26 day, activity level 4">26</button><button type="button" role="gridcell" data-heat="1" aria-label="7 month 27 day, activity level 1">27</button><button type="button" role="gridcell" data-heat="3" aria-label="7 month 28 day, activity level 3">28</button><button type="button" role="gridcell" data-heat="0" aria-label="7 month 29 day, activity 0">29</button><button type="button" role="gridcell" data-heat="2" aria-label="7 month 30 day, activity level 2">30</button><button type="button" role="gridcell" data-heat="4" aria-label="7 month 31 day, activity level 4">31</button></div><footer><span>Few</span><i data-heat="0"></i><i data-heat="1"></i><i data-heat="2"></i><i data-heat="3"></i><i data-heat="4"></i><span>Many</span></footer></div><!-- 11DZ_CORE_END --></section><footer class="session-log"><strong id="workflowSessionScore">0 interaction checkpoints</strong><ol id="workflowSessionLaps" aria-label="Round Log"></ol></footer></div><p id="status" class="status" role="status" aria-live="polite"></p></section><figcaption class="gallery-caption"><strong>Outpatient Schedule / GALLERY 03</strong></figcaption></figure>
  </main>
  <script>
    'use strict';
    const statusOutput = document.querySelector('#status');
    const announce = message => { statusOutput.textContent = message; };
    /* 11DZ_CORE_SCRIPT_START:dashboards-admin-calendar-heatmap */
const heatCells=[...document.querySelectorAll('.calendar-heatmap button')];heatCells.forEach((cell,index)=>cell.addEventListener('click',()=>{heatCells.forEach(item=>item.removeAttribute('aria-selected'));cell.setAttribute('aria-selected','true');document.querySelector('#heatmapSelection').textContent='7 month '+(index+1)+' Day · Activity '+cell.dataset.heat;announce(document.querySelector('#heatmapSelection').textContent);}));
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"dashboards-admin-calendar-heatmap","selector":"[data-core-bridge=\"dashboards-admin-calendar-heatmap\"]","mode":"click","key":"Enter"};const workflowBridgeCore=document.querySelector('#workflowCore');const workflowBridgeControl=workflowBridgeCore.querySelector(workflowBridgeSpec.selector);if(!workflowBridgeControl)throw new Error('Missing core bridge: '+workflowBridgeSpec.name);const workflowBridgeControlledId=workflowBridgeControl.getAttribute('aria-controls');const workflowBridgeControlled=workflowBridgeControlledId?document.getElementById(workflowBridgeControlledId):null;workflowBridgeCore.dataset.workflowBridge=workflowBridgeSpec.name;workflowBridgeCore.dataset.workflowVersion='0';function workflowBridgeSerialize(){const visualNode=workflowBridgeCore.firstElementChild||workflowBridgeCore;const visual=getComputedStyle(visualNode);const outputs=[...workflowBridgeCore.querySelectorAll('output,[role="status"],[aria-live],meter,progress')].map(node=>node.textContent.trim()+'|'+node.getAttribute('aria-valuenow')+'|'+node.getAttribute('value'));const canvas=[...workflowBridgeCore.querySelectorAll('canvas')].map(node=>{try{return node.toDataURL().slice(-160);}catch{return 'canvas-unavailable';}});return JSON.stringify({html:workflowBridgeCore.innerHTML,status:statusOutput.textContent,outputs,canvas,visual:[visual.display,visual.visibility,visual.opacity,visual.transform,visual.filter,visual.backgroundColor,visual.width,visual.height],scroll:workflowBridgeSpec.mode==='scroll'?workflowBridgeControl.scrollTop:null});}let workflowBridgeLastEffect=workflowBridgeSerialize();function workflowBridgeSummary(){const label=(workflowBridgeControl.getAttribute('aria-label')||workflowBridgeControl.textContent||workflowBridgeControl.value||workflowBridgeSpec.name).trim().replace(/\s+/g,' ').slice(0,72);return label+' · Core Version '+workflowBridgeCore.dataset.workflowVersion;}function workflowBridgeCommit(){const effect=workflowBridgeSerialize();if(effect===workflowBridgeLastEffect)return {changed:false,summary:workflowBridgeSummary()};workflowBridgeLastEffect=effect;workflowBridgeCore.dataset.workflowVersion=String(Number(workflowBridgeCore.dataset.workflowVersion||0)+1);return {changed:true,summary:workflowBridgeSummary()};}function workflowBridgeScheduleCommit(){queueMicrotask(workflowBridgeCommit);setTimeout(workflowBridgeCommit,0);}workflowBridgeControl.addEventListener("click",workflowBridgeScheduleCommit);const workflowBridgeStateTargets=new Set(workflowBridgeCore.querySelectorAll('dialog'));if(workflowBridgeControlled&&workflowBridgeCore.contains(workflowBridgeControlled))workflowBridgeStateTargets.add(workflowBridgeControlled);workflowBridgeStateTargets.forEach(target=>['close','cancel','toggle'].forEach(eventName=>target.addEventListener(eventName,workflowBridgeScheduleCommit)));function workflowBridgeActivate(){workflowBridgeControl.focus();workflowBridgeControl.click();const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowSessionCore=document.querySelector('#workflowCore');const workflowSessionToggle=document.querySelector('#workflowSessionToggle');const workflowSessionLength=document.querySelector('#workflowSessionLength');const workflowSessionState={phase:'ready',elapsed:0,limit:Number(workflowSessionLength.value),checkpoints:[],timer:null};function workflowSessionFormat(seconds){return String(Math.floor(seconds/60)).padStart(2,'0')+':'+String(seconds%60).padStart(2,'0');}function workflowSessionDrive(){const percent=Math.min(100,Math.round(workflowSessionState.elapsed/workflowSessionState.limit*100));document.querySelector('#workflowSessionClock').textContent=workflowSessionFormat(Math.max(0,workflowSessionState.limit-workflowSessionState.elapsed));const progress=document.querySelector('#workflowSessionProgress');progress.setAttribute('aria-valuenow',String(percent));progress.querySelector('i').style.width=percent+'%';workflowSessionCore.dataset.sessionPhase=workflowSessionState.phase;document.querySelector('#workflowSessionScore').textContent=workflowSessionState.checkpoints.length+' interactive checkpoints';}function workflowSessionLap(label){workflowSessionState.checkpoints.push({label,at:workflowSessionState.elapsed});const item=document.createElement('li');item.textContent=label+' · '+workflowSessionFormat(workflowSessionState.elapsed);document.querySelector('#workflowSessionLaps').append(item);workflowSessionDrive();}function workflowSessionStop(complete=false){clearInterval(workflowSessionState.timer);workflowSessionState.timer=null;workflowSessionState.phase=complete?'complete':'paused';workflowSessionToggle.textContent=complete?'Restart':'Continue round';workflowSessionToggle.setAttribute('aria-pressed','false');workflowSessionDrive();announce(complete?'Outpatient Window Round Complete':'Round paused');}function workflowSessionStart(){if(workflowSessionState.phase==='complete'){workflowSessionState.elapsed=0;workflowSessionState.checkpoints=[];document.querySelector('#workflowSessionLaps').replaceChildren();}workflowSessionState.phase='running';workflowSessionToggle.textContent='Pause round';workflowSessionToggle.setAttribute('aria-pressed','true');const bridge=workflowBridgeActivate();workflowSessionLap(bridge.summary);clearInterval(workflowSessionState.timer);workflowSessionState.timer=setInterval(()=>{workflowSessionState.elapsed+=1;if(workflowSessionState.elapsed>=workflowSessionState.limit){workflowSessionStop(true);return;}workflowSessionDrive();},1000);workflowSessionDrive();announce('The outpatient window session has begun · '+bridge.summary);}workflowSessionToggle.addEventListener('click',()=>workflowSessionState.phase==='running'?workflowSessionStop():workflowSessionStart());workflowSessionLength.addEventListener('input',()=>{workflowSessionState.limit=Number(workflowSessionLength.value);workflowSessionState.elapsed=Math.min(workflowSessionState.elapsed,workflowSessionState.limit);workflowSessionDrive();});workflowSessionCore.addEventListener('keydown',event=>{if(event.key==='Enter'||event.key===' '){workflowSessionLap('Keyboard Interaction');}});workflowSessionCore.addEventListener('click',event=>{if(event.target.closest('[data-core-bridge]'))workflowSessionLap('Core action · '+workflowBridgeSummary());});document.addEventListener('visibilitychange',()=>{if(document.hidden&&workflowSessionState.phase==='running')workflowSessionStop();});workflowSessionDrive();
workflowBridgeReset();
  </script>
</body>
</html>
Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback