Compare commits
No commits in common. "7167d275b64302ad5733dad21a1eab8d9acf9448" and "01fc25f42a44ed77e0f06650966f9f69bb522abe" have entirely different histories.
7167d275b6
...
01fc25f42a
@ -41,10 +41,6 @@ h1, h2 {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.output-element {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
<label for="numRats" id="labelNumRats">Anzahl an Ratten ?</label>
|
||||
<input type="range" min="1" max="20" value="4" class="slider" id="numRats">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-element">
|
||||
<label for="numFullFloors">Vollebenen</label>
|
||||
@ -28,11 +27,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container output-element" id="resultsDiv">
|
||||
<div class="container" id="resultsDiv">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
|
||||
var labelNumRats = document.getElementById("labelNumRats");
|
||||
|
||||
@ -51,32 +52,19 @@
|
||||
|
||||
var savicSuiteRoyaleDim = new Dimensions(1, 0.5, 1);
|
||||
|
||||
function getResultFromChecks(checks) {
|
||||
console.log(checks.length)
|
||||
if (Object.keys(checks).length > 0) {
|
||||
const ul = document.createElement('ul');
|
||||
for (const key in checks) {
|
||||
const li = document.createElement('li');
|
||||
li.textContent = `❌` + checks[key];
|
||||
ul.appendChild(li);
|
||||
}
|
||||
return ul;
|
||||
} else {
|
||||
const p = document.createElement('p');
|
||||
p.innerHTML = "✅ Der Käfig erfüllt alle Kriterien!"
|
||||
return p;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
var failed_checks = cageCheck(savicSuiteRoyaleDim, ratSlider.value, fullFloorNum.value);
|
||||
var resultsDiv = document.getElementById("resultsDiv");
|
||||
resultsDiv.innerHTML = `<strong>Ergebnis</strong>`;
|
||||
|
||||
const result = getResultFromChecks(failed_checks);
|
||||
const ul = document.createElement('ul');
|
||||
for (const key in failed_checks) {
|
||||
const li = document.createElement('li');
|
||||
li.textContent = failed_checks[key];
|
||||
ul.appendChild(li);
|
||||
}
|
||||
|
||||
resultsDiv.appendChild(result);
|
||||
resultsDiv.appendChild(ul);
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +83,8 @@
|
||||
input.value = value + 1;
|
||||
update();
|
||||
}
|
||||
|
||||
update();
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user