raylu 16 цаг өмнө
parent
commit
1ef2c5a028
4 өөрчлөгдсөн 33 нэмэгдсэн , 21 устгасан
  1. 2 0
      roi.py
  2. 1 1
      ts/roi.ts
  3. 4 0
      www/index.html
  4. 26 20
      www/style.css

+ 2 - 0
roi.py

@@ -41,6 +41,8 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], materi
 			for bm in building['BuildingCosts'])
 	profit_per_run = revenue - cost
 	runs_per_day = 24 * 60 * 60 * 1000 / recipe['TimeMs']
+	if building['Ticker'] in ('FRM', 'ORC'):
+		runs_per_day *= 1.1212 # promitor's fertility
 	worker_consumable_daily_cost = building_daily_cost(building, prices)
 	cost_per_day = cost * runs_per_day + worker_consumable_daily_cost
 	output_per_day = output['Amount'] * runs_per_day

+ 1 - 1
ts/roi.ts

@@ -22,7 +22,7 @@ async function render() {
 		tr.innerHTML = `
 			<td>${p.output}</td>
 			<td>${p.expertise}</td>
-			<td style="color: ${color(profit_per_area, 0, 500)}">${formatDecimal(profit_per_area)}</td>
+			<td style="color: ${color(profit_per_area, 0, 300)}">${formatDecimal(profit_per_area)}</td>
 			<td><span style="color: ${color(break_even, 30, 2)}">${formatDecimal(break_even)}</span>d</td>
 			<td style="color: ${color(p.capex, 300_000, 50_000)}">${formatWhole(p.capex)}</td>
 			<td style="color: ${color(p.cost_per_day, 40_000, 1_000)}">${formatWhole(p.cost_per_day)}</td>

+ 4 - 0
www/index.html

@@ -27,6 +27,10 @@
 			<tbody></tbody>
 		</table>
 	</main>
+	<footer>
+		prices and traded volume are IC1/HRT from refined-price's 7-day volume-weighted average
+		<br>FRM and ORC use 112.12% fertility (promitor's)
+	</footer>
 	<div id="popover" popover="hint"></div>
 	<script src="roi.js"></script>
 </body>

+ 26 - 20
www/style.css

@@ -28,31 +28,37 @@ input {
 	accent-color: #f70;
 }
 
-main {
+main, footer {
 	width: 900px;
 	margin: 10px auto;
-	padding: 10px 50px 25px;
 	background-color: #111;
-	box-shadow: 0 0 5px #222;
+}
+main {
+	padding: 40px 50px;
+}
+footer {
+	padding: 25px 50px;
+	margin-bottom: 50px;
+	font-size: 16px;
+}
 
-	table {
-		width: 100%;
-		margin-top: 1em;
-		border-collapse: collapse;
-		th {
-			white-space: no-wrap;
+table {
+	width: 100%;
+	margin-top: 1em;
+	border-collapse: collapse;
+	th {
+		white-space: no-wrap;
+	}
+	tbody {
+		td:nth-child(1),
+		td:nth-child(2) {
+			font-family: inherit;
+			text-align: inherit;
 		}
-		tbody {
-			td:nth-child(1),
-			td:nth-child(2) {
-				font-family: inherit;
-				text-align: inherit;
-			}
-			td {
-				font-family: monospace;
-				text-align: right;
-				border-top: 1px solid #222;
-			}
+		td {
+			font-family: monospace;
+			text-align: right;
+			border-top: 1px solid #222;
 		}
 	}
 }