Compare commits
5 Commits
b9282962f9
...
04dc1e6b90
Author | SHA1 | Date | |
---|---|---|---|
04dc1e6b90 | |||
6b964c81a8 | |||
fb83a94d4b | |||
b17f21a04f | |||
da5dc1da3b |
@ -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="savic-xl"/>
|
<input type="checkbox" id="SavicSuiteRoyaleXL"/>
|
||||||
<div>
|
<div>
|
||||||
<img src="assets/img/savic-xl.jpeg">
|
<img src="assets/img/savic-xl.jpeg">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label for="savic-xl"> Savic Suite Royale XL</label>
|
<label for="SavicSuiteRoyaleXL"> 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="savic-95"/>
|
<input type="checkbox" id="SavicSuiteRoyale95Double"/>
|
||||||
<div>
|
<div>
|
||||||
<img src="assets/img/savic-95-double.jpg">
|
<img src="assets/img/savic-95-double.jpg">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label for="savic-95">Savic Suite Royale 95 Double</label>
|
<label for="SavicSuiteRoyale95Double">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="tiaki"/>
|
<input type="checkbox" id="TiakiKleintierkäfigEtagere"/>
|
||||||
<div>
|
<div>
|
||||||
<img src="assets/img/tiaki.jpeg">
|
<img src="assets/img/tiaki.jpeg">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label>TIAKI Kleintierkäfig Étagère</label>
|
<label for="TiakiKleintierkäfigEtagere">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</label>
|
<label for="width">Breite (cm)</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</label>
|
<label for="depth">Tiefe (cm)</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</label>
|
<label for="height">Höhe (cm)</label>
|
||||||
<input class="measurement" type="number" id="height">
|
<input class="measurement" type="number" id="height">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -89,6 +89,39 @@
|
|||||||
</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");
|
||||||
@ -103,8 +136,18 @@
|
|||||||
// Full floor functions
|
// Full floor functions
|
||||||
var fullFloorNum = document.getElementById("numFullFloors");
|
var fullFloorNum = document.getElementById("numFullFloors");
|
||||||
|
|
||||||
|
function getCageDimensions(cageName) {
|
||||||
var savicSuiteRoyaleDim = new Dimensions(1, 0.5, 1);
|
console.log(cageName);
|
||||||
|
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)
|
||||||
@ -125,8 +168,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
var failed_checks = cageCheck(savicSuiteRoyaleDim, ratSlider.value, fullFloorNum.value);
|
const width = inputWidth.value
|
||||||
var resultsDiv = document.getElementById("resultsDiv");
|
const depth = inputDepth.value
|
||||||
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user