From 0450acfedbeecd3a6eb93598b913488f647c2eb7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 18:14:20 +0000 Subject: [PATCH] The foot, as draw's is now: a show/hide button, names in the popup alone, no shade, the whole strip #footBtn in the upper left puts the foot away and brings it back. A tile has no word on its face and says its name (and a dial's value) in one popup. The foot has no background. A ring's far side lands at the strip's ends. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_014hCELpcHAGzoWBsNzXgZw8 --- 3d.html | 65 +++++++++++++++++++++++++++++++++++++++++++++--- CLAUDE.md | 8 ++++++ tests/editor.mjs | 18 ++++++++++++++ 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/3d.html b/3d.html index 7c88cab..0d0474e 100644 --- a/3d.html +++ b/3d.html @@ -283,6 +283,26 @@ lines of text standing on the picture; the bar's buttons say their names and the foot holds the values, as in draw. They are still written (the checks read them, and the crumb's part name), only not shown. */ body .hint,body .navhint,body .crumb{display:none!important} + /* THE FOOT, AS DRAW'S IS NOW (1 Dec 2026, Tom: "do the same for 3d. also the footer background should be transparent", after + draw's "Show button in upper left to show hide", "Only show text on the icons tooltip popup", "Remove the background from + the footer" and "The footer should use the full width, it is being clipped"). No shade behind the foot: the tiles are chips + with their own fill and stand on the picture. No word on a tile: a tile said its name on its face and again in its tip, so + the word (and a dial's value, which stood over its picture) is kept in the tile, not shown, and said in one popup over the + tile while it is pointed at or held (#tileName, THE TILES SAY THEIR NAMES). And a button pinned in the upper left, the + menu's twin, puts the foot away and brings it back (#footBtn, body.foot-off); the bar starts after it. */ + body .foot{background:transparent} + body .foot .ptile .nm,body .foot .ptile .dval{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap} + body .foot .ptile{padding:0;gap:0} + #tileName{position:fixed;z-index:60;pointer-events:none;padding:3px 8px;border-radius:6px;background:var(--chip-bg);color:var(--chip-fg);border:1px solid var(--chip-line);box-shadow:var(--chip-shadow); + font:12px system-ui,sans-serif;line-height:16px;white-space:nowrap;opacity:0;transition:opacity .12s} + #tileName.on{opacity:1} #tileName b{font-weight:400;color:var(--gold);margin-left:6px} + body .bar{left:58px} + body #footBtn{display:flex;position:absolute;left:12px;top:16px;align-items:center;justify-content:center;pointer-events:auto; + width:32px;height:32px;padding:6px;border-radius:9px;background:var(--chip-bg);color:var(--chip-fg);border:1px solid var(--chip-line);box-shadow:var(--chip-shadow);cursor:pointer} + body #footBtn svg{width:17px;height:17px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round} + body #footBtn:hover{background:var(--chip-bg-hover);border-color:var(--chip-line-hover)} + body #footBtn.on{color:#14141a;background:var(--gold);border-color:rgba(212,160,82,.9)} + body.foot-off .foot,body.foot-off .panel .sec,body.foot-off #tileName{display:none!important} body .foot .ptile.pic{padding:0;overflow:hidden} body .foot .ptile.pic img{width:100%;height:100%;object-fit:cover;border-radius:0} body .foot .ptile.pic .nm{display:none} .ptile .tpick{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;cursor:pointer;border:none;padding:0} .foot .hist img{height:64px;width:96px;border-radius:12px;border:1px solid var(--chip-line);opacity:1} @@ -290,6 +310,7 @@ body .bar .tool,body .bar .chip,body #menuBtn{width:52px;height:52px;border-radius:14px} body .bar .tool svg,body .bar .chip svg,body #menuBtn svg{width:26px;height:26px} body .bar{height:60px;right:72px} body #menuBtn{top:12px} + body .bar{left:72px} body #footBtn{width:52px;height:52px;border-radius:14px;top:12px} body #footBtn svg{width:26px;height:26px} body .top{height:72px} body .crumb{top:78px} } .gtitle{font-size:10.5px;color:var(--faint);text-transform:uppercase;letter-spacing:.8px;margin-top:2px} @@ -409,6 +430,7 @@ + @@ -6091,6 +6113,31 @@ $('bar').addEventListener('pointerover',e=>{ const b=e.target.closest('.tool,.chip'); hush(); if(b) say(b); }); $('bar').addEventListener('pointerleave',hush); $('bar').addEventListener('pointerdown',e=>{ const b=e.target.closest('.tool,.chip'); if(b && e.pointerType!=='mouse') say(b); }); window.addEventListener('pointerup',()=>setTimeout(hush,600)); $('bar').addEventListener('scroll',hush); } +// THE TILES SAY THEIR NAMES (1 Dec 2026, with THE FOOT, AS DRAW'S IS NOW in the styles): a tile of the foot has no word on its +// face, so its name is said in a popup over it while the mouse is on it or a finger is held on it (and a moment after it +// lifts, so a tap shows it): the tile's name, and a dial's value after it in gold. One element on the page, placed from the +// tile's own box, since a ring's items are moved by a transform and a fixed child would be placed from the tile. +{ const tip=document.createElement('div'); tip.id='tileName'; tip.setAttribute('aria-hidden','true'); document.body.appendChild(tip); let T=0; + const say=t=>{ clearTimeout(T); const n=t.querySelector('.nm'), v=t.querySelector('.dval'), name=(t.dataset.name||(n&&n.textContent)||t.title||'').trim(); if(!name){ tip.classList.remove('on'); return; } + tip.textContent=name; if(v && v.textContent.trim()){ const b=document.createElement('b'); b.textContent=v.textContent.trim(); tip.appendChild(b); } + const r=t.getBoundingClientRect(), w=tip.offsetWidth, h=tip.offsetHeight; tip.style.left=Math.max(4,Math.min(innerWidth-w-4,r.left+r.width/2-w/2))+'px'; tip.style.top=Math.max(4,r.top-h-6)+'px'; tip.classList.add('on'); }; + const hush=after=>{ clearTimeout(T); if(after) T=setTimeout(()=>tip.classList.remove('on'),after); else tip.classList.remove('on'); }; + const foot=$('foot'); + foot.addEventListener('pointerover',e=>{ if(e.pointerType!=='mouse') return; const t=e.target.closest('.ptile'); if(t) say(t); else hush(); }); + foot.addEventListener('pointerleave',()=>hush()); + foot.addEventListener('pointerdown',e=>{ if(e.pointerType==='mouse') return; const t=e.target.closest('.ptile'); if(t) say(t); },true); + window.addEventListener('pointerup',e=>{ if(e.pointerType!=='mouse') hush(900); }); + window.__tileName=()=>tip.classList.contains('on')?tip.textContent:''; } +// THE FOOT IS SHOWN AND HIDDEN (the same day; draw's #bFoot): the button in the upper left puts the foot away (its strip, the +// dial standing on it, a sheet above it) and brings it back as it was; gold while it is away; remembered; and a press on one +// of the bar's buttons brings it back, since what such a button does is said at the foot. +{ const b=$('footBtn'), KEY='tangent3d.footOffV1'; + const set=off=>{ off=!!off; document.body.classList.toggle('foot-off',off); b.classList.toggle('on',off); b.setAttribute('aria-expanded',String(!off)); b.title=off?'show the bottom toolbar':'hide the bottom toolbar'; + try{ localStorage.setItem(KEY,off?'1':'0'); }catch(_){} if(!off) window.dispatchEvent(new Event('resize')); }; + b.addEventListener('click',()=>set(!document.body.classList.contains('foot-off'))); + $('bar').addEventListener('click',e=>{ if(document.body.classList.contains('foot-off') && e.target.closest('.tool,.chip')) set(false); },true); + window.__foot={ set, get off(){ return document.body.classList.contains('foot-off'); } }; + let was=''; try{ was=localStorage.getItem(KEY)||''; }catch(_){} if(was==='1') set(true); } const TOOLS=['shape','sculpt','bend','paint','hollow','detail']; $('tools').innerHTML=TOOLS.map(t=>``).join(''); // THE FOOT IS THE TOOL'S VALUES (15 Nov 2026; draw's rule, "keep the options in the header and the footer is just for @@ -6102,13 +6149,14 @@ // items from the focus f, the nearer way round (a count mod n, so the ring has no end), read in thumbs, s = d/H, and laid // on the line chart x = s/(1 + |s|) across the strip's half-width: rational both ways, one thumb at half the half-width, // the strip's ends the horizon, never reached; no tan, no square root. H is set so the focus's neighbours stand an item's -// pitch apart; out from there each item has less room and is drawn smaller in proportion, hidden below 0.15. A drag keeps +// pitch apart; out from there each item has less room and is drawn smaller in proportion, hidden below RING_GONE. A drag keeps // the item under the finger (f = i₀ − H·s(x)), a throw glides, the wheel steps by its pixels over the pitch. When the // items' own widths fit side by side it is a centred row and does not turn. What differs from draw's is only what must: // which elements are its items (sel), the air between them (GAP), and a culled item is hidden by a class, since this // page's own rules show and hide by !important. An item's size is written before it is shown, and a hidden one is not // shown to be measured (draw's fix of the same day: a size the browser applies is one an item grows or shrinks from). const RING_LINE={ x:s=>s/(1+(s<0?-s:s)), s:x=>x/(1-(x<0?-x:x)) }; +const RING_GONE=0.06; // an item is drawn down to this share of its size (it was 0.15, and the ring stopped a third short of each end) const RING_THROW_MS=140, RING_FRICTION=0.88, RING_V_MAX=1.2, RING_V_MIN=0.004, WHEEL_SPIN_GAIN=0.3, RING_GAP_MIN=4; function makeRing(strip,sel,GAP=16,live=()=>true){ if(!strip) return null; strip.classList.add('ring'); let f=0, raf=0, _item=0, vel=0, spin=null, geo=null; @@ -6123,10 +6171,19 @@ if(sum+(n-1)*RING_GAP_MIN<=W-2*RING_GAP_MIN){ f=0; const g=Math.max(RING_GAP_MIN,Math.min(GAP,(W-sum)/(n+1))); let x=(W-sum-(n-1)*g)/2; // they fit: a centred row btns.forEach((b,i)=>{ place(b,x+ws[i]/2,1); b.classList.remove('ring-off'); b.style.zIndex='100'; x+=ws[i]+g; }); return; } f%=n; if(f<0) f+=n; - const mid=W/2, half=Math.max(ITEM,mid-chipW/2), H=Math.max(1,half/ITEM-1), X=d=>RING_LINE.x(d/H)*half; // the focus's neighbours a pitch apart + const mid=W/2; let half=Math.max(ITEM,mid-chipW/2), H=Math.max(1,half/ITEM-1); // the focus's neighbours a pitch apart + // THE RING USES THE WHOLE STRIP (1 Dec 2026, Tom: "do the same for 3d", of draw's "The footer should use the full width, it + // is being clipped"; draw.html, the same heading). With the horizon at the strip's ends the item farthest round stood only + // (n/2)/(H + n/2) of the way out and the items went out at 0.15 of their size before that, so a third of the strip stood + // empty at each end. The same line from the same vantage, the horizon moved out past the ends until the far side of the + // ring lands on them: E is where the farthest item stands, and H is solved so it does with the focus's neighbours still a + // pitch apart (E(H + m)/(m(H + 1)) = ITEM, m = n/2). A strip too narrow for that keeps the old reading. + const m=n/2, E=mid-6-0.2*chipW; + if(E>ITEM*1.05 && ITEM*m>E*1.02){ H=Math.max(0.25,m*(E-ITEM)/(ITEM*m-E)); half=E*(H+m)/m; } + const X=d=>RING_LINE.x(d/H)*half; geo={ left:strip.getBoundingClientRect().left, mid, half, H, n }; btns.forEach((b,k)=>{ let d=k-f; d-=Math.round(d/n)*n; const x=X(d), room=Math.min(X(d+1)-x,x-X(d-1)), sc=Math.min(1,room/(chipW+4)); - if(sc<0.15){ place(b,mid+x,0.15); b.classList.add('ring-off'); return; } + if(sc{ if(raf){ cancelAnimationFrame(raf); raf=0; } vel=0; }; const glide=v=>{ stop(); vel=Math.max(-RING_V_MAX,Math.min(RING_V_MAX,v||0)); if(!isFinite(vel) || Math.abs(vel){ pop.hidden=!pop.hidden; }; for(const id of ['vObject','vScene']) $(id).addEventListener('click',()=>{ pop.hidden=true; }); window.addEventListener('pointerdown',e=>{ if(!pop.hidden && !e.target.closest('#menuPop,#menuBtn')) pop.hidden=true; },true); } requestAnimationFrame(()=>{ RINGS.bar=makeRing(bar,'.tool,.chip',16,inView); diff --git a/CLAUDE.md b/CLAUDE.md index dd8ca78..fba17ef 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -127,6 +127,14 @@ line and the account of it in the `docs/` file, dated, in the voice those have. - A dial's tile is its own picture (the same day, "2"; `DIAL_G`): what the slider changes, over a small track whose knob stands at the value, the value above in gold and the name alone beneath. A new dial needs a picture there. A sheet and a dial do not stand together, and the crumb goes while a sheet is up (the phone pass, "1"). + - The foot is draw's as it is now (1 Dec 2026, Tom: "do the same for 3d. also the footer background should be transparent"; + THE FOOT, AS DRAW'S IS NOW in the styles, THE TILES SAY THEIR NAMES and THE FOOT IS SHOWN AND HIDDEN in the script): the foot + has no shade behind it; a tile has no word on its face (`.nm` and a dial's `.dval` stay in the tile, not shown) and says its + name, and a dial's value, in one popup over it (`#tileName`, `window.__tileName()`); `#footBtn`, pinned in the upper left as + the menu's button is in the upper right, toggles `body.foot-off` (the foot and a sheet above it; gold while away; remembered; + a press on a button of the bar brings the foot back; `window.__foot`), and the bar starts after it; and a ring uses the whole + strip (THE RING USES THE WHOLE STRIP in `makeRing`: the horizon moved out until the item farthest round stands at the + strip's end, items drawn down to `RING_GONE`, 0.06). A new tile needs no caption, only a name for its popup. - No words stand over the picture (17 Nov 2026: "remove text readouts such as 'drag to look' around"; NO WORDS OVER THE PICTURE): `.hint`, `.navhint` (walking, placing) and `.crumb` are written but not shown. A new hint is a button's name or a tile, not a line of text on the picture. diff --git a/tests/editor.mjs b/tests/editor.mjs index 17f1ef5..c2cedc5 100644 --- a/tests/editor.mjs +++ b/tests/editor.mjs @@ -1475,6 +1475,24 @@ try { await pg.setViewportSize({ width: 390, height: 760 }); await pg.click('#menuBtn'); await pg.click('#vObject'); await pg.waitForFunction(() => __ui.foot === 'parts' && !__ui.rings.bar.flat); s = await st(); const b = s.bar.split(','); if (!(+b[0] < +b[1]) || s.view !== '390,760') throw new Error('a phone: ' + JSON.stringify(s)); await tap('#bHist'); if ((await st()).foot !== 'hist') throw new Error('the history button'); await tap('.tool[data-tool="hollow"]'); if ((await st()).foot !== 'tool') throw new Error('a button round the back of the bar'); + // THE FOOT, AS DRAW'S IS NOW (1 Dec 2026, Tom: "do the same for 3d. also the footer background should be transparent"): the + // ring goes out to both ends of the strip, the foot has no shade, a tile has no word on its face and says its name in the + // popup, and the button in the upper left puts the foot away and brings it back + const f = await pg.evaluate(() => { const ts = [...document.querySelectorAll('#tstrip .ptile')].filter(t => !t.classList.contains('ring-off')).map(t => t.getBoundingClientRect()), t = document.querySelector('#tstrip .ptile:not(.ring-off) .nm'), + n = t.getBoundingClientRect(), fb = document.getElementById('footBtn').getBoundingClientRect(), cs = getComputedStyle(document.getElementById('foot')); + return { left: Math.min(...ts.map(r => r.left)) / innerWidth, right: Math.max(...ts.map(r => r.right)) / innerWidth, bg: cs.backgroundImage + ' ' + cs.backgroundColor, word: [n.width, n.height, t.textContent.length > 0], btn: [fb.left < 20, fb.top < 30] }; }); + if (!(f.left < 0.09 && f.right > 0.91)) throw new Error("the foot's ring stops short of the strip's ends: " + JSON.stringify(f)); + if (!/^none rgba\(0, 0, 0, 0\)$/.test(f.bg)) throw new Error('the foot has a shade: ' + f.bg); + if (f.word[0] > 1.5 || f.word[1] > 1.5 || !f.word[2]) throw new Error('a tile still shows its word on its face: ' + JSON.stringify(f.word)); + if (!f.btn[0] || !f.btn[1]) throw new Error("the foot's button is not in the upper left"); + await pg.hover('#tstrip .ptile:not(.ring-off):not(:disabled)'); + const said = await pg.evaluate(() => window.__tileName()); if (!said) throw new Error('a tile pointed at says no name'); + await pg.mouse.move(680, 300); + const foot = () => pg.evaluate(() => [__foot.off, getComputedStyle(document.getElementById('foot')).display !== 'none', document.getElementById('footBtn').getAttribute('aria-expanded')].join()); + await pg.click('#footBtn'); let ft = await foot(); if (ft !== 'true,false,false') throw new Error('a press did not put the foot away: ' + ft); + await tap('.tool[data-tool="sculpt"]'); ft = await foot(); if (ft !== 'false,true,true') throw new Error("a press on a bar's button did not bring the foot back: " + ft); + await pg.click('#footBtn'); await pg.click('#footBtn'); ft = await foot(); if (ft !== 'false,true,true') throw new Error('a second press did not bring the foot back: ' + ft); + await pg.evaluate(() => { try { localStorage.removeItem('tangent3d.footOffV1'); } catch (_) {} }); if (errs.length) throw new Error('page errors: ' + errs.join(' | ')); await pg.close(); });