Add bins feature: upload, de-perspective, gallery
- lib/storage.mjs: bin CRUD with bin: prefix - lib/grid-image.mjs: compute_bin_size() capped at 1024px - server.mjs: POST/GET/PUT/DELETE /api/bins routes; PUT /api/bins/:id/corners re-processes image via process_grid_image with rows=1 cols=1 - public/lib/api.mjs: bin API wrappers including upload_bin() - public/index.html: Bins nav button - public/templates.html: t-section-bins, t-bin-card, t-dialog-bin-editor - public/app.mjs: render_bins(), open_bin_editor() using Grid_Setup, save/cancel wiring in init() - public/style.css: bin gallery and card styles Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -276,7 +276,10 @@
|
||||
<a class="source-card-link" target="_blank" rel="noopener">
|
||||
<img class="source-card-img" alt="">
|
||||
</a>
|
||||
<div class="source-card-meta"></div>
|
||||
<div class="source-card-footer">
|
||||
<div class="source-card-meta"></div>
|
||||
<div class="source-card-uses"></div>
|
||||
</div>
|
||||
<button type="button" class="btn-icon btn-danger source-card-delete" title="Delete">✕</button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -585,6 +588,51 @@
|
||||
</dialog>
|
||||
</template>
|
||||
|
||||
<!-- ===== BINS SECTION ===== -->
|
||||
<template id="t-section-bins">
|
||||
<section class="section" id="section-bins">
|
||||
<div class="section-toolbar">
|
||||
<label class="btn btn-primary">
|
||||
<input type="file" id="bin-upload-input" accept="image/*" hidden>
|
||||
+ Upload bin photo
|
||||
</label>
|
||||
</div>
|
||||
<div class="bin-gallery" id="bin-gallery"></div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<template id="t-bin-card">
|
||||
<div class="bin-card">
|
||||
<div class="bin-card-img-wrap">
|
||||
<img class="bin-card-img" alt="">
|
||||
<div class="bin-card-unprocessed">Not processed</div>
|
||||
</div>
|
||||
<div class="bin-card-footer">
|
||||
<span class="bin-card-name"></span>
|
||||
<span class="row-actions">
|
||||
<button class="btn-icon btn-edit" title="Edit corners">✎</button>
|
||||
<button class="btn-icon btn-danger btn-delete" title="Delete">✕</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- ===== DIALOG: BIN EDITOR ===== -->
|
||||
<template id="t-dialog-bin-editor">
|
||||
<dialog id="dialog-bin-editor" class="app-dialog app-dialog-wide">
|
||||
<h2 class="dialog-title">Edit bin</h2>
|
||||
<div class="form-row">
|
||||
<label>Name</label>
|
||||
<input type="text" id="bin-editor-name" autocomplete="off">
|
||||
</div>
|
||||
<canvas id="bin-editor-canvas" class="bin-editor-canvas"></canvas>
|
||||
<div class="dialog-actions">
|
||||
<button type="button" class="btn btn-secondary" id="bin-editor-cancel">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" id="bin-editor-save">Save & process</button>
|
||||
</div>
|
||||
</dialog>
|
||||
</template>
|
||||
|
||||
<!-- ===== CELL INVENTORY OVERLAY ===== -->
|
||||
<template id="t-cell-inventory">
|
||||
<div class="cell-inventory-overlay" id="cell-inventory-overlay">
|
||||
|
||||
Reference in New Issue
Block a user