From 0bbc03388aa2b9dcb4fc86cb6d3cef0a757f3d6d Mon Sep 17 00:00:00 2001 From: Matthias Puchstein Date: Sat, 27 Nov 2021 14:14:11 +0100 Subject: [PATCH] added folders --- aromacalc/aromacalc.js | 33 ++++++++++++++++ aromacalc/index.html | 87 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 aromacalc/aromacalc.js create mode 100644 aromacalc/index.html diff --git a/aromacalc/aromacalc.js b/aromacalc/aromacalc.js new file mode 100644 index 0000000..3c95ef4 --- /dev/null +++ b/aromacalc/aromacalc.js @@ -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 + } +} diff --git a/aromacalc/index.html b/aromacalc/index.html new file mode 100644 index 0000000..9800665 --- /dev/null +++ b/aromacalc/index.html @@ -0,0 +1,87 @@ + + + + +

Aroma Calculator



+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Mischrechner
+
+ + + + + + + + + + + + + + + + + + +
Nikotinshot
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +