Label print calibration and Lithium Label UI polish (#3)

## Summary
- Calibrate label print/calibrate CSS to the reference PDF (positions, ~7pt/6pt sizes, bottom-row pitch)
- Print layout: partial last-box weight, pad short pages to 4 slips, whole-number weights
- Rename to Lithium Label Manager; Vazirmatn for FA / Inter for EN; inverted lithium icon; seed weights=5; number step=1; hide empty toast

## Test plan
- [ ] Print calibration sheet and overlay on a physical label — top and bottom rows align
- [ ] Order 50/5/4 — box labels show 20, 20, 10 (padded page); weights without `.0`
- [ ] Language toggle switches Inter ↔ Vazirmatn
- [ ] Seed products use canister weight 5; form spinners step by 1

Reviewed-on: #3
Co-authored-by: Diaco Soltanpour <dyaco8464@yahoo.com>
Co-committed-by: Diaco Soltanpour <dyaco8464@yahoo.com>
This commit was merged in pull request #3.
This commit is contained in:
2026-10-01 18:10:44 +00:00
committed by rhino
parent cbb1030641
commit d7f1929674
15 changed files with 161 additions and 126 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@@ -0,0 +1,50 @@
/* Shared label field calibration — derived from
* ETICHETTE PER INKS(...).xlsx.pdf (fit-to-page A4 print).
* Positions are mm from the top-left of each slip quadrant.
* Font sizes are effective printed sizes (Excel 15/13pt × ~0.46 scale).
*/
.var-field {
position: absolute;
font-family: Arial, sans-serif;
font-weight: bold;
white-space: nowrap;
}
.val-batch {
font-size: 7pt;
top: 61mm;
left: 30.2mm;
}
.val-date {
font-size: 6pt;
top: 61mm;
left: 67.4mm;
}
.val-next {
font-size: 7pt;
top: 66.5mm;
left: 84.2mm;
}
.val-weight {
font-size: 7pt;
top: 66.5mm;
left: 37.3mm;
}
/*
* Bottom row is not at true half-page: PDF vertical pitch between
* matching fields is ~118.8mm (not 148.5mm). Shift bottom slips up.
* Quadrant order in the 2×2 grid: 1=TL, 2=TR, 3=BL, 4=BR.
*/
.slip-quadrant:nth-child(n + 3) .val-batch,
.slip-quadrant:nth-child(n + 3) .val-date {
top: 31.3mm;
}
.slip-quadrant:nth-child(n + 3) .val-next,
.slip-quadrant:nth-child(n + 3) .val-weight {
top: 36.8mm;
}

View File

@@ -13,6 +13,7 @@
--border: rgba(148, 163, 184, 0.1);
--font-sans: 'Inter', sans-serif;
--font-fa: 'Vazirmatn', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}
@@ -31,6 +32,10 @@ body {
min-height: 100vh;
}
html[lang="fa"] body {
font-family: var(--font-fa);
}
.mono {
font-family: var(--font-mono);
}
@@ -426,13 +431,19 @@ input:focus, select:focus {
border-radius: 8px;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
border-left: 4px solid var(--accent);
transform: translateY(150%);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
transform: translateY(calc(100% + 2rem));
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s;
z-index: 100;
}
.toast.show {
transform: translateY(0);
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.toast.error {

View File

@@ -1,6 +1,6 @@
const translations = {
'en': {
'app_title': 'Lithium Slip Manager',
'app_title': 'Lithium Label Manager',
'data_entry': 'Data Entry',
'print_queue': 'Print Queue',
'calibrate': 'Calibrate',
@@ -76,6 +76,8 @@ const translations = {
let currentLang = localStorage.getItem('slip_lang') || 'en';
function applyLanguage(lang) {
document.documentElement.lang = lang;
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (translations[lang][key]) {