1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <!DOCTYPE html>
<html>
<head>
<title>Fonctionnement des tarifs régressifs</title>
<style>
body {
text-align: center;
}
h1 {
text-decoration: underline;
color: #333;
}
p {
font-size: 18px;
margin: 10px 0;
}
input[type="number"] {
width: 60px;
font-size: 18px;
text-align: center;
}
button {
font-size: 18px;
padding: 10px 20px;
border: none;
background-color: #333;
color: #fff;
cursor: pointer;
}
#resultat {
margin: auto;
font-size: 18px;
list-style: none;
padding: 0;
max-width: 50%;
}
#resultat li {
font-size: 18px;
margin: 10px 0;
border-bottom: 1px solid #ccc;
padding: 10px 0;
}
#resultat li span {
font-weight: bold;
color: #333;
}
</style>
</head>
<body>
<h1>Grille Tarifaire</h1>
<p>Entrez le prix de vente pour 1 gramme :</p>
<input id="prixGramme" type="number" value="10">/g
<button onclick="afficherListeTarifaire()">Afficher la liste tarifaire</button>
<ul id="resultat"></ul>
<script>
function afficherListeTarifaire() {
var prixGramme = document.getElementById("prixGramme").value;
var resultat = "";
resultat += "<h2>Pour un produit ayant : " + prixGramme + " comme prix de base / gramme, voici les différents prix :</h2>";
resultat += "<li>Conditionnement de 1 gramme : <span>" + (prixGramme * 1) + "</span> (" + prixGramme + "/g)</li>";
resultat += "<li>Conditionnement de 2 grammes : <span>" + (prixGramme * 2 * 0.9) + "</span> (" + (prixGramme * 0.9).toFixed(2) + "/g) (- 10%)</li>";
resultat += "<li>Conditionnement de 5 grammes : <span>" + (prixGramme * 5 * 0.8) + "</span> (" + (prixGramme * 0.8).toFixed(2) + "/g) (- 20%)</li>";
resultat += "<li>Conditionnement de 10 grammes : <span>" + (prixGramme * 10 * 0.7) + "</span> (" + (prixGramme * 0.7).toFixed(2) + "/g) (- 30%)</li>";
resultat += "<li>Conditionnement de 20 grammes : <span>" + (prixGramme * 20 * 0.5) + "</span> (" + (prixGramme * 0.5).toFixed(2) + "/g) (- 50%)</li>";
resultat += "<li>Conditionnement de 50 grammes : <span>" + (prixGramme * 50 * 0.35) + "</span> (" + (prixGramme * 0.35).toFixed(2) + "/g) (- 65%)</li>";
document.getElementById("resultat").innerHTML = resultat;
}
</script>
</body>
</html> |
Partager