Skip to content

Commit 574cc6f

Browse files
authored
Merge pull request #22 from plotflow/claude/artwork-sales-website-01JWP9tY4m4hfX8WyoEQZ1kU
console: remove command journal; artwork takes the full sheet
2 parents 7dd3fbe + 00c9388 commit 574cc6f

3 files changed

Lines changed: 9 additions & 63 deletions

File tree

index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ <h5>MACHINE STATE · <b>PLOTTING</b></h5>
102102
</div>
103103
<div class="ft"><span>PEN-UP TRAVEL</span><span>SIMULATED ON SHEET</span></div>
104104
</aside>
105-
106-
<!-- command journal — translucent terminal over the sheet -->
107-
<div class="pf-term">
108-
<div class="hd"><span>COMMAND JOURNAL — pyaxidraw interactive</span><span class="sp"></span><span>67% · J</span></div>
109-
<pre id="pfTermBody"></pre>
110-
</div>
111105
</div>
112106
</section>
113107
<div class="pf-status">

scripts/plotter.js

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
// derived from the real plot time (≈ x45–x60)
3434
var INK = '#e8351f';
3535
var cur, len = 1, drawn = 0, painted = 0, playing = true, speed = 1, mmPerUnit = 1, totalMin = 1;
36-
var termBody = $('pfTermBody'); // command journal (homepage only)
37-
var polys = [], strokes = [], termIdx = -1; // parsed geometry + journal cursor
36+
var polys = []; // parsed polylines for the fast full-draw pass
3837
var vb = { x: 0, y: 0, w: 1, h: 1 };
3938
var tf = { s: 1, ox: 0, oy: 0, dpr: 1, ready: false };
4039
var prevPt = null;
@@ -141,25 +140,15 @@
141140
len = ppath.getTotalLength(); if (!len || !isFinite(len)) len = 1;
142141
var md = Math.max(vb.w, vb.h);
143142
mmPerUnit = 420 / md; // longest side ≈ 420mm
144-
// parse the raw path once: polylines for fast full-draw, stroke table
145-
// (start/end/len/cumulative draw length) for the command journal
146-
polys = []; strokes = []; termIdx = -1;
147-
if (termBody) termBody.textContent = '';
143+
// parse the raw path once: polylines for the fast full-draw pass
144+
polys = [];
148145
(function () {
149146
var re = /([ML])\s*(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g, m, curP = null;
150147
while ((m = re.exec(cur.d)) !== null) {
151148
var x = +m[2], y = +m[3];
152149
if (m[1] === 'M') { curP = [[x, y]]; polys.push(curP); }
153150
else if (curP) curP.push([x, y]);
154151
}
155-
var cum = 0;
156-
for (var i = 0; i < polys.length; i++) {
157-
var pl = polys[i], L = 0;
158-
for (var j = 0; j < pl.length - 1; j++)
159-
L += Math.hypot(pl[j+1][0]-pl[j][0], pl[j+1][1]-pl[j][1]);
160-
cum += L;
161-
strokes.push({ sx: pl[0][0], sy: pl[0][1], len: L, cum: cum });
162-
}
163152
})();
164153
var st = pathStats(cur.d);
165154
totalMin = (st.draw * mmPerUnit) / FEED
@@ -183,7 +172,6 @@
183172
if (!tf.ready) resetCanvas(); // self-heal if the bed wasn't laid out yet
184173
var p = drawn / len;
185174
paintTo(drawn);
186-
updateJournal();
187175
if (pbar) pbar.style.width = (p * 100) + '%';
188176
if (pct) pct.textContent = Math.round(p * 100);
189177
if (ink) ink.textContent = (drawn * mmPerUnit / 1000).toFixed(2);
@@ -217,28 +205,6 @@
217205
prevPt = lastP ? { x: lastP[0], y: lastP[1] } : null;
218206
}
219207

220-
// Command journal — emit pyaxidraw-style lines for the strokes just drawn.
221-
function pad4(n) { return String(n).padStart(4, '0'); }
222-
function updateJournal() {
223-
if (!termBody || !strokes.length) return;
224-
var lo = 0, hi = strokes.length - 1, idx = 0; // first stroke with cum >= drawn
225-
while (lo <= hi) { var mid = (lo + hi) >> 1;
226-
if (strokes[mid].cum < drawn) { lo = mid + 1; } else { idx = mid; hi = mid - 1; } }
227-
if (drawn >= len) idx = strokes.length - 1;
228-
if (idx === termIdx) return;
229-
termIdx = idx;
230-
var out = [], from = Math.max(0, idx - 2);
231-
for (var k = from; k <= idx; k++) {
232-
var st2 = strokes[k];
233-
out.push('ad.penup() z=+1');
234-
out.push('ad.moveto(' + (st2.sx * mmPerUnit).toFixed(2) + ', ' + (st2.sy * mmPerUnit).toFixed(2) + ') travel');
235-
out.push('ad.pendown() z=-1 · nib 0.30 mm');
236-
out.push('ad.lineto(…) stroke ' + pad4(k + 1) + '/' + strokes.length + ' · ' + (st2.len * mmPerUnit).toFixed(1) + ' mm');
237-
}
238-
out.push(drawn >= len ? 'ad.penup() z=+1 · job complete' : '_');
239-
termBody.textContent = out.join('\n');
240-
}
241-
242208
// Re-fit + repaint the current progress when the bed changes size.
243209
function refit() { resetCanvas(); if (drawn >= len) fastPaintAll(); else paintTo(drawn); }
244210
window.addEventListener('resize', refit);

styles/console.css

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,13 @@
7474
.pf-stage{position:relative;padding:16px;min-height:0;overflow:hidden;
7575
background:radial-gradient(1100px 640px at 55% 42%,#4d5045 0%,#383b31 72%)}
7676
.pf-stage .bed{position:absolute;inset:16px;width:auto;max-height:none;aspect-ratio:auto;overflow:hidden}
77-
/* leave paper margins for the labels and reserve the right side for the
78-
LIVE PLOT card + journal so the artwork sits clear of them. svg/canvas
79-
are replaced elements, so insets alone don't size them (the svg falls
80-
back to its viewBox aspect and spills off the sheet) — give the box
81-
explicit width/height. canvas & svg share it so the pen stays aligned */
77+
/* the artwork gets the whole sheet (paper margins only) and the LIVE PLOT
78+
card overlays its corner, PlotGrid-style. svg/canvas are replaced
79+
elements, so insets alone don't size them (the svg falls back to its
80+
viewBox aspect and spills off the sheet) — give the box explicit
81+
width/height. canvas & svg share it so the pen stays aligned */
8282
.pf-stage #pcanvas,.pf-stage #stage{left:44px;top:44px;
83-
width:calc(100% - 374px);height:calc(100% - 88px)}
84-
@media(max-width:1280px){.pf-stage #pcanvas,.pf-stage #stage{left:40px;
85-
width:calc(100% - 340px)}}
83+
width:calc(100% - 88px);height:calc(100% - 88px)}
8684
.pf-stage .bed .bl{left:16px;transform:none}
8785
.pf-view{position:absolute;top:8px;right:16px;z-index:3;font-weight:700;font-size:8px;
8886
letter-spacing:.16em;text-transform:uppercase;color:#a99a76}
@@ -139,18 +137,6 @@
139137
.pf-job{display:none}
140138
}
141139

142-
/* command journal — PlotGrid's translucent terminal, bottom-right of the sheet */
143-
.pf-term{position:absolute;right:34px;bottom:30px;z-index:8;width:470px;
144-
background:rgba(24,29,19,.68);border:1px solid rgba(123,224,138,.30);
145-
color:#7be08a;font-family:'Liberation Mono','Courier New',monospace;
146-
transition:background .25s ease}
147-
.pf-term:hover{background:rgba(24,29,19,.94)}
148-
.pf-term .hd{display:flex;gap:10px;padding:8px 12px;border-bottom:1px solid rgba(123,224,138,.24);
149-
font-size:9.5px;font-weight:700;letter-spacing:.12em}
150-
.pf-term .hd .sp{flex:1}
151-
.pf-term pre{margin:0;padding:9px 12px;font-size:10.5px;line-height:1.75;min-height:212px;
152-
white-space:pre-wrap;text-shadow:0 1px 3px rgba(0,0,0,.8)}
153-
@media(max-width:940px){.pf-term{display:none}}
154140

155141
/* ============================================================
156142
EDITION QUEUE — the shop grid as the console's job list

0 commit comments

Comments
 (0)