bff6d70b17
Aplicatie Flask + SQLite pentru productie alimentara: cantarirea componentelor unui produs finit si tiparirea etichetei prin QZ Tray. - produse finite (retete) formate din componente cantarite - designer vizual de etichete (mm/px, zona sigura, campuri variabile, cod QR cu continut din mai multe bucati) - legare produs finit -> sablon de eticheta - navigare pe doua taburi: Cantarire / Setari - administrare: componente, produse finite, sabloane, campuri, istoric - backup, resetare baza de date, checklist de pregatire, /healthz - CLI de administrare si serviciu systemd pentru productie - vendor/syncpulse-scale-bridge (GPL-3.0-or-later) pentru citirea cantarului
468 lines
12 KiB
CSS
468 lines
12 KiB
CSS
/* Designer de etichete: layout, canvas, panouri. */
|
|
|
|
.designer { display: flex; flex-direction: column; gap: 14px; }
|
|
|
|
.designer-head {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
justify-content: space-between;
|
|
gap: 20px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.designer-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.3px; }
|
|
.designer-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
|
|
/* Numele sablonului se editeaza direct din antet. */
|
|
.designer-head-main { min-width: 0; flex: 1 1 320px; }
|
|
.rename-form { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
|
|
.rename-form .btn { padding: 7px 12px; font-size: 13px; flex: none; }
|
|
.title-input {
|
|
width: min(420px, 100%);
|
|
padding: 6px 10px;
|
|
border: 1px solid transparent;
|
|
border-radius: 8px;
|
|
background: transparent;
|
|
font: inherit;
|
|
font-size: 24px;
|
|
font-weight: 700;
|
|
letter-spacing: -.3px;
|
|
color: var(--ink);
|
|
}
|
|
.title-input:hover { border-color: var(--line); background: #fff; }
|
|
.title-input:focus {
|
|
border-color: var(--brand);
|
|
background: #fff;
|
|
outline: none;
|
|
box-shadow: 0 0 0 3px rgba(15, 118, 110, .16);
|
|
}
|
|
|
|
.designer-grid {
|
|
display: grid;
|
|
grid-template-columns: 200px minmax(0, 1fr) 260px;
|
|
gap: 14px;
|
|
align-items: start;
|
|
}
|
|
|
|
/* -- bara de sus: adaugare, dimensiuni, zoom, zona sigura ---------------- */
|
|
.designer-toolbar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: flex-start;
|
|
gap: 22px;
|
|
padding: 12px 16px 14px;
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
.designer-toolbar h2 {
|
|
margin: 0 0 7px;
|
|
font-size: 11px;
|
|
text-transform: uppercase;
|
|
letter-spacing: .5px;
|
|
color: var(--muted);
|
|
white-space: nowrap;
|
|
}
|
|
.tool-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
}
|
|
.tool-grow { flex: 1 1 320px; }
|
|
.tool-group + .tool-group {
|
|
padding-left: 22px;
|
|
border-left: 1px solid var(--line);
|
|
}
|
|
.tool-fields { display: flex; gap: 10px; }
|
|
.tool-fields .field { gap: 4px; }
|
|
.tool-fields .field > label { font-size: 11.5px; }
|
|
.tool-fields input { width: 82px; padding: 7px 9px; }
|
|
.zoom-slider { width: 130px; margin: 6px 0 0; }
|
|
.tool-safe { min-width: 168px; }
|
|
.tool-safe .check { font-size: 13px; }
|
|
.tool-safe .safe-hint { max-width: 210px; margin-top: 6px; }
|
|
.tool-safe #safe-arrange {
|
|
margin-top: 8px;
|
|
width: 100%;
|
|
justify-content: center;
|
|
padding: 7px 10px;
|
|
font-size: 12.5px;
|
|
line-height: 1.25;
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
.tool-group + .tool-group { padding-left: 0; border-left: 0; }
|
|
}
|
|
|
|
@media (max-width: 1100px) {
|
|
.designer-grid { grid-template-columns: 1fr; }
|
|
.designer-canvas-wrap { order: 1; }
|
|
.designer-elements { order: 2; position: static; }
|
|
#props { order: 3; position: static; }
|
|
.designer-elements .block-list { max-height: 260px; }
|
|
}
|
|
|
|
.designer-panel {
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: var(--radius);
|
|
padding: 16px;
|
|
box-shadow: var(--shadow);
|
|
position: sticky;
|
|
top: 72px;
|
|
}
|
|
.designer-panel h2 {
|
|
margin: 0 0 10px;
|
|
font-size: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: .5px;
|
|
color: var(--muted);
|
|
}
|
|
.designer-panel h2 .count {
|
|
display: inline-block;
|
|
min-width: 20px;
|
|
margin-left: 4px;
|
|
padding: 1px 6px;
|
|
border-radius: 999px;
|
|
background: var(--panel-soft);
|
|
color: #334155;
|
|
font-size: 11px;
|
|
text-align: center;
|
|
}
|
|
.designer-panel h2:not(:first-child) { margin-top: 18px; }
|
|
.designer-panel h3 {
|
|
margin: 16px 0 8px;
|
|
font-size: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: .5px;
|
|
color: var(--muted);
|
|
}
|
|
.designer-panel .field { margin-bottom: 8px; }
|
|
.designer-panel .field > label { font-size: 12px; }
|
|
.designer-panel .btn { padding: 8px 12px; font-size: 13px; }
|
|
|
|
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
.palette-btn {
|
|
padding: 8px 12px;
|
|
border: 1px solid #c8d3e0;
|
|
border-radius: 8px;
|
|
background: #fff;
|
|
font: inherit;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
.palette-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
|
|
|
|
.designer-elements .block-list {
|
|
max-height: calc(100vh - 330px);
|
|
overflow-y: auto;
|
|
padding-right: 2px;
|
|
}
|
|
|
|
.block-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
.block-item {
|
|
width: 100%;
|
|
text-align: left;
|
|
padding: 7px 9px;
|
|
border: 1px solid transparent;
|
|
border-radius: 6px;
|
|
background: var(--panel-soft);
|
|
font: inherit;
|
|
font-size: 12.5px;
|
|
cursor: pointer;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.block-item:hover { background: #eef2f6; }
|
|
.block-item.active { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
|
|
|
|
.designer-canvas-wrap { min-width: 0; }
|
|
.canvas-scroll {
|
|
overflow: auto;
|
|
padding: 18px;
|
|
background:
|
|
linear-gradient(#f1f5f9, #f1f5f9) padding-box,
|
|
var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
.canvas-stage { display: flex; justify-content: center; }
|
|
.design-canvas {
|
|
position: relative;
|
|
background: #fff;
|
|
box-shadow: 0 4px 18px rgba(15, 23, 42, .16);
|
|
outline: 1px solid #cbd5e1;
|
|
flex: none;
|
|
touch-action: none;
|
|
}
|
|
.canvas-grid {
|
|
position: absolute;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
background-image:
|
|
linear-gradient(to right, rgba(15, 23, 42, .07) 1px, transparent 1px),
|
|
linear-gradient(to bottom, rgba(15, 23, 42, .07) 1px, transparent 1px);
|
|
background-size: var(--grid, 60px) var(--grid, 60px);
|
|
}
|
|
.canvas-blocks { position: absolute; inset: 0; }
|
|
|
|
/* Conturul zonei sigure: 3 mm de la marginea etichetei. Doar vizual. */
|
|
.canvas-safe {
|
|
position: absolute;
|
|
border: 1px dashed #dc2626;
|
|
pointer-events: none;
|
|
z-index: 3;
|
|
}
|
|
.canvas-safe span {
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 3px;
|
|
font-size: 8px;
|
|
line-height: 1;
|
|
letter-spacing: .3px;
|
|
text-transform: uppercase;
|
|
color: #dc2626;
|
|
opacity: .65;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.safe-hint { margin: 4px 0 0; font-size: 12px; }
|
|
.safe-hint.ok { color: #15803d; }
|
|
.safe-hint.warn { color: #b91c1c; font-weight: 600; }
|
|
|
|
.c-block {
|
|
position: absolute;
|
|
box-sizing: border-box;
|
|
cursor: move;
|
|
user-select: none;
|
|
outline: 1px solid transparent;
|
|
}
|
|
.c-block:hover { outline-color: rgba(15, 118, 110, .45); }
|
|
.c-block.selected { outline: 2px solid var(--brand); }
|
|
.c-block.outside-safe { outline: 1px dashed #dc2626; }
|
|
.c-block.outside-safe.selected { outline: 2px solid var(--brand); }
|
|
.c-block.outside-safe::after {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
background: rgba(220, 38, 38, .08);
|
|
pointer-events: none;
|
|
}
|
|
.c-block.c-line { min-height: 0; }
|
|
.c-block.c-media { overflow: hidden; }
|
|
.c-block.c-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
|
|
.c-block.c-empty { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 4px, #e2e8f0 4px, #e2e8f0 8px); }
|
|
.c-block .d-item { white-space: nowrap; }
|
|
.c-block .d-item-w { font-weight: 700; }
|
|
|
|
/* Manerul sta in interiorul blocului: blocurile media au overflow:hidden si
|
|
* ar taia un maner pozitionat in afara (nu ar mai putea fi apucat). */
|
|
.c-resize {
|
|
position: absolute;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: 11px;
|
|
height: 11px;
|
|
border-radius: 2px;
|
|
background: var(--brand);
|
|
border: 1px solid #fff;
|
|
box-shadow: 0 0 0 1px rgba(15, 23, 42, .15);
|
|
cursor: nwse-resize;
|
|
display: none;
|
|
z-index: 2;
|
|
}
|
|
.c-block.selected .c-resize { display: block; }
|
|
|
|
.props-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
.props-row { display: flex; gap: 8px; }
|
|
.props-checks { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
|
|
.props-checks .check { font-size: 12.5px; }
|
|
.designer-panel input[type="color"] { width: 100%; height: 34px; padding: 2px; }
|
|
.designer-clear { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
|
|
|
|
/* -- popup: alegerea campului variabil ----------------------------------- */
|
|
.picker {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 60;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
.picker-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
|
|
.picker-card {
|
|
position: relative;
|
|
width: min(520px, 100%);
|
|
max-height: min(640px, calc(100vh - 40px));
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
padding: 18px;
|
|
background: var(--panel);
|
|
border: 1px solid var(--line);
|
|
border-radius: var(--radius);
|
|
box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
|
|
}
|
|
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
.picker-head h2 { margin: 0; font-size: 16px; }
|
|
.picker-close {
|
|
padding: 2px 8px;
|
|
border: 0;
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
font-size: 22px;
|
|
line-height: 1;
|
|
color: var(--muted);
|
|
cursor: pointer;
|
|
}
|
|
.picker-close:hover { background: var(--panel-soft); color: var(--ink); }
|
|
.picker-list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
min-height: 120px;
|
|
overflow-y: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 3px;
|
|
}
|
|
.picker-group {
|
|
padding: 10px 4px 3px;
|
|
font-size: 10.5px;
|
|
text-transform: uppercase;
|
|
letter-spacing: .5px;
|
|
color: var(--muted);
|
|
}
|
|
.picker-item {
|
|
width: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding: 8px 10px;
|
|
border: 1px solid transparent;
|
|
border-radius: 8px;
|
|
background: var(--panel-soft);
|
|
font: inherit;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
}
|
|
.picker-item:hover, .picker-item:focus-visible {
|
|
border-color: var(--brand);
|
|
background: var(--brand-soft);
|
|
outline: none;
|
|
}
|
|
.picker-label { font-size: 13.5px; font-weight: 600; }
|
|
.picker-item.recent .picker-label::after {
|
|
content: ' · ultimul';
|
|
font-size: 11px;
|
|
font-weight: 400;
|
|
color: var(--brand);
|
|
}
|
|
.picker-sample { font-size: 11.5px; color: var(--muted); }
|
|
.picker-empty { padding: 18px 6px; text-align: center; font-size: 13px; color: var(--muted); }
|
|
.picker-foot {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
padding-top: 8px;
|
|
border-top: 1px solid var(--line);
|
|
}
|
|
.picker-foot-actions { display: flex; align-items: center; gap: 12px; }
|
|
.picker-item.custom .picker-label::before {
|
|
content: '★ ';
|
|
color: var(--brand);
|
|
}
|
|
.picker-item.picked {
|
|
border-color: var(--brand);
|
|
background: var(--brand-soft);
|
|
}
|
|
.picker-check {
|
|
display: inline-grid;
|
|
place-items: center;
|
|
width: 14px;
|
|
height: 14px;
|
|
margin-right: 6px;
|
|
border: 1px solid #94a3b8;
|
|
border-radius: 3px;
|
|
background: #fff;
|
|
font-size: 10px;
|
|
line-height: 1;
|
|
color: var(--brand);
|
|
vertical-align: middle;
|
|
}
|
|
.picker-item.picked .picker-check { border-color: var(--brand); }
|
|
|
|
/* -- continutul codului QR ------------------------------------------------ */
|
|
.qr-parts { margin-top: 6px; }
|
|
.qr-parts-head {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
margin-bottom: 6px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: #334155;
|
|
}
|
|
.qr-part-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
|
|
.qr-part {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 5px 6px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 7px;
|
|
background: var(--panel-soft);
|
|
}
|
|
.qr-part-num {
|
|
flex: none;
|
|
display: grid;
|
|
place-items: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: 50%;
|
|
background: #e2e8f0;
|
|
font-size: 10.5px;
|
|
font-weight: 700;
|
|
color: #475569;
|
|
}
|
|
.qr-part-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
|
|
.qr-part-body strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.qr-part-sample { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.qr-part input[type="text"] { flex: 1 1 auto; min-width: 0; padding: 5px 7px; font-size: 12px; }
|
|
.qr-part-tools { display: flex; gap: 2px; flex: none; }
|
|
.qr-part-btn {
|
|
width: 22px;
|
|
height: 22px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 5px;
|
|
background: #fff;
|
|
font: inherit;
|
|
font-size: 12px;
|
|
line-height: 1;
|
|
color: #475569;
|
|
cursor: pointer;
|
|
}
|
|
.qr-part-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
|
|
.qr-part-btn:disabled { opacity: .35; cursor: default; }
|
|
.qr-part-btn.danger:hover { border-color: #dc2626; color: #dc2626; }
|
|
.qr-part-actions { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
.qr-part-actions .btn { padding: 6px 10px; font-size: 12.5px; }
|
|
.qr-preview-line {
|
|
margin: 0 0 8px;
|
|
padding: 5px 7px;
|
|
border: 1px dashed var(--line);
|
|
border-radius: 6px;
|
|
font-size: 12px;
|
|
word-break: break-all;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
.hidden { display: none !important; }
|