From 033a5ad8b33feaf6bb9ce2ffb656a696e10730e0 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 31 Mar 2022 12:49:28 +0200 Subject: [PATCH] Update create.php --- create.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/create.php b/create.php index 1f8c6fc..3fddd6f 100644 --- a/create.php +++ b/create.php @@ -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; } +