Aucune tâche pour l'instant.
+ +diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..adaa546 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:22-alpine + +WORKDIR /app +COPY server.js ./ +COPY public ./public + +# La to-do list est enregistrée dans /data (à monter en volume pour la conserver) +ENV PORT=3000 \ + DATA_FILE=/data/todos.json +RUN mkdir -p /data && chown node:node /data +VOLUME /data + +USER node +EXPOSE 3000 +HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/healthz || exit 1 +CMD ["node", "server.js"] diff --git a/assets/bassines.json b/assets/bassines.json deleted file mode 100644 index 0e823cd..0000000 --- a/assets/bassines.json +++ /dev/null @@ -1,17 +0,0 @@ -{"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 deleted file mode 100644 index 666b300..0000000 --- a/assets/style.css +++ /dev/null @@ -1,242 +0,0 @@ -: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/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..668431e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + epices: + build: . + restart: unless-stopped + ports: + - "3000:3000" # à retirer si tu passes par Traefik (labels à la place) + volumes: + - epices-data:/data + +volumes: + epices-data: diff --git a/public/assets/menu.css b/public/assets/menu.css new file mode 100644 index 0000000..b9d64e3 --- /dev/null +++ b/public/assets/menu.css @@ -0,0 +1,52 @@ +/* En-tête commun : titre + menu de navigation (utilisé par toutes les pages) */ +.topbar { + position: sticky; + top: 0; + z-index: 10; + background: var(--accent, #8c2f2f); + color: #fff; + padding: calc(8px + env(safe-area-inset-top)) 16px 0; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); +} + +.topbar-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + min-height: 40px; +} + +.topbar h1 { + margin: 0; + font-family: Georgia, "Times New Roman", serif; + font-size: 1.15rem; + font-weight: 700; +} + +.menu { display: flex; gap: 4px; margin: 2px -6px 0; } + +.menu a { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + min-height: 42px; + padding: 0 14px; + color: rgba(255, 255, 255, 0.78); + text-decoration: none; + font-weight: 600; + font-size: 0.95rem; + border-bottom: 3px solid transparent; +} + +.menu a:active { background: rgba(255, 255, 255, 0.12); } +.menu a[aria-current="page"] { color: #fff; border-bottom-color: #fff; } + +@media (min-width: 600px) { + .menu a { flex: 0 0 auto; padding: 0 22px; } +} + +@media print { + .topbar { display: none; } +} diff --git a/index.html b/public/index.html similarity index 60% rename from index.html rename to public/index.html index 8aff3de..70db9eb 100644 --- a/index.html +++ b/public/index.html @@ -4,16 +4,244 @@ -
Aucune tâche pour l'instant.
+ +