Update create.php

This commit is contained in:
Jesse James Isler 2022-03-31 12:49:28 +02:00
parent 49dea27400
commit 033a5ad8b3

View File

@ -237,30 +237,32 @@
}
function updateColor() {
strength = document.getElementById("carddescription");
let color = document.getElementById('rolecolor');
let strength = document.getElementById("carddescription");
let modifier = document.getElementById("modifier");
let textcolor = document.getElementById("tcolor");
strength.removeAttribute('disabled');
modifier = document.getElementById("modifier");
modifier.removeAttribute('disabled');
if ($('#rolecolor').val() === "transparent" || $('#rolecolor').val() === "black" || $('#rolecolor').val() === "white") {
modifier.value = "";
if (color.value === "transparent" || color.value === "black" || color.value === "white") {
modifier.value = "";
modifier.setAttribute('disabled', '');
strength.value = "";
strength.setAttribute('disabled', '');
} else if ($('#rolecolor').val() === "brown" || $('#rolecolor').val() === "grey" || $('#rolecolor').val() === "blue-grey") {
} else if (color.value === "brown" || color.value === "grey" || color.value === "blue-grey") {
if ($('#modifier').val() === "accent") {
if (modifier.value === "accent") {
modifier.value = "";
strength.value = "";
}
}
document.getElementById("rolecard").className = "card " + $('#rolecolor').val() + " " + $('#modifier').val() + "-" + $('#strength').val() + " " + $('#tcolor').val();
document.getElementById("rolecard").className = "card " + color.value + " " + color.value + "-" + strength.value + " " + textcolor.value;
}
</script>
<!-- Start Tab init -->
<script>