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() { 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'); strength.removeAttribute('disabled');
modifier = document.getElementById("modifier");
modifier.removeAttribute('disabled'); modifier.removeAttribute('disabled');
if ($('#rolecolor').val() === "transparent" || $('#rolecolor').val() === "black" || $('#rolecolor').val() === "white") { if (color.value === "transparent" || color.value === "black" || color.value === "white") {
modifier.value = ""; modifier.value = "";
modifier.setAttribute('disabled', ''); modifier.setAttribute('disabled', '');
strength.value = ""; strength.value = "";
strength.setAttribute('disabled', ''); 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 = ""; modifier.value = "";
strength.value = ""; strength.value = "";
} }
} }
document.getElementById("rolecard").className = "card " + color.value + " " + color.value + "-" + strength.value + " " + textcolor.value;
document.getElementById("rolecard").className = "card " + $('#rolecolor').val() + " " + $('#modifier').val() + "-" + $('#strength').val() + " " + $('#tcolor').val();
} }
</script> </script>
<!-- Start Tab init --> <!-- Start Tab init -->
<script> <script>