code commit
This commit is contained in:
parent
353df74110
commit
487087472f
|
@ -0,0 +1,203 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
|
||||
<link rel="icon" type="image/png" href="https://www.cine-resonance.fr/Application/G1FABLAB.png">
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>G1Forfait PIF/PAF/POUF (UNL/ML) DU² - G1FabLab -</title>
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #333333;
|
||||
font-size: 2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
font-size: 1.5em;
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
font-size: 1.7em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 2em;
|
||||
margin-top: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type="radio"] + label {
|
||||
position: relative;
|
||||
padding-left: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="radio"] + label:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid #4CAF50;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
input[type="radio"]:checked + label:before {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 20px;
|
||||
font-size: 2em;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.calculate-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.calculator-container {
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.emoji-text {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.calculator-emoji {
|
||||
font-size: 2.4em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
.result {
|
||||
margin-top: 20px;
|
||||
font-size: 1.7em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Calculateur G1 COOL</h1>
|
||||
Trouvez facilement le forfait à pratiquer pour conserver votre activité dans un contexte inter "opérateurs monétaires"<br>
|
||||
PIF PAF ayez le forfait pour commercer en DU sans risquer de faire faillite en €.<br>
|
||||
|
||||
<br>
|
||||
<label for="pif">PIF (DU) par Unité :</label>
|
||||
<br>
|
||||
<input type="number" id="pif" min="1" class="input-field" value="3">
|
||||
<br>
|
||||
<label for="paf">PAF (€) par Unité :</label>
|
||||
<br>
|
||||
<input type="number" id="paf" min="1" class="input-field" value="40">
|
||||
<br>
|
||||
<label for="units">Nombre d'unités :</label>
|
||||
<br>
|
||||
<input type="number" id="units" min="1" class="input-field" value="1">
|
||||
|
||||
<p style="margin-bottom: 0px;">Choix du forfait :</p>
|
||||
<br>
|
||||
<input type="radio" id="price1" name="price" value="1">
|
||||
<label for="price1">Forfait Cool</label>
|
||||
|
||||
<br>
|
||||
<input type="radio" id="price2" name="price" value="2">
|
||||
<label for="price2">Forfait Juste</label>
|
||||
|
||||
<br>
|
||||
<input type="radio" id="price3" name="price" value="3" checked="checked">
|
||||
<label for="price3">Forfait Carré</label>
|
||||
|
||||
<p></p>
|
||||
<button class="btn-calculate" onclick="calculatePrice()">
|
||||
<span class="calculate-text">Calculer</span>
|
||||
</button>
|
||||
|
||||
<div class="result" id="result"><b>Pour nn unités :<br></b>xx €<br>yy DUs </div>
|
||||
<br>
|
||||
Calculateur pour marchand en herbe.<br>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function calculatePrice() {
|
||||
var pafInput = document.getElementById("paf").value;
|
||||
var paf = parseInt(pafInput);
|
||||
var pafBy2 = paf / 2;
|
||||
var pafBy4 = paf / 4;
|
||||
|
||||
var pifInput = document.getElementById("pif").value;
|
||||
var pif = parseInt(pifInput);
|
||||
|
||||
var units = parseInt(document.getElementById("units").value);
|
||||
if (isNaN(units) || units < 1) {
|
||||
document.getElementById("result").innerHTML = "Veuillez entrer un nombre entier supérieur ou égal à 1.";
|
||||
return;
|
||||
}
|
||||
|
||||
var priceType = parseInt(document.querySelector('input[name="price"]:checked').value);
|
||||
var totalPrice, totalDU, duText;
|
||||
|
||||
if (priceType === 1) {
|
||||
totalPrice = paf * units;
|
||||
totalDU = pif * units;
|
||||
duText = (totalDU === 1) ? "offert" : "offerts";
|
||||
} else if (priceType === 2) {
|
||||
totalPrice = pafBy2 * units;
|
||||
totalDU = pif * units;
|
||||
duText = "";
|
||||
} else if (priceType === 3) {
|
||||
totalPrice = pafBy4 * units;
|
||||
pouf = pif * units;
|
||||
totalDU = [...Array(pouf).keys()].map(i => Math.pow(i + 1, 2)).reduce((a, b) => a + b, 0);
|
||||
duText = (totalDU === 1) ? "" : "";
|
||||
}
|
||||
|
||||
var response = "<b>Pour " + units + " " + ((units === 1) ? "unité" : "unités") + " :<br></b>";
|
||||
response += totalPrice + "€<br>";
|
||||
response += totalDU + " DU" + ((totalDU === 1) ? "" : "s") + " " + duText;
|
||||
|
||||
document.getElementById("result").innerHTML = response;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body></html>
|
Loading…
Reference in New Issue