separation du css et du html
This commit is contained in:
+2
-224
@@ -5,229 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#8c2f2f" />
|
||||
<title>Calculateur d'épices</title>
|
||||
<link rel="stylesheet" href="assets/menu.css" />
|
||||
<style>
|
||||
: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);
|
||||
}
|
||||
|
||||
/* ---------- Récapitulatif dans la barre du haut (le reste : assets/menu.css) ---------- */
|
||||
.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; }
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="assets/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
@@ -244,7 +22,7 @@
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="wrap">
|
||||
<main class="wrap wrap-large">
|
||||
<section class="card">
|
||||
<h2>Rendement</h2>
|
||||
<div class="yield">
|
||||
|
||||
Reference in New Issue
Block a user