Compare commits

..

No commits in common. "04dc1e6b90fdcbfca98043e901d038e9ff2679f2" and "b9282962f9b9cbcaa00dd51001235c493c14bb98" have entirely different histories.

View File

@ -14,34 +14,34 @@
<div class="cage-selector"> <div class="cage-selector">
<div class="card"> <div class="card">
<div class="card-photo"> <div class="card-photo">
<input type="checkbox" id="SavicSuiteRoyaleXL"/> <input type="checkbox" id="savic-xl"/>
<div> <div>
<img src="assets/img/savic-xl.jpeg"> <img src="assets/img/savic-xl.jpeg">
</div> </div>
</div> </div>
<label for="SavicSuiteRoyaleXL"> Savic Suite Royale XL</label> <label for="savic-xl"> Savic Suite Royale XL</label>
</div> </div>
<div class="card"> <div class="card">
<div class="card-photo"> <div class="card-photo">
<input type="checkbox" id="SavicSuiteRoyale95Double"/> <input type="checkbox" id="savic-95"/>
<div> <div>
<img src="assets/img/savic-95-double.jpg"> <img src="assets/img/savic-95-double.jpg">
</div> </div>
</div> </div>
<label for="SavicSuiteRoyale95Double">Savic Suite Royale 95 Double</label> <label for="savic-95">Savic Suite Royale 95 Double</label>
</div> </div>
<div class="card"> <div class="card">
<div class="card-photo"> <div class="card-photo">
<input type="checkbox" id="TiakiKleintierkäfigEtagere"/> <input type="checkbox" id="tiaki"/>
<div> <div>
<img src="assets/img/tiaki.jpeg"> <img src="assets/img/tiaki.jpeg">
</div> </div>
</div> </div>
<label for="TiakiKleintierkäfigEtagere">TIAKI Kleintierkäfig Étagère</label> <label>TIAKI Kleintierkäfig Étagère</label>
</div> </div>
<div class="card"> <div class="card">
@ -50,15 +50,15 @@
<label for="form-cage-measurements">Käfigmaße</label> <label for="form-cage-measurements">Käfigmaße</label>
<form id="form-cage-measurements" class="form-measurements"> <form id="form-cage-measurements" class="form-measurements">
<div class="input-measurement"> <div class="input-measurement">
<label for="width">Breite (cm)</label> <label for="width">Breite</label>
<input class="measurement" type="number" id="width"> <input class="measurement" type="number" id="width">
</div> </div>
<div class="input-measurement"> <div class="input-measurement">
<label for="depth">Tiefe (cm)</label> <label for="depth">Tiefe</label>
<input class="measurement" type="number" id="depth"> <input class="measurement" type="number" id="depth">
</div> </div>
<div class="input-measurement"> <div class="input-measurement">
<label for="height">Höhe (cm)</label> <label for="height">Höhe</label>
<input class="measurement" type="number" id="height"> <input class="measurement" type="number" id="height">
</div> </div>
</form> </form>
@ -89,39 +89,6 @@
</div> </div>
<script> <script>
const inputWidth = document.getElementById("width");
const inputDepth = document.getElementById("depth");
const inputHeight = document.getElementById("height");
const selectSavicSuiteRoyaleXL = document.getElementById("SavicSuiteRoyaleXL");
const selectSavicSuiteRoyale95Double = document.getElementById("SavicSuiteRoyale95Double");
const selectTiakiKleintierkäfigEtagere = document.getElementById("TiakiKleintierkäfigEtagere");
function updateCage(event) {
console.log("dada");
selectSavicSuiteRoyaleXL.checked = false;
selectSavicSuiteRoyale95Double.checked = false;
selectTiakiKleintierkäfigEtagere.checked = false;
const selectedCage = event.currentTarget
selectedCage.checked = true;
const cageName = selectedCage.id;
console.log(cageName);
var dim = getCageDimensions(cageName);
inputWidth.value = dim.width;
inputDepth.value = dim.depth;
inputHeight.value = dim.height;
update();
}
selectSavicSuiteRoyaleXL.onchange = updateCage;
selectSavicSuiteRoyale95Double.onchange = updateCage;
selectTiakiKleintierkäfigEtagere.onchange = updateCage;
var labelNumRats = document.getElementById("labelNumRats"); var labelNumRats = document.getElementById("labelNumRats");
var ratSlider = document.getElementById("numRats"); var ratSlider = document.getElementById("numRats");
@ -136,18 +103,8 @@
// Full floor functions // Full floor functions
var fullFloorNum = document.getElementById("numFullFloors"); var fullFloorNum = document.getElementById("numFullFloors");
function getCageDimensions(cageName) {
console.log(cageName); var savicSuiteRoyaleDim = new Dimensions(1, 0.5, 1);
if (cageName == "SavicSuiteRoyaleXL") {
return new Dimensions(115, 67.5, 153);
}
if (cageName == "SavicSuiteRoyale95Double") {
return new Dimensions(95, 63, 120);
}
if (cageName == "TiakiKleintierkäfigEtagere") {
return new Dimensions(93.5, 63, 141.2);
}
}
function getResultFromChecks(checks) { function getResultFromChecks(checks) {
console.log(checks.length) console.log(checks.length)
@ -168,13 +125,8 @@
} }
function update() { function update() {
const width = inputWidth.value var failed_checks = cageCheck(savicSuiteRoyaleDim, ratSlider.value, fullFloorNum.value);
const depth = inputDepth.value var resultsDiv = document.getElementById("resultsDiv");
const height = inputHeight.value
const dimensions = new Dimensions(width/100, depth/100, height/100);
const failed_checks = cageCheck(dimensions, ratSlider.value, fullFloorNum.value);
console.log(failed_checks);
let resultsDiv = document.getElementById("resultsDiv");
resultsDiv.innerHTML = `<strong>Ergebnis</strong>`; resultsDiv.innerHTML = `<strong>Ergebnis</strong>`;
const result = getResultFromChecks(failed_checks); const result = getResultFromChecks(failed_checks);