forked from mpuchstein/VapeHP
added folders
This commit is contained in:
33
aromacalc/aromacalc.js
Normal file
33
aromacalc/aromacalc.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
let buttoncalc = document.getElementById("calculate")
|
||||||
|
buttoncalc.addEventListener("click", calculate)
|
||||||
|
|
||||||
|
function calculate(){
|
||||||
|
let aromaamount = document.getElementById("aromaamount").value
|
||||||
|
let aromaconc = document.getElementById("aromaconc").value / 100
|
||||||
|
let vg = document.getElementById("vg").value
|
||||||
|
let pg = document.getElementById("pg").value
|
||||||
|
let other = document.getElementById("other").value
|
||||||
|
let nicdose = document.getElementById("nicdose").value
|
||||||
|
let nicshotamount = document.getElementById("nicshotamount").value
|
||||||
|
let nicshotnicppm = document.getElementById("nicshotnicppm").value
|
||||||
|
let nicshotvg = document.getElementById("nicshotvg").value
|
||||||
|
let nicshotpg = document.getElementById("nicshotpg").value
|
||||||
|
|
||||||
|
if(vg * 1 + pg * 1 + other * 1 != 100){
|
||||||
|
} else if(nicshotvg * 1 + nicshotpg * 1 != 100){
|
||||||
|
} else {
|
||||||
|
|
||||||
|
document.getElementById("results").style.display="block"
|
||||||
|
let volume = aromaamount / aromaconc
|
||||||
|
let countnicshot = (volume * nicdose) / (nicshotamount * nicshotnicppm)
|
||||||
|
let amountothers = volume / 100 * other
|
||||||
|
let amountvg = volume / 100 * vg - countnicshot * nicshotamount * nicshotvg / 100
|
||||||
|
let amountpg = volume / 100 * pg - countnicshot * nicshotamount * nicshotpg / 100 - aromaamount
|
||||||
|
|
||||||
|
document.getElementById("volume").value = volume
|
||||||
|
document.getElementById("countnicshot").value = countnicshot
|
||||||
|
document.getElementById("amountothers").value = amountothers
|
||||||
|
document.getElementById("amountvg").value = amountvg
|
||||||
|
document.getElementById("amountpg").value = amountpg
|
||||||
|
}
|
||||||
|
}
|
87
aromacalc/index.html
Normal file
87
aromacalc/index.html
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<body>
|
||||||
|
<h1>Aroma Calculator</h1><br><br>
|
||||||
|
<table>
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<caption>Mischrechner</caption>
|
||||||
|
<tr>
|
||||||
|
<td><label for="aromaamount"> Aromamenge:</label></td>
|
||||||
|
<td><input type="text" id="aromaamount" name="aromaamount"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="aromaconc"> Aromakonzentration in %:</label></td>
|
||||||
|
<td><input type="text" id="aromaconc" name="aromaconc"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="vg"> Teile VG:</label></td>
|
||||||
|
<td><input type="text" id="vg" name="vg"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="pg"> Teile PG:</label></td>
|
||||||
|
<td><input type="text" id="pg" name="pg"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="other"> Teile Sonstiges:</label></td>
|
||||||
|
<td><input type="text" id="other" name="other"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="nicdose"> Nikotindosis:</label></td>
|
||||||
|
<td><input type="text" id="nicdose" name="nicdose"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<caption>Nikotinshot</caption>
|
||||||
|
<tr>
|
||||||
|
<td><label for="nicshotamount"> Menge:</label></td>
|
||||||
|
<td><input type="text" id="nicshotamount" name="nicshotamount"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="nicshotnicppm"> Nikotin pro mL:</label></td>
|
||||||
|
<td><input type="text" id="nicshotnicppm" name="nicshotnicppm"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="nicshotvg"> Teile VG:</label></td>
|
||||||
|
<td><input type="text" id="nicshotvg" name="nicshotvg"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="nicshotpg"> Teile PG:</label></td>
|
||||||
|
<td><input type="text" id="nicshotpg" name="nicshotpg"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</table>
|
||||||
|
<button id="calculate" type="button">Berechne</button>
|
||||||
|
<table style="display:none" id="results">
|
||||||
|
<caption>Ergebnisse:</caption>
|
||||||
|
<tr>
|
||||||
|
<td><label for="volume"> Gesamtmenge:</label></td>
|
||||||
|
<td><input type="text" id="volume" name="volume"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="countnicshot"> Zahl Nikotinshots:</label></td>
|
||||||
|
<td><input type="text" id="countnicshot" name="countnicshot"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="amountvg"> Menge VG:</label></td>
|
||||||
|
<td><input type="text" id="amountvg" name="amountvg"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="amountpg"> Menge PG:</label></td>
|
||||||
|
<td><input type="text" id="amountpg" name="amountpg"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="amountothers"> Menge Sonstiges:</label></td>
|
||||||
|
<td><input type="text" id="amountothers" name="amountothers"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<script src="aromacalc.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</head>
|
||||||
|
</html>
|
||||||
|
|
Reference in New Issue
Block a user