Compare commits
3 Commits
cfe305e698
...
154f550775
Author | SHA1 | Date | |
---|---|---|---|
154f550775 | |||
cb71f61a91 | |||
168e4acf6a |
@@ -10,7 +10,10 @@
|
||||
"height-cm": "Höhe (cm)",
|
||||
"full-floors": "Vollebenen",
|
||||
"result": "Ergebnis",
|
||||
"input-data-num-rats": "Bitte gib erst die Maße des Käfigs ein, dann siehst du hier die Anzahl der Ratten die hineinpassen.",
|
||||
"number-of-rats": "Anzahl an Ratten",
|
||||
"please-input-cage-calc": "Stell ein für wie viel Ratten der Käfig sein soll, danach siehst du hier das Ergebnis.",
|
||||
"please-input-cage-check": "Bitte gib erst die Maße des Käfigs und die Anzahl an Ratten ein. Danach siehst du hier, ob der Käfig passt.",
|
||||
"give-feedback": "Feedback geben",
|
||||
"change-language": "Sprache ändern",
|
||||
"information-on-rat-husbandry": "Information",
|
||||
|
@@ -10,7 +10,10 @@
|
||||
"height-cm": "Height (cm)",
|
||||
"full-floors": "Full floors",
|
||||
"result": "Result",
|
||||
"input-data-num-rats": "Please input them measurements of the cage. Then you will see the number of rats allowed.",
|
||||
"number-of-rats": "Number of Rats",
|
||||
"please-input-cage-calc": "First put in how many rats should fit the cage. After that come back here.",
|
||||
"please-input-cage-check": "First put in how many rats should fit the cage and the cages measurements. After that come back here to see if they fit.",
|
||||
"give-feedback": "Give Feedback",
|
||||
"change-language": "Change language",
|
||||
"information-on-rat-husbandry": "Information",
|
||||
|
@@ -108,10 +108,11 @@
|
||||
<div class="card-footer is-fullwidth">
|
||||
<div class="card result-card" id="num-rats-result-card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-header-title is-3 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
<h2 class="card-header-title title is-2 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div id="num-rats-resultsDiv"></div>
|
||||
<div class="is-size-5" id="num-rats-resultsDiv"></div>
|
||||
<p data-i18n="input-data-num-rats">Bitte gib erst die Maße ein, dann siehst du hier die Anzahl der Ratten die hineinpassen.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,10 +135,11 @@
|
||||
<div class="card-footer is-fullwidth">
|
||||
<div class="card result-card" id="cage-calc-result-card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-header-title is-3 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
<h2 class="card-header-title title is-2 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div id="cageCalcResultsDiv"></div>
|
||||
<div class="is-size-5" id="cageCalcResultsDiv"></div>
|
||||
<p data-i18n="please-input-cage-calc">Stell ein für wie viel Ratten der Käfig sein soll, danach siehst du hier das Ergebnis</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -209,10 +211,12 @@
|
||||
<div class="card-footer is-fullwidth">
|
||||
<div class="card result-card" id="result-card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-header-title is-3 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
<h2 class="card-header-title title is-2 is-centered" data-i18n="result">Ergebnis</h2>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div id="resultsDiv"></div>
|
||||
<div id="resultsDiv">
|
||||
<p data-i18n="please-input-cage-check">Bitte gib erst die Maße des Käfigs und die Anzahl an Ratten ein. Danach siehst du hier, ob der Käfig passt.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
12
src/index.js
12
src/index.js
@@ -346,16 +346,16 @@ function formatCriteria(criteria) {
|
||||
function updateCageCheck() {
|
||||
labelNumRats.innerHTML = i18next.t("cage-for-x-rats", {"num_rats": ratSlider.value});
|
||||
|
||||
const width = inputWidth.value
|
||||
const depth = inputDepth.value
|
||||
const height = inputHeight.value
|
||||
const width = inputWidth.value;
|
||||
const depth = inputDepth.value;
|
||||
const height = inputHeight.value;
|
||||
const dimensions = new Dimensions(width / 100, depth / 100, height / 100);
|
||||
const validator = new Validator();
|
||||
const numRats = ratSlider.value;
|
||||
const numFullFloors = fullFloorNum.value;
|
||||
|
||||
|
||||
const failed_checks = validator.cageCheck(dimensions, numRats,);
|
||||
const failed_checks = validator.cageCheck(dimensions, numRats, numFullFloors);
|
||||
let resultsDiv = document.getElementById("resultsDiv");
|
||||
|
||||
const result = getResultFromChecks(failed_checks);
|
||||
@@ -409,7 +409,7 @@ function updateNumRatsCalculator() {
|
||||
const validator = new Validator();
|
||||
const failed_checks = validator.failCageNumberIndependent(dimensions, numFullFloors);
|
||||
|
||||
let overallArea = validator.getOverallArea(dimensions, );
|
||||
let overallArea = validator.getOverallArea(dimensions, numFullFloors);
|
||||
let allowedNumRats;
|
||||
try {
|
||||
allowedNumRats = validator.allowedNumberOfRats(overallArea);
|
||||
@@ -426,7 +426,7 @@ function updateNumRatsCalculator() {
|
||||
|
||||
resultsDiv.innerHTML = "";
|
||||
const p = document.createElement('p');
|
||||
p.textContent = i18next.t("cage-for-x-rats", {"num_rats": allowedNumRats});
|
||||
p.textContent = i18next.t("cage-for-x-rats", {"num_rats": Math.floor(allowedNumRats)});
|
||||
resultsDiv.appendChild(p);
|
||||
resultsDiv.appendChild(result);
|
||||
|
||||
|
Reference in New Issue
Block a user