diff --git a/404.html b/404.html index 9ed9890..5985116 100644 --- a/404.html +++ b/404.html @@ -8,4 +8,4 @@ -

Page not found

That page does not exist. Go to the home page, or pick a tool: Crafting, Farming or Loadouts.

+

Page not found

That page does not exist. Go to the home page, or pick a tool: Crafting, Farming or Loadouts.

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 357160e..03c58f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -212,4 +212,4 @@ The button in the top bar reads `changelog.json`. Add a new object at the top of ## Updating the suggested market prices -`assets/market.js` holds a dated snapshot of material prices (groschen) taken from the Auction houses page of the KCDRoleplay account site (the 7-day average sale price). That page needs a game login, so the file is updated by hand: change the numbers under `p` (the keys are the material ids used in `assets/recipes.js`) and set `date`. Prices a visitor types on the site always override these, and a tick box turns the suggestions off. +`assets/market.js` holds a dated snapshot of material prices (groschen) taken from the Auction houses page of the KCDRoleplay account site (the 7-day average sale price). That page needs a game login, so the file is updated by hand: change the numbers under `p` (the keys are the material ids used in `assets/recipes.js`) and set `date`. Prices a visitor types on the Prices page always override these, and a tick box there turns the suggestions off. Groups for the Prices page are set at the top of `assets/pricing.js`; a new raw material lands in “Other” until you add its id to a group. diff --git a/README.md b/README.md index f205521..caf4c32 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,17 @@ Everything runs in your browser. There is no account and nothing is sent anywher ![Crafting cost calculator](docs/screenshots/crafting.png) - All nine crafts: Smithing, Armouring, Tailoring, Bowyery, Jewelling, Alchemy, Brewing, Cooking and Carpentry (1,211 pieces). -- Enter your material prices and see each piece's cost, bench fee, selling price and profit at your markup. +- See each piece's cost, bench fee, selling price and profit at your markup, using the prices from the Prices page. - Intermediate parts such as steel, leather and padding are worked out from raw materials, or use your own price. - Filter by level and by type within each craft (for example Swords, Helmets, Furniture or Lighting), sort by any column, star favourites, and search across every craft. - Build an order and get a combined shopping list. -- Save named price presets (for example one per town), and share or import price lists as plain text. ## Farming efficiency ![Farming efficiency](docs/screenshots/farming.png) - Compare every crop by value per hour, value per harvest and value in a time window. -- Set your trade level, whether strips are weeded and watered, how many strips you have, and your own selling prices. +- Set your trade level, whether strips are weeded and watered and how many strips you have. Worth per load uses the same prices as everything else. - Quick-setup buttons, a top 3 chart, and a note on how every number is worked out. ## Loadout builder @@ -40,6 +39,15 @@ Everything runs in your browser. There is no account and nothing is sent anywher - See what each costs to make and get a shopping list of materials. - Copy a loadout as text or as a link, or save it as a picture. +## Prices + +![Prices page](docs/screenshots/prices.png) + +- One page for every material price the calculators use (124 materials, plus hemp fibre for Farming), grouped as ores, timber, hunt, herbs, farm and food, fish, rare finds and parts you can craft. +- Type your own price, or leave it empty to use the auction house average (`assets/market.js`). Each row shows which one the calculators use and how many pieces need it. +- Show only the prices you set, the ones still missing, or what your current order needs. +- Save named price sets (for example one per town), and share or bring in price lists as plain text. + ## Everywhere ![The guided tour highlighting a feature](docs/screenshots/tour.png) @@ -82,11 +90,13 @@ index.html home page crafting.html crafting cost calculator farming.html farming efficiency loadouts.html loadout builder +prices.html the Prices page: every material price in one place 404.html page not found assets/site.css the look shared by every page: colours, top bar, title bar, left rail (edit styles here) assets/site.js shared behaviour: light/dark, backup and restore, loading feedback, offline copy and updates assets/recipes.js every crafting recipe (edit recipes here only) assets/market.js suggested material prices from the auction houses (dated snapshot) +assets/pricing.js shared price logic: groups, your price vs market, worked-out parts (used by Prices, Farming and the price line) assets/categories.js how the crafting page groups pieces into types (Swords, Helmets, Furniture...) assets/tour.js the guided tour (one list of steps, edit the text there) changelog.json the list shown by the What's new button (add new entries at the top) diff --git a/assets/market.js b/assets/market.js index 182e1aa..ff804d6 100644 --- a/assets/market.js +++ b/assets/market.js @@ -6,4 +6,4 @@ const MARKET={date:"2026-11-16",src:"KCDRoleplay auction houses, 7-day average s O:6,C:2,K:8,A:50,G:19,L:6,H:14,N:4,R:9,W:8,F:26,V:2510,P:347,U:923,M:2989,D:6,E:6,T:15, charcoal:3,cobwebs:3,tusks:11,yew:608,rantlers:83,rcrystal:25,barley:9,hops:5,grapes:5,honey:9,amber:104,oak:44,aseeds:83,plums:5, chamomile:4,sage:4,belladonna:11,ginger:26,elder:4,mandrake:6,amandrake:58,flax:7,hay:6,carrots:6,egg:5,roach:3,onions:8,cabbage:8, -hare:4,milk:14,chicken:2,venison:4,carp:6,eel:8,pike:11,boar:6}}; +hare:4,milk:14,chicken:2,venison:4,carp:6,eel:8,pike:11,boar:6,hempf:5}}; diff --git a/assets/pricing.js b/assets/pricing.js new file mode 100644 index 0000000..4182241 --- /dev/null +++ b/assets/pricing.js @@ -0,0 +1,94 @@ +// Shared material prices: the one place that knows what a material costs. +// Needs assets/recipes.js (RAW, INT, DATA, CR) and assets/market.js (MARKET) loaded first. +// Used by the Prices page (where prices are entered), Farming (worth per load) and the +// price summary line on Crafting and Loadouts. Prices live in localStorage "kcd-p"; the +// "use market prices" switch is "sg" inside "kcd-s". +window.KP = (function () { + "use strict"; + // Goods that no recipe uses but Farming sells, so they can be priced too + var EXTRA = { hempf: "Hemp fibre" }; + // Farming crop name -> material id + var CROP = { Cabbage: "cabbage", Carrots: "carrots", Onions: "onions", Barley: "barley", Hay: "hay", Hops: "hops", Grapes: "grapes", Plums: "plums", Sage: "sage", Chamomile: "chamomile", "Hemp fibre": "hempf", Flax: "flax" }; + var G = [ + ["ores", "Ores & metals", "O C K A G U M D E Z"], + ["timber", "Timber & fuel", "L R X oak yew charcoal"], + ["hunt", "Hunt & hides", "H F V T W Q tusks rantlers hare venison boar wmeat wheart"], + ["herbs", "Herbs & mushrooms", "N mint wormwood chamomile sage thistle dandelion belladonna valerian wort eyebright poppy ginger marigold comfrey feverfew elder mandrake amandrake boletus lepiota cobwebs"], + ["farm", "Farm & food", "barley hops grapes honey plums flax hay hempf apple pear beet carrots egg onions cabbage garlic pork milk horseradish chicken mutton beef ptender btender bkidney btongue pliver sstomach aseeds"], + ["fish", "Fish", "carp eel pike roach"], + ["rare", "Rare finds", "P amber rcrystal J u v brokenaxe"] + ]; + var GROUP = {}, GROUPS = []; + G.forEach(function (g) { GROUPS.push({ id: g[0], name: g[1] }); g[2].split(" ").forEach(function (id) { GROUP[id] = g[0]; }); }); + Object.keys(RAW).forEach(function (id) { if (!GROUP[id]) GROUP[id] = "other"; }); + if (Object.keys(RAW).some(function (id) { return GROUP[id] === "other"; })) GROUPS.push({ id: "other", name: "Other" }); + Object.keys(INT).forEach(function (id) { GROUP[id] = "parts"; }); + GROUPS.push({ id: "parts", name: "Parts you can craft" }); + + var name = function (id) { return RAW[id] || EXTRA[id] || (INT[id] && INT[id][0]) || id; }; + var ids = Object.keys(RAW).concat(Object.keys(EXTRA), Object.keys(INT)); + + // How many recipe lines (counting each name variant) use each material + var USED = {}; + (function () { + var RX = /\{(\w+)\}(\d+)|([A-Za-z])(\d+)/g; + DATA.split("\n").forEach(function (l) { + var p = l.split("|"); if (p.length < 5) return; var n = p[2].split(";").length; + p[4].replace(RX, function (m, w, a, k) { var id = w || k; USED[id] = (USED[id] || 0) + n; return m; }); + }); + Object.keys(INT).forEach(function (k) { for (var r in INT[k][2]) USED[r] = USED[r] || 0; }); + })(); + var FARMED = {}; Object.keys(CROP).forEach(function (c) { FARMED[CROP[c]] = c; }); + + var load = function (k, d) { try { var v = JSON.parse(localStorage.getItem(k)); return v && typeof v === "object" && !Array.isArray(v) ? v : d; } catch (e) { return d; } }; + var P, sg, C = {}; + function read() { + P = load("kcd-p", {}); var st = load("kcd-s", {}); sg = st.sg == null ? true : !!st.sg; C = {}; + } + read(); + var ov = function (id) { return P[id] !== undefined && P[id] !== "" && !isNaN(parseFloat(P[id])); }; + var mkt = function (id) { return (MARKET.p && MARKET.p[id]) || 0; }; + var sug = function (id) { return sg ? mkt(id) : 0; }; + function unit(id) { + if (id in C) return C[id]; + C[id] = 0; // guards against a loop in the data + var v; + if (ov(id)) v = Math.max(0, parseFloat(P[id]) || 0); + else if (INT[id]) { var r = INT[id][2], s = 0; for (var k in r) s += r[k] * unit(k); v = (s + (INT[id][3] || 0)) / INT[id][1]; } + else v = sug(id); + return (C[id] = v); + } + // "yours", "market", "worked out" or "missing" + function source(id) { + if (ov(id)) return "yours"; + if (INT[id]) { var r = INT[id][2]; for (var k in r) if (source(k) === "missing") return "missing"; return "worked out"; } + return sug(id) ? "market" : "missing"; + } + var tm; + function save() { clearTimeout(tm); tm = setTimeout(function () { try { localStorage.setItem("kcd-p", JSON.stringify(P)); } catch (e) {} }, 200); } + function flush() { clearTimeout(tm); try { localStorage.setItem("kcd-p", JSON.stringify(P)); } catch (e) {} } + function set(id, v) { v = String(v == null ? "" : v).trim().replace(",", "."); if (v === "" || isNaN(parseFloat(v)) || parseFloat(v) < 0) delete P[id]; else P[id] = v; C = {}; save(); } + function setAll(o) { P = {}; for (var k in o) if (ids.indexOf(k) >= 0 && !isNaN(parseFloat(o[k])) && parseFloat(o[k]) >= 0) P[k] = String(o[k]); C = {}; flush(); } + function setSg(v) { sg = !!v; C = {}; var st = load("kcd-s", {}); st.sg = sg; try { localStorage.setItem("kcd-s", JSON.stringify(st)); } catch (e) {} } + function mine() { var o = {}; for (var k in P) if (ov(k)) o[k] = P[k]; return o; } + // Counts over raw goods that something actually uses + function stats() { + var y = 0, m = 0, x = 0; + Object.keys(RAW).concat(Object.keys(EXTRA)).forEach(function (id) { + if (!USED[id] && !FARMED[id]) return; + if (ov(id)) y++; else if (sug(id)) m++; else x++; + }); + Object.keys(INT).forEach(function (id) { if (ov(id)) y++; }); + return { yours: y, market: m, missing: x }; + } + function marketDate() { var d = new Date(MARKET.date + "T12:00:00"); return isNaN(d) ? MARKET.date : d.toLocaleDateString("en-GB", { day: "numeric", month: "short" }); } + // Name lookup for imports ("Iron ore = 7") + var BYNAME = {}; ids.forEach(function (id) { BYNAME[name(id).toLowerCase()] = id; }); + + return { + EXTRA: EXTRA, CROP: CROP, GROUPS: GROUPS, GROUP: GROUP, USED: USED, FARMED: FARMED, BYNAME: BYNAME, + ids: ids, name: name, ov: ov, mkt: mkt, sug: sug, unit: unit, source: source, + set: set, setAll: setAll, setSg: setSg, mine: mine, stats: stats, read: read, flush: flush, marketDate: marketDate, + get P() { return P; }, get sg() { return sg; } + }; +})(); diff --git a/assets/site.css b/assets/site.css index 2965986..72b9696 100644 --- a/assets/site.css +++ b/assets/site.css @@ -140,9 +140,15 @@ nav.site .clpop{display:none} nav.site .tourbtn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--bd);border-radius:6px;padding:5px 10px;background:var(--card);color:var(--tx);cursor:pointer;font:inherit} html[data-skin=ledger] nav.site .tourbtn{border-radius:2px;font-variant:small-caps;letter-spacing:.05em} nav.site .tourbtn:hover{border-color:var(--ac);color:var(--ac)}nav.site .tourbtn svg{width:18px;height:18px;flex:none} -@media (max-width:560px){nav.site .tourbtn .tl{display:none}nav.site .tourbtn{margin-left:auto;padding:5px 7px}nav.site details.menu{margin-left:0!important}} +nav.site .tourpop{display:none} +/* phones: Tour moves into the Settings menu (like What’s new) so the five page links fit */ +@media (max-width:560px){nav.site .tourbtn{display:none}nav.site .pop .tourpop{display:block}nav.site details.menu{margin-left:auto!important}} +@media (max-width:430px){nav.site a:not(.brand){padding:4px 5px!important;font-size:.85rem!important}} @media (max-width:389px){nav.site a:not(.brand){padding:4px 4px!important;font-size:.82rem!important}} @media (max-width:340px){nav.site a:not(.brand){padding:4px 3px!important;font-size:.78rem!important}nav.site .tourbtn{padding:5px 5px}} /* ---- "Saved" note: confirms that a change has been kept in this browser ---- */ .saved{position:fixed;left:14px;bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:55;background:var(--card);border:1px solid var(--ok);color:var(--ok);padding:4px 10px;border-radius:2px;font-size:.85rem;opacity:0;transition:opacity .25s;pointer-events:none}.saved.on{opacity:1} @media print{.saved,.toast{display:none}} +/* ---- the "Prices" line on Crafting and Loadouts ---- */ +.pline{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin:0 0 12px;padding:10px 14px}.pline .plh{font-variant:small-caps;letter-spacing:.1em;color:var(--ac)}.pline b{color:var(--tx)}.pline .mi{color:var(--bad)}.pline .go{margin-left:auto} +.btn{display:inline-block;padding:4px 12px;border:1px solid var(--ac);border-radius:2px;text-decoration:none}a.btn.pri{background:var(--ac);color:var(--on)} diff --git a/assets/tour.js b/assets/tour.js index da4951a..0b352f1 100644 --- a/assets/tour.js +++ b/assets/tour.js @@ -5,8 +5,8 @@ or none for a centred card), a title and some text. Steps whose element is missing are skipped. */ (function () { "use strict"; - var PAGES = ["index.html", "crafting.html", "farming.html", "loadouts.html"]; - var NAMES = { "index.html": "Home", "crafting.html": "Crafting", "farming.html": "Farming", "loadouts.html": "Loadouts" }; + var PAGES = ["index.html", "crafting.html", "farming.html", "loadouts.html", "prices.html"]; + var NAMES = { "index.html": "Home", "crafting.html": "Crafting", "farming.html": "Farming", "loadouts.html": "Loadouts", "prices.html": "Prices" }; var here = (location.pathname.split("/").pop() || "index.html").toLowerCase(); if (PAGES.indexOf(here) < 0) return; @@ -21,19 +21,17 @@ { p: "crafting.html", s: "#lvs", t: "Filter by level", x: "Show just one crafting level, or All." }, { p: "crafting.html", s: "#cats", t: "Filter by type", x: "Each craft splits into types that suit it, such as Swords and Helmets, or Furniture and Lighting.", tryit: "Try it: tap one of the types.", ev: "click" }, { p: "crafting.html", s: "#q", t: "Search every craft", x: "Type two or more letters to search all crafts at once. Press / anywhere on the page to jump to this box.", tryit: "Try it: type “sword”.", ev: "input" }, - { p: "crafting.html", s: "aside > details:first-of-type", open: true, t: "Enter your prices", x: "These are the materials the pieces on screen need. Fill in what you pay for each and every cost updates. Parts such as Steel are worked out from their ingredients unless you enter a price for them. Press Enter to move to the next box." }, + { p: "crafting.html", s: "#pline", t: "Prices", x: "Costs use the material prices from the Prices page: your own, with market averages filling the gaps. This line shows how many of each, with a link to change them." }, { p: "crafting.html", s: "#ban", t: "Why costs show dashes", x: "Until you enter at least one price, Sell at and Profit show a dash and Total cost is only the bench fee, so nothing looks like a real result." }, { p: "crafting.html", s: "#mk", t: "Markup", x: "Sell at is the cost plus this percentage, rounded up to a whole groschen." }, { p: "crafting.html", s: "#th", t: "Reading the table", x: "Bench fee and Total cost are per piece. Click a column heading to sort by it. The headings stay at the top as you scroll." }, { p: "crafting.html", s: "#rows tr.r", t: "Pieces", x: "Click a row to see exactly which materials add up to its cost. Use the star to keep a piece in your favourites, and type a quantity in the Qty box to add it to an order.", tryit: "Try it: click the row.", ev: "click" }, { p: "crafting.html", s: "#ordc", t: "Order and shopping list", x: "Everything with a quantity is combined here into a list of materials to buy, with the total cost. You can copy it as text." }, - { p: "crafting.html", s: "aside > details:nth-of-type(2)", open: true, t: "Price presets", x: "Save your prices under a name, for a town perhaps, and switch between sets in one click." }, - { p: "crafting.html", s: "aside > details:nth-of-type(3)", open: true, t: "Share prices", x: "Copy your price list as text to paste in a chat, or paste someone else’s list to import it." }, { p: "crafting.html", s: "section > .card:last-child", t: "Custom recipes", x: "Missing something, or want to try a house recipe? Add your own piece here and it joins the table." }, { p: "farming.html", s: "main .card", t: "Farming: your setup", x: "Set your trade level, whether strips are weeded and watered, how many strips you have and the time window you care about. The quick setup buttons fill these in for common cases." }, { p: "farming.html", s: "#stats", t: "The best choices", x: "The headline results: best value per hour, per harvest and within your time window, and which crop is fastest." }, - { p: "farming.html", s: "table.ft", t: "Every crop", x: "All crops side by side. Click a heading to sort. The worth of a load can be edited, so use the price you actually get when selling." }, + { p: "farming.html", s: "table.ft", t: "Every crop", x: "All crops side by side. Click a heading to sort. Worth per load comes from the Prices page, so a price you set there or here is used everywhere." }, { p: "loadouts.html", s: "main .card", t: "Loadouts: start one", x: "Choose a crafting level and add a loadout. You can keep several and compare them." }, { p: "loadouts.html", s: "#fq", t: "Find a piece", x: "Search for any armour or weapon and put it straight into one of your loadouts. Press / to jump here." }, @@ -41,8 +39,10 @@ { p: "loadouts.html", s: "#los .card .btns", t: "Fill buttons", x: "Fill every slot with the best pieces for your level, the priciest or the cheapest, then change anything you like." }, { p: "loadouts.html", s: "#los .card .btns + .btns", t: "Share a loadout", x: "Copy it as text, with or without the materials, copy a link that opens the same loadout, or save it as a picture for a chat." }, { p: "loadouts.html", s: "#cmpd", t: "Compare side by side", x: "Open this to see all your loadouts in one table and which costs most." }, - { p: "loadouts.html", s: "#mat", t: "Prices are shared", x: "These are the same material prices as on the crafting page. Enter them in either place." }, - { p: "loadouts.html", t: "That is the tour", x: "You can replay it whenever you like with the Tour button at the top right. Happy crafting!", last: true } + { p: "prices.html", s: "#prail", t: "Prices: one place for every price", x: "Every material the calculators use, in groups. Pick a group, or show only the prices you set, the ones still missing, or what your current order needs." }, + { p: "prices.html", s: "#pt", t: "Your price, or the market’s", x: "Type what you pay in Your price. Leave it empty and the market average is used instead. Calculators use shows which one applies, and Used in shows how many pieces need it. Press Enter to move to the next box." }, + { p: "prices.html", s: ".ptools .acts", t: "Sets and sharing", x: "Save your prices as a named set, for a town perhaps, copy them to share in a chat, or clear them. Each change can be undone straight away." }, + { p: "prices.html", t: "That is the tour", x: "You can replay it whenever you like from the Tour button, or from Settings on a phone. Happy crafting!", last: true } ]; var SEEN = "kcd-tour-seen", POS = "kcd-tour"; @@ -74,6 +74,8 @@ function addButton() { var nav = document.querySelector("nav.site"), menu = nav && nav.querySelector("details.menu"); if (!nav) return; + var pop = nav.querySelector(".pop"); // on phones the Tour button is hidden and this menu entry is used instead + if (pop && !pop.querySelector(".tourpop")) { var tp = el("button", { type: "button", class: "tourpop" }, "Take the tour"); tp.onclick = function () { var m = nav.querySelector("details.menu"); if (m) m.open = false; start(0); }; var cp = pop.querySelector(".clpop"); pop.insertBefore(tp, cp ? cp.nextSibling : pop.firstChild); } var had = nav.querySelector(".tourbtn"); if (had) { had.onclick = function () { start(0); }; return; } // the button is normally already in the page var b = el("button", { type: "button", class: "tourbtn", title: "Take a guided tour of the site", "aria-label": "Take the guided tour" }, 'Tour'); diff --git a/changelog.json b/changelog.json index b704303..b4bc207 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,16 @@ { "entries": [ + { + "date": "2026-11-17", + "title": "New Prices page", + "changes": [ + "All material prices now live on their own Prices page, linked from the top bar. Every material is listed in groups, with your price, the market price, which one the calculators use and how many pieces need it.", + "Show only the prices you set, the ones still missing, or the materials your current order needs. Price sets and sharing moved here too.", + "Crafting and Loadouts show one line saying where their prices come from, with a link to change them.", + "Farming now uses the same prices for worth per load: your price, otherwise the market average. Worth values you had typed on Farming were moved over as your prices.", + "On phones, Tour is now in the Settings menu so all five pages fit in the top bar." + ] + }, { "date": "2026-11-17", "title": "New home page", diff --git a/crafting.html b/crafting.html index 1626c79..e370d19 100644 --- a/crafting.html +++ b/crafting.html @@ -18,7 +18,6 @@ .tab,.chip{white-space:nowrap;border-radius:999px;padding:5px 12px;flex:none}.chip{padding:2px 9px} .tab.on,.chip.on{background:var(--ac);color:var(--on);border-color:var(--ac)}html[data-skin=ledger] .tab.on:hover,html[data-skin=ledger] .chip.on:hover{color:var(--on)}.tab small{opacity:.7} /* Navigation: on a wide screen the crafts are a list in the left column; on a phone one summary button opens a filter sheet */ -#matbody .grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))} #crafts #tabs{flex-direction:column;overflow:visible;gap:2px;margin:0} #crafts .tab{display:flex;justify-content:space-between;align-items:center;border:1px solid transparent;background:transparent;border-radius:2px;padding:0 12px;min-height:44px;font-size:1rem;text-align:left;width:100%;box-sizing:border-box}#crafts .tab:hover{border-color:var(--bd);background:var(--card)}#crafts .tab.on,#crafts .tab.on:hover{background:var(--ac);border-color:var(--ac);color:var(--on)}#crafts .tab small{font-size:.8rem} #lvs{gap:0}#lvs .chip{border-radius:0;margin-left:-1px;padding:4px 11px}#lvs .chip:first-child{border-radius:2px 0 0 2px;margin-left:6px}#lvs .chip:last-child{border-radius:0 2px 2px 0} @@ -44,8 +43,6 @@ .hr2{align-items:flex-end}.hr2 .f:not(.sq){margin:0} .mc{padding-top:0} /* the three price panels sit side by side while closed, and take the full width as soon as one is open */ - #pricecard{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 18px}#pricecard>details{margin-top:0!important} - #pricecard:has(>details[open]){display:block}#pricecard:has(>details[open])>details+details{margin-top:10px!important} .top{padding:14px 0 10px} } @media (max-width:899px){.hr1 h2{display:none}.hr2 .sq{margin-left:0;flex:1 1 100%}} @@ -89,7 +86,7 @@ @media (max-width:700px){html[data-skin=ledger] .top h1{font-size:1.15rem}.top .bar label.f:last-child{padding-bottom:0!important}} #totop{display:none;position:fixed;right:14px;bottom:14px;z-index:20;width:44px;height:44px;border-radius:50%;align-items:center;justify-content:center;padding:0;background:var(--ac);color:var(--on);border:0;box-shadow:0 3px 10px rgba(0,0,0,.35);font-size:1.2rem} - +
Loading recipes…

Crafting Cost Calculator

@@ -99,11 +96,8 @@

-
- +

+
Order & shopping list

@@ -124,6 +118,7 @@
+ diff --git a/docs/screenshots/crafting.png b/docs/screenshots/crafting.png index 66a78f6..ce1f950 100644 Binary files a/docs/screenshots/crafting.png and b/docs/screenshots/crafting.png differ diff --git a/docs/screenshots/farming.png b/docs/screenshots/farming.png index 98248f5..4730b41 100644 Binary files a/docs/screenshots/farming.png and b/docs/screenshots/farming.png differ diff --git a/docs/screenshots/home.png b/docs/screenshots/home.png index 888c5e2..8638a37 100644 Binary files a/docs/screenshots/home.png and b/docs/screenshots/home.png differ diff --git a/docs/screenshots/prices.png b/docs/screenshots/prices.png new file mode 100644 index 0000000..b0fbe1e Binary files /dev/null and b/docs/screenshots/prices.png differ diff --git a/farming.html b/farming.html index a480b15..88663f8 100644 --- a/farming.html +++ b/farming.html @@ -15,7 +15,7 @@ table{min-width:760px}th,td{white-space:nowrap} tr.best td{background:color-mix(in srgb,var(--ok) 12%,transparent)} .meter{height:8px;border-radius:4px;background:var(--bar);min-width:2px}.mt{min-width:130px} -td input[type=number]{width:64px;padding:3px 5px}.rk{color:var(--mut);width:1.5em} +td input[type=number]{width:64px;padding:3px 5px}td .src{display:block;font-size:.72rem;color:var(--mut);text-align:right}td .src.yours{color:var(--ok)}.rk{color:var(--mut);width:1.5em} th[title]{cursor:help;text-decoration:underline dotted var(--mut);text-underline-offset:3px} .q button{padding:3px 10px;text-align:left;white-space:normal} @media (min-width:900px){.q button{padding:6px 10px}} @@ -30,7 +30,7 @@ table.ft tr.best td{background:none}table.ft tr.best{background:color-mix(in srgb,var(--ok) 12%,transparent)} } - +
Loading crops…

Farming Efficiency

@@ -49,7 +49,7 @@
Quick setup
-
+
Edit crop prices →

@@ -59,16 +59,22 @@
CropGrowsLoads / stripWorth / loadValue / harvestValue / hourEfficiencyvs bestHarvests in windowWindow value
How are these numbers worked out?

Loads per strip = base loads × 1.84 if weeded and watered × (1 + 5% for every trade level above 1). Value per harvest = loads × worth per load × strips. Value per hour = value per harvest ÷ hours to grow. Window value = value per harvest × the number of whole harvests that fit in your time window.

-

Values are in groschen. Edit “Worth / load” to use your own selling price. Harvests in window counts whole harvests only, so a crop that takes longer than the window shows none.

+

Values are in groschen. Worth per load comes from the Prices page: your own price if you set one, otherwise the market average, otherwise a typical value. Changing it here changes it everywhere. Harvests in window counts whole harvests only, so a crop that takes longer than the window shows none.

+ diff --git a/index.html b/index.html index 7b6705d..545fe3b 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@ - +

KCD Tools

diff --git a/loadouts.html b/loadouts.html index bfc725a..3411f39 100644 --- a/loadouts.html +++ b/loadouts.html @@ -25,7 +25,7 @@ .fr select{max-width:200px}.cmpt{min-width:420px}.cmpt td,.cmpt th{white-space:normal;vertical-align:top}.cmpt td small{display:block;color:var(--mut)}.cmpt tr.tot td,.cmpt tr.tot th{font-weight:bold} - +
Loading recipes…

Loadout Builder

@@ -38,16 +38,16 @@
How it works

Pick a full set of armour and a weapon for each loadout, set a crafting level, and see what it costs to craft. Copy it as text or save it as a picture to share. The fill buttons prefer armour pieces and use clothing only where a slot has no armour. Material prices are shared with the crafting calculator. Use “Copy link” to share a loadout; the link carries the pieces but not your prices.

+

Compare loadouts side by side
-
Material prices (gr.)

Materials used by your loadouts. Leave an intermediate part blank to work it out from the raw prices.

-

+ diff --git a/prices.html b/prices.html new file mode 100644 index 0000000..a754340 --- /dev/null +++ b/prices.html @@ -0,0 +1,129 @@ + + + + + + +Prices – KCD Tools + + + + + + + +

Prices

+
+ +
+
+ + + +
+

+
MaterialYour priceMarketCalculators useUsed in
+

Prices are per load or piece, in groschen. Leave a box empty to use the market price. Parts you can craft are worked out from their ingredients unless you enter a price. Crafting, Loadouts and Farming all use these prices.

+
Price sets

Save your current prices under a name, for a town perhaps, and switch between sets.

+
+
Share prices

Copy your prices to paste in a chat, or paste someone else’s list to bring them in.

+ +

+
+
+ + + diff --git a/sw.js b/sw.js index 18cd790..facce44 100644 --- a/sw.js +++ b/sw.js @@ -4,9 +4,9 @@ // changed it saves the new copies and tells the open page, which reloads itself (or offers a // Refresh button if you are in the middle of typing). Nothing here touches localStorage, so saved // prices, loadouts, favourites, orders and settings are never cleared by an update. -const CACHE = "kcd-tools-v8"; -const FILES = ["./", "index.html", "crafting.html", "farming.html", "loadouts.html", "404.html", - "assets/site.css", "assets/site.js", "assets/recipes.js", "assets/market.js", "assets/categories.js", "assets/tour.js", "assets/changelog.js", "changelog.json"]; +const CACHE = "kcd-tools-v9"; +const FILES = ["./", "index.html", "crafting.html", "farming.html", "loadouts.html", "prices.html", "404.html", + "assets/site.css", "assets/site.js", "assets/recipes.js", "assets/market.js", "assets/pricing.js", "assets/categories.js", "assets/tour.js", "assets/changelog.js", "changelog.json"]; const fresh = f => new Request(f, { cache: "no-cache" }); // always ask the server, never the browser's own cache self.addEventListener("install", e => {