diff --git a/public/scripts/kh1/synth.js b/public/scripts/kh1/synth.js index f743536..7a2a79b 100644 --- a/public/scripts/kh1/synth.js +++ b/public/scripts/kh1/synth.js @@ -33,14 +33,23 @@ function update_synth_completions(recipe) { function highlight_ingredients(label) { let mats = []; - const ingredients = label.querySelectorAll("label ul li"); + const ingredients = label.querySelectorAll("ul li"); + const checkbox = label.parentElement.querySelectorAll(".recipe")[0]; + + const elems = document.querySelectorAll("#mats ul li"); + + if (checkbox.checked) { + for (const elem of elems) { + elem.style.color = "#fff"; + } + return; + } for (const ingredient of ingredients) { const name = ingredient.dataset["synthItemName"]; mats.push(name); } - const elems = document.querySelectorAll("#mats ul li"); for (const elem of elems) { const isCrossed = elem.style.textDecoration === "line-through"; if (isCrossed) {