Improve label print calibration and polish Lithium Label UI.
Align print/calibrate fields to the reference PDF (including bottom-row offset), fix partial box weights and page padding, and rename branding to Lithium Label Manager with Vazirmatn for Persian. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 81 KiB |
50
slips/static/slips/css/label_print.css
Normal file
50
slips/static/slips/css/label_print.css
Normal 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;
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user