generated from cuisine/gratin-dauphinois
50 lines
1.6 KiB
HTML
50 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Gratin Dauphinois</title>
|
|
<style>
|
|
body { font-family: sans-serif; padding: 2rem; line-height: 1.6; }
|
|
input { width: 4rem; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Gratin Dauphinois — Recette Ajustable</h1>
|
|
|
|
<p>Choisissez le nombre de personnes :</p>
|
|
<input type="number" id="portions" value="4" min="1" onchange="updateQuantities()"> personnes
|
|
|
|
<h2>Ingrédients</h2>
|
|
<ul>
|
|
<li><span id="pommes">1</span> kg de pommes de terre</li>
|
|
<li><span id="creme">25</span> cl de crème fraîche épaisse</li>
|
|
<li><span id="lait">25</span> cl de lait entier</li>
|
|
<li><span id="ail">1</span> gousse d'ail</li>
|
|
<li><span id="fromage">60</span> g de fromage râpé</li>
|
|
<li>Noix de muscade, sel, poivre</li>
|
|
</ul>
|
|
|
|
<h2>Instructions</h2>
|
|
<p>Suivez les étapes habituelles pour préparer le gratin dauphinois.</p>
|
|
|
|
<script>
|
|
const base = {
|
|
pommes: 1,
|
|
creme: 25,
|
|
lait: 25,
|
|
ail: 1,
|
|
fromage: 60
|
|
};
|
|
|
|
function updateQuantities() {
|
|
const portions = document.getElementById("portions").value;
|
|
document.getElementById("pommes").textContent = (base.pommes * portions / 4).toFixed(2);
|
|
document.getElementById("creme").textContent = (base.creme * portions / 4).toFixed(2);
|
|
document.getElementById("lait").textContent = (base.lait * portions / 4).toFixed(2);
|
|
document.getElementById("ail").textContent = Math.ceil(base.ail * portions / 4);
|
|
document.getElementById("fromage").textContent = (base.fromage * portions / 4).toFixed(0);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|