← back to Dw Photo Capture

public/themes/v07-traffic-light.html

149 lines

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>v07 — Traffic Light</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<style>
  :root{
    --white:#ffffff;
    --ink:#1e1e1e;
    --muted:#595959;        /* Figma #6b6b6b @80% → darkened for 4.5:1 */
    --green-bg:#2e9e5b;     /* screen background (dark text on it) */
    --green:#1e7b46;        /* Figma #2e9e5b darkened so white text passes */
    --green-ink:#0b0b0b;    /* small text on the green screens (Figma grey fails) */
    --yellow:#e7b416;
    --blue:#2f6fd6;
    --orange:#b4561a;       /* Figma #e8762c darkened so white text passes */
    --grey:#cfcfcf;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;background:#0a0a0a;font-family:'Inter',system-ui,sans-serif;-webkit-font-smoothing:antialiased;}
  button{font-family:inherit;-webkit-tap-highlight-color:transparent;}
  .stage{
    width:390px;height:780px;margin:24px auto;position:relative;
    border-radius:36px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.5);border:8px solid #000;
    display:flex;flex-direction:column;background:var(--white);
  }
  .screen{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:14px 20px 22px;overflow-y:auto;background:var(--white);color:var(--ink);}
  .screen[hidden]{display:none;}
  .screen.on-green{background:var(--green-bg);}
  .topbar{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:8px;flex-shrink:0;}
  .step{margin:0;font-size:13px;font-weight:600;color:var(--muted);}
  .on-green .step{color:var(--green-ink);}
  .home{min-width:44px;min-height:44px;padding:0 14px;border-radius:14px;border:2px solid #d4d4d4;background:#fff;color:var(--ink);font-size:15px;font-weight:600;cursor:pointer;}
  .on-green .home{border-color:#fff;}
  h1{margin:0;text-align:center;font-weight:700;line-height:1.15;color:var(--ink);flex-shrink:0;}
  .h-34{font-size:34px;} .h-30{font-size:30px;} .h-44{font-size:44px;}
  .sub{margin:0;text-align:center;font-size:18px;line-height:1.35;color:var(--muted);flex-shrink:0;}
  .on-green .sub{color:var(--green-ink);font-size:20px;}
  .spacer{flex:1 1 0;min-height:0;}
  .btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;flex-shrink:0;border:0;border-radius:20px;padding:0 16px;font-size:22px;font-weight:700;line-height:1.2;cursor:pointer;}
  .btn-96{min-height:96px;} .btn-72{min-height:72px;}
  .c-green{background:var(--green);color:#fff;}
  .c-yellow{background:var(--yellow);color:var(--ink);}
  .c-blue{background:var(--blue);color:#fff;}
  .c-orange{background:var(--orange);color:#fff;}
  .c-dark{background:var(--ink);color:#fff;}
  .c-white{background:#fff;color:var(--green);}
  .camera{flex:1 1 auto;min-height:220px;background:#1c1c1e;border-radius:24px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;font-weight:600;position:relative;overflow:hidden;}
  .camera::before{content:"";position:absolute;inset:18%;border:2px dashed rgba(255,255,255,.35);border-radius:16px;}
  .shutter-row{display:flex;justify-content:center;flex-shrink:0;}
  .shutter{width:96px;height:96px;border-radius:50%;border:0;background:#fff;cursor:pointer;box-shadow:0 0 0 6px rgba(255,255,255,.35);}
  .grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;flex-shrink:0;}
  .tile{min-height:120px;border:0;border-radius:20px;background:var(--green);color:#fff;font-size:20px;font-weight:700;cursor:pointer;padding:8px;}
  .tile.long{font-size:17px;}
  .tile.other{background:var(--grey);color:var(--ink);}
  .tile[aria-pressed="true"]{box-shadow:inset 0 0 0 5px var(--ink);}
  .tile.other[aria-pressed="true"]{box-shadow:inset 0 0 0 5px var(--green);}
  .big-emoji{margin:0;text-align:center;font-size:96px;line-height:1;flex-shrink:0;}
  button:focus-visible{outline:3px solid #000;outline-offset:3px;box-shadow:0 0 0 6px #fff;}
  .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
  @media (max-width:405.98px){
    .stage{width:100%;height:100dvh;min-height:640px;margin:0;border:0;border-radius:0;box-shadow:none;}
  }
</style>
</head>
<body>
<main class="stage" aria-label="Traffic Light photo capture mockup">

  <!-- 1 · Home -->
  <section class="screen is-active" data-screen="1" aria-labelledby="t1">
    <div class="topbar"><p class="step">1 / 4 · Home</p></div>
    <h1 id="t1" class="h-34">Tap a color</h1>
    <p class="sub">Green = new · Yellow = fix · Blue = find · Orange = sample</p>
    <div class="spacer"></div>
    <button class="btn btn-96 c-green" data-go="2"><span aria-hidden="true">🟢</span> New Item</button>
    <button class="btn btn-96 c-yellow" data-go="2"><span aria-hidden="true">🟡</span> Fix an Item</button>
    <button class="btn btn-96 c-blue" data-go="2"><span aria-hidden="true">🔵</span> Find an Item</button>
    <button class="btn btn-96 c-orange" data-go="2"><span aria-hidden="true">🟠</span> Sample Came In</button>
  </section>

  <!-- 2 · Snap -->
  <section class="screen on-green" data-screen="2" aria-labelledby="t2" hidden>
    <div class="topbar"><p class="step">2 / 4 · Snap</p><button class="home" data-go="1">⌂ Home</button></div>
    <h1 id="t2" class="h-30">Snap the sample</h1>
    <div class="camera" role="img" aria-label="Camera viewfinder (pretend)"><span>📷&nbsp; point at the sample</span></div>
    <div class="shutter-row"><button class="shutter" data-go="3" aria-label="Take photo"></button></div>
  </section>

  <!-- 3 · Pick brand -->
  <section class="screen" data-screen="3" aria-labelledby="t3" hidden>
    <div class="topbar"><p class="step">3 / 4 · Pick brand</p><button class="home" data-go="1">⌂ Home</button></div>
    <h1 id="t3" class="h-34">Which brand?</h1>
    <div class="grid" role="group" aria-label="Brands">
      <button class="tile" aria-pressed="true">Thibaut</button>
      <button class="tile" aria-pressed="false">York</button>
      <button class="tile" aria-pressed="false">Kravet</button>
      <button class="tile long" aria-pressed="false">Schumacher</button>
      <button class="tile" aria-pressed="false">Brewster</button>
      <button class="tile other" aria-pressed="false">Other…</button>
    </div>
    <div class="spacer"></div>
    <button class="btn btn-72 c-dark" data-go="4">Save it ✓</button>
  </section>

  <!-- 4 · Done -->
  <section class="screen on-green" data-screen="4" aria-labelledby="t4" hidden>
    <div class="topbar"><p class="step">4 / 4 · Done</p><button class="home" data-go="1">⌂ Home</button></div>
    <div class="spacer"></div>
    <p class="big-emoji" aria-hidden="true">✅</p>
    <h1 id="t4" class="h-44">Saved!</h1>
    <p class="sub">Nice. It’s in the drafts.</p>
    <div class="spacer"></div>
    <button class="btn btn-72 c-white" data-go="1">Do another</button>
  </section>

</main>
<script>
(function(){
  var screens = Array.prototype.slice.call(document.querySelectorAll('[data-screen]'));
  function go(n){
    n = String(n);
    screens.forEach(function(s){
      var on = s.getAttribute('data-screen') === n;
      s.classList.toggle('is-active', on);
      s.hidden = !on;
    });
    var cur = document.querySelector('[data-screen="' + n + '"]');
    if (cur){ cur.scrollTop = 0; var f = cur.querySelector('button'); if (f) f.focus({preventScroll:true}); }
  }
  document.addEventListener('click', function(e){
    var t = e.target.closest('.tile');
    if (t){
      t.parentNode.querySelectorAll('.tile').forEach(function(x){ x.setAttribute('aria-pressed', x === t ? 'true' : 'false'); });
      return;
    }
    var b = e.target.closest('[data-go]');
    if (b) go(b.getAttribute('data-go'));
  });
  window.__go = go;
})();
</script>
<script>window.__theme = {id:'v07', name:'Traffic Light', screens:4};</script>
</body>
</html>