diff --git a/website/scripts/recipe-catalogue.mjs b/website/scripts/recipe-catalogue.mjs index 7f309d76..1859d978 100644 --- a/website/scripts/recipe-catalogue.mjs +++ b/website/scripts/recipe-catalogue.mjs @@ -16,7 +16,14 @@ function item(command) { const custom = command.match(/"executableitems:ei-id":"([^"]+)"/)?.[1]; const name = command.match(/minecraft:custom_name=\{"text":"([^"]+)"/)?.[1] ?? material.replaceAll('_', ' ').replace(/\b\w/g, letter => letter.toUpperCase()); - return { id: custom ?? material, name, material, custom: Boolean(custom) }; + const result = entry(custom ?? material, name, material, Boolean(custom)); + const quality = command.match(/"dunerealms:quality":"([a-z_]+)"/)?.[1]; + const mark = command.match(/"dunerealms:equipment_mark":"(\d+)"/)?.[1]; + const lore = command.match(/minecraft:lore=(\[[^\]]*\])/); + if (quality) result.quality = quality; + if (mark) result.equipmentMark = Number(mark); + if (lore) result.lore = JSON.parse(lore[1]).map(line => line.text).filter(line => !/ \| MK /.test(line)); + return result; } export function recipeCatalogue() { @@ -44,7 +51,7 @@ export function recipeCatalogue() { const crafting = 'Crafting table'; for (const part of JSON.parse(readFileSync(repairParts, 'utf8'))) { const ingredient = item(part.material.toLowerCase()); - recipes.push({ id: part.id, station: crafting, inputs: [ingredient, spice], output: entry(part.id, part.name, ingredient.material, true), amount: 1, notes: part.purpose + ' Genuine Melange or Smuggled Spice works.' }); + recipes.push({ id: part.id, station: crafting, inputs: [ingredient, spice], output: { ...entry(part.id, part.name, ingredient.material, true), quality: "uncommon", equipmentMark: 1, lore: [part.purpose] }, amount: 1, notes: part.purpose + ' Genuine Melange or Smuggled Spice works.' }); } for (const [id, name, ingredient] of [['spice_block', 'Spice Block', spice], ['smuggled_spice_block', 'Smuggled Spice Block', smuggled]]) { recipes.push({ id, station: crafting, inputs: Array(9).fill(ingredient), output: entry(id, name, 'dried_kelp_block', true), amount: 1, shaped: true, notes: 'Fill all nine slots with the same kind of genuine spice.' }); diff --git a/website/web/imperial-recipe-book.css b/website/web/imperial-recipe-book.css index f6c1c76c..b540f4e7 100644 --- a/website/web/imperial-recipe-book.css +++ b/website/web/imperial-recipe-book.css @@ -25,6 +25,25 @@ #recipe .recipe-sheet a{text-decoration:underline;text-underline-offset:2px} #recipe-station{display:flex;align-items:center;gap:9px}#recipe-station img{width:28px;height:28px;object-fit:contain;image-rendering:pixelated} -.recipe-grid--crafting-table{padding:12px;gap:5px;border:3px solid #56391f;border-radius:6px;background:#80542c url('/recipe-icons/crafting-table-top.png') center/100% 100% no-repeat;image-rendering:pixelated} -.recipe-grid--crafting-table li{background:#f0ddb9d9;border-color:#5a3c26} -.recipe-grid--crafting-table li[aria-label]{background:#50331b39} + +#recipe-station-layout{display:grid;grid-template-columns:minmax(0,1fr) clamp(14px,6%,32px) minmax(36px,1fr);gap:clamp(6px,2vw,20px);align-items:center;width:min(100%,360px);padding:clamp(7px,2vw,17px);border:2px solid #65482e;border-radius:5px;background:#c6c4b7;box-shadow:inset 2px 2px #eeead5,inset -2px -2px #858176;box-sizing:border-box} +#recipe-station-layout.recipe-station--crafting{grid-template-columns:minmax(0,3fr) clamp(14px,8%,32px) minmax(32px,1fr)} +#recipe-grid{grid-template-columns:repeat(auto-fit,minmax(28px,1fr));gap:2px;margin:0} +.recipe-station--crafting #recipe-grid{grid-template-columns:repeat(3,minmax(0,1fr));} +#recipe-grid li,#recipe-result{box-sizing:border-box;display:grid;place-items:center;aspect-ratio:1;min-height:0;margin:0;padding:2px;border:0;background:#8e8d82;box-shadow:inset 2px 2px #53524a,inset -2px -2px #efebdb} +#recipe-grid li[aria-label="Empty slot"]{background:#85847a} +#recipe-grid li>a{display:grid;place-items:center;width:100%;height:100%} +#recipe-grid img,#recipe-result img{width:min(85%,38px);height:auto;aspect-ratio:1;object-fit:contain;image-rendering:pixelated} +.recipe-arrow{width:100%;aspect-ratio:1;background:#675f4e;clip-path:polygon(0 39%,58% 39%,58% 14%,100% 50%,58% 86%,58% 61%,0 61%)} + +#recipe-station-layout.recipe-station--cooking{grid-template-columns:minmax(28px,42px) clamp(14px,8%,32px) minmax(36px,50px);justify-content:center} +.recipe-station--cooking #recipe-grid{grid-template-columns:1fr} +.recipe-station--cooking #recipe-grid .recipe-heat{width:66%;justify-self:center;aspect-ratio:1.8;background:linear-gradient(#edb445,#af622a);box-shadow:none;clip-path:polygon(0 100%,10% 45%,26% 69%,39% 12%,53% 62%,74% 24%,100% 100%)} + +#recipe-station-layout{margin:14px auto 0;border-color:#705338;box-shadow:inset 2px 2px #eeead5,inset -2px -2px #858176,0 4px 10px #41280f36} +#recipe-output{justify-content:center;text-align:center} +#recipe-result{outline:1px solid #8d693b;outline-offset:2px} +#recipe-grid li>a:focus-visible{outline:2px solid #ffe1a2;outline-offset:-2px} + +#recipe-item-card{margin-top:20px} +#recipe-item-card .item-lore-card{max-width:100%} diff --git a/website/web/imperial-recipe-book.html b/website/web/imperial-recipe-book.html index 5b84dad4..ec8fe936 100644 --- a/website/web/imperial-recipe-book.html +++ b/website/web/imperial-recipe-book.html @@ -4,8 +4,8 @@