Compare commits
No commits in common. "fecd6e866fe062bcfb207bcdc8221e7669767870" and "54f125ab41e1c4bd260b4e7ff232df62d2ce3fa5" have entirely different histories.
fecd6e866f
...
54f125ab41
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 14 KiB |
|
@ -13,13 +13,6 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
|||
});
|
||||
}
|
||||
|
||||
const recipes_labels = document.querySelectorAll(".recipe-wrapper > label");
|
||||
for (const label of recipes_labels) {
|
||||
label.addEventListener("mouseenter", function () {
|
||||
highlight_ingredients(this);
|
||||
});
|
||||
}
|
||||
|
||||
calc_total_ingredients();
|
||||
});
|
||||
|
||||
|
@ -31,30 +24,6 @@ function update_synth_completions(recipe) {
|
|||
}
|
||||
}
|
||||
|
||||
function highlight_ingredients(label) {
|
||||
let mats = [];
|
||||
const ingredients = label.querySelectorAll("label ul li");
|
||||
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
elem.style.color = "#fff";
|
||||
for (const mat of mats) {
|
||||
if (elem.innerHTML.includes(mat)) {
|
||||
elem.style.color = "limegreen";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calc_total_ingredients() {
|
||||
const needed = new Map();
|
||||
const recipes = document.querySelectorAll(".recipe");
|
||||
|
@ -89,12 +58,6 @@ function calc_total_ingredients() {
|
|||
for (const entry of sortedMap) {
|
||||
const liElem = document.createElement("li");
|
||||
liElem.innerHTML = entry[0] + " x" + entry[1];
|
||||
liElem.addEventListener("click", function () {
|
||||
const isCrossed = this.style.textDecoration === "line-through";
|
||||
this.style.textDecoration = isCrossed ? "none" : "line-through";
|
||||
this.style.color = isCrossed ? "#fff" : "#f00";
|
||||
});
|
||||
|
||||
uiList.appendChild(liElem);
|
||||
}
|
||||
matsList.appendChild(uiList);
|
||||
|
|
|
@ -16,11 +16,6 @@
|
|||
height: 90%;
|
||||
list-style: none;
|
||||
line-height: 2;
|
||||
user-select: none;
|
||||
|
||||
li {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|