← back to Dw Photo Capture
public/themes/v13-photo-wall.html
202 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>v13 — Photo Wall</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<style>
:root{
--ink:#222222;
--muted:#6b6b6b; /* Figma #8a8a8a → darkened for 4.5:1 on white */
--soft:#f2f2f2;
--focus:#222222;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;background:#0a0a0a;font-family:'Inter',system-ui,sans-serif;}
.stage{
width:390px;height:780px;margin:24px auto;position:relative;display:block;
background:#fff;border-radius:36px;overflow:hidden;border:8px solid #000;
box-shadow:0 20px 60px rgba(0,0,0,.5);color:var(--ink);
}
@media (max-width:405.98px){
.stage{width:100%;margin:0;border:0;border-radius:0;height:100vh;height:100dvh;min-height:640px;}
}
.screen{
position:absolute;inset:0;display:none;flex-direction:column;gap:14px;
padding:18px 20px 18px;overflow-y:auto;background:#fff;
}
.screen.is-active{display:flex;}
.screen.dark{background:#111;--focus:#ffffff;}
.top{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;flex-shrink:0;}
.step{margin:0;font-size:13px;font-weight:600;color:var(--muted);}
.dark .step{color:#8a8a8a;} /* 5.5:1 on #111 */
.home{
background:var(--soft);color:var(--ink);border-radius:14px;padding:0 14px;
font-size:15px;font-weight:700;
}
.dark .home{background:#2a2a2a;color:#fff;}
h1{margin:0;font-size:32px;font-weight:700;text-align:center;}
h1:focus{outline:none;}
.sub{margin:0;font-size:18px;color:var(--muted);text-align:center;}
button{font:inherit;cursor:pointer;border:0;min-height:44px;min-width:44px;color:inherit;}
button:focus-visible{outline:3px solid var(--focus);outline-offset:3px;}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;flex-shrink:0;}
.tile{
height:120px;border-radius:20px;display:flex;align-items:center;justify-content:center;
color:#fff;font-size:48px;font-weight:700;padding:0;
}
.tile.add{background:#222;}
.tile.done{font-size:40px;}
.spacer{flex:1;}
.big{
width:100%;min-height:72px;border-radius:20px;font-size:22px;font-weight:700;padding:0 16px;flex-shrink:0;
}
.big.dark{background:#222;color:#fff;}
.big.soft{background:var(--soft);color:var(--ink);}
.photo{
flex:1;min-height:220px;border-radius:24px;display:flex;align-items:center;justify-content:center;
color:#fff;font-size:18px;font-weight:600;
}
.pill{background:rgba(17,17,17,.72);padding:10px 16px;border-radius:999px;}
.item-name{margin:0;font-size:26px;font-weight:700;text-align:center;}
.camera{
flex:1;min-height:220px;background:#2a2a2a;border-radius:24px;display:flex;align-items:center;justify-content:center;
color:#fff;font-size:18px;font-weight:600;position:relative;
}
.camera::after{content:"";position:absolute;inset:18%;border:2px dashed rgba(255,255,255,.3);border-radius:14px;}
.dark h1{color:#f2f2f2;font-size:30px;} /* Figma #222 on #111 was invisible */
.shutter-row{display:flex;justify-content:center;flex-shrink:0;}
.shutter{width:96px;height:96px;border-radius:50%;background:#fff;}
.toast{
position:absolute;left:50%;bottom:110px;transform:translateX(-50%) translateY(10px);
background:#222;color:#fff;padding:12px 18px;border-radius:14px;font-size:15px;font-weight:600;
opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,transform .2s,visibility 0s .2s;max-width:86%;text-align:center;z-index:5;
}
.toast.show{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0);transition:opacity .2s,transform .2s,visibility 0s;}
@media (prefers-reduced-motion:reduce){ .toast,.toast.show{transition:none} }
</style>
</head>
<body>
<main class="stage" id="app">
<section class="screen is-active" data-screen="1" aria-labelledby="h1-1">
<div class="top"><p class="step">1 / 4 · Wall</p></div>
<h1 id="h1-1">My photos</h1>
<p class="sub">Tap + to add · tap a photo to fix it</p>
<div class="grid" id="wall"></div>
<div class="spacer"></div>
<button class="big soft" data-toast="🔍 Search would open here">🔍 Find something</button>
</section>
<section class="screen" data-screen="2" aria-labelledby="h1-2">
<div class="top">
<p class="step">2 / 4 · Tapped a photo</p>
<button class="home" data-go="1">⌂ My wall</button>
</div>
<div class="photo" id="photo" role="img" aria-label="Current photo"><span class="pill">📷 point at the sample</span></div>
<h1 id="h1-2" class="item-name">Grasscloth — Ocean</h1>
<p class="sub" id="meta">Thibaut · added yesterday</p>
<button class="big dark" data-go="3">📸 Retake this photo</button>
<button class="big soft" data-toast="📦 Marked as received">📦 Sample came in</button>
</section>
<section class="screen dark" data-screen="3" aria-labelledby="h1-3">
<div class="top">
<p class="step">3 / 4 · Retake</p>
<button class="home" data-go="1">⌂ My wall</button>
</div>
<h1 id="h1-3">Retake it</h1>
<div class="camera" role="img" aria-label="Camera viewfinder">📷 point at the sample</div>
<div class="shutter-row"><button class="shutter" aria-label="Take photo" data-go="4"></button></div>
</section>
<section class="screen" data-screen="4" aria-labelledby="h1-4">
<div class="top"><p class="step">4 / 4 · Swapped</p></div>
<h1 id="h1-4" style="font-size:30px">New photo in ✨</h1>
<div class="grid" id="wall2" role="img" aria-label="Your photo wall with the new photo marked"></div>
<div class="spacer"></div>
<button class="big dark" data-go="1">Back to my wall</button>
</section>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
</main>
<script>
const items = [
{c:'#3c6e9e', n:'Grasscloth — Ocean', m:'Thibaut · added yesterday'},
{c:'#d98c9a', n:'Floral — Rose', m:'Thibaut · added 2 days ago'},
{c:'#8fae8b', n:'Palm — Sage', m:'York · added Monday'},
{c:'#d8cbb3', n:'Linen — Oat', m:'Kravet · added Monday'},
{c:'#1f3a5f', n:'Stripe — Navy', m:'Schumacher · last week'},
{c:'#b9a27a', n:'Sisal — Wheat', m:'Phillip Jeffries · last week'},
{c:'#e0533d', n:'Damask — Coral', m:'York · last week'},
{c:'#7c93b0', n:'Ikat — Denim', m:'Kravet · 2 weeks ago'},
];
let picked = 0;
const wall = document.getElementById('wall');
const wall2 = document.getElementById('wall2');
function buildWall(){
wall.innerHTML = '';
const add = document.createElement('button');
add.className = 'tile add'; add.textContent = '+'; add.setAttribute('aria-label','Add a new photo');
add.dataset.toast = '📸 Camera opens for a new item';
wall.appendChild(add);
items.forEach((it, i) => {
const b = document.createElement('button');
b.className = 'tile'; b.style.background = it.c;
b.setAttribute('aria-label', 'Fix photo: ' + it.n);
b.dataset.pick = i; b.dataset.go = '2';
wall.appendChild(b);
});
}
function buildWall2(){
wall2.innerHTML = '<div class="tile add" aria-hidden="true">+</div>';
items.forEach((it, i) => {
const d = document.createElement('div');
d.className = 'tile' + (i === picked ? ' done' : '');
d.style.background = i === picked ? '#2e9e5b' : it.c;
d.textContent = i === picked ? '✓' : '';
d.setAttribute('aria-hidden','true');
wall2.appendChild(d);
});
}
const screens = Array.from(document.querySelectorAll('[data-screen]'));
const toastEl = document.getElementById('toast');
let toastTimer = null;
function go(n){
n = String(n);
if (n === '4') buildWall2();
screens.forEach(s => s.classList.toggle('is-active', s.dataset.screen === n));
const h = document.getElementById('h1-' + n);
if (h && document.activeElement && document.activeElement !== document.body){
h.setAttribute('tabindex','-1'); h.focus({preventScroll:true});
}
}
function toast(msg){
toastEl.textContent = msg; toastEl.classList.add('show');
clearTimeout(toastTimer); toastTimer = setTimeout(() => toastEl.classList.remove('show'), 1600);
}
document.addEventListener('click', (e) => {
const b = e.target.closest('button'); if (!b) return;
if (b.dataset.pick !== undefined){
picked = Number(b.dataset.pick);
const it = items[picked];
document.getElementById('photo').style.background = it.c;
document.getElementById('h1-2').textContent = it.n;
document.getElementById('meta').textContent = it.m;
}
if (b.dataset.toast) toast(b.dataset.toast);
if (b.dataset.go) go(b.dataset.go);
});
buildWall();
document.getElementById('photo').style.background = items[0].c;
</script>
<script>window.__theme = {id:'v13', name:'Photo Wall', screens:4};</script>
</body>
</html>