commit 9dba07bc54813042c7f91cc3db4f19fa347703f0 Author: serveur Date: Sat Oct 17 19:10:30 2026 +0200 Branche dev diff --git a/assets/bassines.json b/assets/bassines.json new file mode 100644 index 0000000..0e823cd --- /dev/null +++ b/assets/bassines.json @@ -0,0 +1,17 @@ +{"bassines":[ + {"Nom":"Grande bassine ronde en fer","tare":6.500}, + {"Nom":"Grande bassine ronde verte","tare":2.700}, + {"Nom":"Grande bassine ronde verte","tare":2.700}, + {"Nom":"Grande bassine ronde verte","tare":2.700}, + {"Nom":"Moyenne bassine ovale en fer","tare":6.000}, + {"Nom":"Petite bassine ronde en fer","tare":2.700}, + {"Nom":"Petite bassine ronde bleue (Tonton Pierre)","tare":1.700}, + {"Nom":"Petite bassine ronde verte (JM)","tare":1.700}, + {"Nom":"Grande bassine verte","tare":2.700}, + {"Nom":"Moyenne bassine ronde (Couenne)","tare":4.900}, + {"Nom":"Grande bassine ovale en fer (Jeannot)","tare":6.000}, + {"Nom":"Caisse grise","tare":2.450}, + {"Nom":"Caisse verte","tare":2.600}, + {"Nom":"Bassine bleue (JM1)","tare":2.500}, + {"Nom":"Bassine verte (JM3)","tare":2.700} +]} \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..666b300 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,242 @@ +:root { + --bg: #f6f1ea; + --card: #ffffff; + --ink: #2b2420; + --muted: #7a6e65; + --line: #e6ddd2; + --accent: #8c2f2f; + --accent-dark: #742626; + --accent-soft: #f7e8e5; + --warn: #b35a00; + --warn-soft: #fff1e0; + --radius: 16px; + --shadow: 0 1px 2px rgba(43, 36, 32, 0.06), 0 6px 18px rgba(43, 36, 32, 0.06); +} + +* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; } +[hidden] { display: none !important; } + +body { + margin: 0; + background: var(--bg); + color: var(--ink); + font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + line-height: 1.35; + padding-bottom: env(safe-area-inset-bottom); +} + +/* ---------- Barre du haut (toujours visible) ---------- */ +.topbar { + position: sticky; + top: 0; + z-index: 10; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 10px 16px; + padding-top: calc(10px + env(safe-area-inset-top)); + background: var(--accent); + color: #fff; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); +} + +.topbar h1 { + margin: 0; + font-family: Georgia, "Times New Roman", serif; + font-size: 1.15rem; + font-weight: 700; +} + +.summary { display: flex; gap: 16px; text-align: right; } +.summary .lbl { display: block; font-size: 0.68rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.06em; } +.summary b { font-size: 1.05rem; font-variant-numeric: tabular-nums; } + +.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 40px; } + +/* ---------- Cartes génériques ---------- */ +.card { + background: var(--card); + border-radius: var(--radius); + box-shadow: var(--shadow); + padding: 16px; + margin-bottom: 14px; +} + +.card h2 { + margin: 0 0 12px; + font-size: 0.78rem; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--muted); +} + +.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 5px; } + +/* 16px minimum : évite le zoom automatique d'iOS au focus */ +input[type="text"], input[type="number"] { + width: 100%; + height: 48px; + font: inherit; + font-size: 1.1rem; + font-variant-numeric: tabular-nums; + padding: 0 12px; + border: 1.5px solid var(--line); + border-radius: 12px; + background: #fffdfa; + color: var(--ink); +} + +input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 47, 47, 0.18); } + +/* ---------- Rendement ---------- */ +.yield { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } +.yield .field { grid-column: 1 / -1; } + +.stat { background: #fbf7f1; border-radius: 12px; padding: 10px 12px; } +.stat .label { font-size: 0.75rem; color: var(--muted); } +.stat .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; } +.stat.big .value { color: var(--accent); } + +/* ---------- Réglages repliables ---------- */ +details.card { padding: 0; } +details summary { + list-style: none; + display: flex; + align-items: center; + justify-content: space-between; + min-height: 52px; + padding: 0 16px; + font-weight: 600; + cursor: pointer; +} +details summary::-webkit-details-marker { display: none; } +details summary::after { content: "▾"; color: var(--muted); transition: transform 0.15s; } +details[open] summary::after { transform: rotate(180deg); } +details .settings { padding: 0 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } +details .hint { grid-column: 1 / -1; margin: 0; font-size: 0.8rem; color: var(--muted); } + +/* ---------- Interrupteurs (couenne, filtre) ---------- */ +.switch { + position: relative; + display: inline-flex; + align-items: center; + gap: 8px; + min-height: 44px; + padding: 0 14px 0 10px; + border: 1.5px solid var(--line); + border-radius: 999px; + background: #fff; + font-weight: 600; + font-size: 0.92rem; + cursor: pointer; + user-select: none; +} +.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; } +.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d9cfc3; position: relative; transition: background 0.15s; flex: none; } +.switch .track::after { + content: ""; + position: absolute; + top: 2px; left: 2px; + width: 18px; height: 18px; + border-radius: 50%; + background: #fff; + transition: transform 0.15s; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); +} +.switch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } +.switch input:checked + .track { background: var(--accent); } +.switch input:checked + .track::after { transform: translateX(16px); } +.switch:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(140, 47, 47, 0.25); } + +.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; } +.count { font-size: 0.9rem; color: var(--muted); } +.count b { color: var(--accent); } + +/* ---------- Cartes bassines ---------- */ +.bassines { display: grid; gap: 12px; } + +.bassine { + background: var(--card); + border-radius: var(--radius); + box-shadow: var(--shadow); + border: 2px solid transparent; + padding: 14px; +} +.bassine.filled { border-color: var(--accent); background: #fffaf9; } +.bassine.warn { border-color: var(--warn); background: var(--warn-soft); } + +.b-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; } +.b-name { font-weight: 700; font-size: 1.05rem; } +.b-tare { font-size: 0.8rem; color: var(--muted); } + +.b-input label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; } +.input-wrap { position: relative; } +.input-wrap input { height: 56px; font-size: 1.5rem; font-weight: 600; padding-right: 52px; } +.clear { + position: absolute; + right: 6px; top: 6px; + width: 44px; height: 44px; + border: none; + border-radius: 10px; + background: transparent; + color: var(--muted); + font-size: 1.1rem; + cursor: pointer; +} +.clear:active { background: var(--line); } +.input-wrap input:placeholder-shown + .clear { display: none; } + +.b-results { margin-top: 12px; } +.b-net { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; } +.b-net .lbl { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; } +.b-net .val { font-size: 1.7rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; } +.b-net .unit { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-left: 3px; } +.warn .b-net .val { color: var(--warn); } + +.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; } +.tile { grid-column: span 2; background: #fbf7f1; border-radius: 10px; padding: 8px 6px; text-align: center; } +.tile:nth-child(n+4) { grid-column: span 3; } +.tile .t-lbl { display: block; font-size: 0.7rem; color: var(--muted); } +.tile .t-val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; } + +.b-warn { margin: 10px 0 0; font-size: 0.85rem; color: var(--warn); font-weight: 600; } + +/* ---------- Totaux ---------- */ +.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } +.totals .stat:first-child { grid-column: 1 / -1; background: var(--accent-soft); } +.totals .unit { font-size: 0.8rem; font-weight: 400; color: var(--muted); } + +/* ---------- Actions ---------- */ +.actions { display: grid; gap: 10px; } +.btn { + font: inherit; + font-weight: 700; + min-height: 52px; + border-radius: 14px; + border: 1.5px solid var(--line); + background: var(--card); + color: var(--ink); + cursor: pointer; +} +.btn:active { transform: scale(0.99); } +.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } +.btn.primary:active { background: var(--accent-dark); } + +/* ---------- Grands écrans : deux colonnes ---------- */ +@media (min-width: 900px) { + .wrap { max-width: 1000px; } + .bassines { grid-template-columns: 1fr 1fr; } + .actions { grid-template-columns: 1fr 1fr; } +} + +/* ---------- Impression : uniquement ce qui a été pesé ---------- */ +@media print { + body { background: #fff; } + .topbar, .no-print, .clear { display: none !important; } + .card, .bassine { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; } + .bassine:not(.filled) { display: none; } + .bassines { grid-template-columns: 1fr 1fr; } + input { border: none; background: none; } + details { display: none; } +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..41782ae Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..8aff3de --- /dev/null +++ b/index.html @@ -0,0 +1,380 @@ + + + + + + + + Calculateur d'épices + + +
+

Saucissons Murats

+
+
Viande nette0.000 kg
+
Rendement0 %
+
+
+ +
+
+

Rendement

+
+
+ + +
+
+
Total assaisonné (kg)
+
0.000
+
+
+
Rendement
+
0 %
+
+
+
+ +
+ Réglages (planche et proportions) +
+
+ +
+ + 0 / 0 pesées +
+ +
+ +
+

Totaux

+
+
+ +
+ + +
+
+ + + +