forked from frslm/satisfactory-calculator
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcalc.html
161 lines (140 loc) · 7.09 KB
/
calc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<html>
<head>
<meta charset="utf-8">
<title>Satisfactory Calculator</title>
<link rel="stylesheet" type="text/css" href="calc.css">
<link rel="stylesheet" type="text/css" href="dropdown.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-66808523-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-66808523-2');
</script>
<script src="third_party/BigInteger.min.js"></script>
<script src="third_party/d3.min.js"></script>
<script src="third_party/d3-sankey.min.js"></script>
<script>
var handlers = {}
</script>
<script type="module">
import { plusHandler, clickTab, changeRatePrecision, changeCountPrecision } from "./events.js"
import { init } from "./init.js"
handlers.plusHandler = plusHandler
handlers.clickTab = clickTab
handlers.changeRatePrecision = changeRatePrecision
handlers.changeCountPrecision = changeCountPrecision
handlers.init = init
</script>
</head>
<!--Copyright 2019 Kirk McDonald
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.-->
<body onload="handlers.init()">
<ul id="targets">
<li id="plusButton">
<button class="targetButton ui" title="Add new item."
onclick="handlers.plusHandler()">+</button>
</li>
</ul>
<div class="tabs">
<button class="tab_button" id="graph_button" onclick="handlers.clickTab('graph')">Visualize</button>
<button class="tab_button" id="totals_button" onclick="handlers.clickTab('totals')">Items</button>
<button class="tab_button" id="settings_button" onclick="handlers.clickTab('settings')">Settings</button>
<button class="tab_button" id="about_button" onclick="handlers.clickTab('about')">About</button>
</div>
<div id="graph_tab" class="tab graph">
<svg id="graph"><g /></svg>
</div>
<div id="totals_tab" class="tab">
<table id="totals" class="power-shard-collapsed">
<thead><tr></tr></thead>
<tbody></tbody>
<tfoot>
<tr class="power">
<td class="right-align label"><b>total average power: </b></td>
<td class="right-align pad"><tt></tt></td>
</tr>
<tr class="power">
<td class="right-align label"><b>total peak power: </b></td>
<td class="right-align pad"><tt></tt></td>
</tr>
<tr class="power-shard">
<td class="right-align label"><b>power shards needed: </b></td>
<td class="right-align pad"><tt></tt></td>
</tr>
</tfoot>
</table>
</div>
<div id="settings_tab" class="tab">
<table id="settings">
<tr class="setting-section">
<td colspan="2"><span>Display</span><hr></td>
</tr>
<tr class="setting-row">
<td class="setting-label top">Display rates as:</td>
<td><form id="display_rate"></form></td>
</tr>
<tr class="setting-row">
<td class="setting-label">Rate precision:</td>
<td><input id="rprec" class="prec" type="number" value="3" min="0" onchange="handlers.changeRatePrecision(event)"></td>
</tr>
<tr class="setting-row">
<td class="setting-label">Count precision:</td>
<td><input id="cprec" class="prec" type="number" value="1" min="0" onchange="handlers.changeCountPrecision(event)"></td>
</tr>
<tr class="setting-section">
<td colspan="2"><span>Factory</span><hr></td>
</tr>
<tr class="setting-row">
<td class="setting-label">Belt:</td>
<td><span id="belt_selector"></span></td>
</tr>
<tr class="setting-section">
<td colspan="2"><span>Recipes</span><hr></td>
</tr>
<tr>
<td colspan="2"><div id="alt_recipe_settings"></div></td>
</tr>
<tr class="setting-section">
<td colspan="2"><span>Resources</span><hr></td>
</tr>
<tr>
<!--<td class="setting-label"></td>-->
<td colspan="2"><div id="resource_settings"></div></td>
</tr>
</table>
</div>
<div id="about_tab" class="tab">
<div class = "about-content">
Satisfactory Calculator for Update 3 by Legorin
<p>
Early Access - v0.3.3.3 Build 117050
<p>
The code was originally created by KirkMcdonald on Github, and I forked it from frslm, who forked it from him. Most, if not all, the recipes, should work. However, due to the way the code works it only displays single outputs, so for all the dual output recipes, it will only show the main output.
<p>
For the latest fixes please visit my <a href="https://github.com/Legorin/satisfactory-calculator/commits/master">Github Page</a>, and report any wrong recipes to the <a href="https://www.reddit.com/r/SatisfactoryGame/comments/f50xeb/satisfactory_calculator_for_update_3/">reddit post</a>.
<p>
There is a bug where if you select both the Recycled Plastic and Recycled Rubber alt recipes the website will crash. I cannot fix this, so select either one or the other.
<p>
I am not a coder, I only updated the json file which contains all the recipes. The original creaters message appears below.
<p>
This calculator is copyright 2019 Kirk McDonald. It is licensed under the Apache License 2.0, and its source may be <a href="https://github.com/KirkMcDonald/satisfactory-calculator">found on github, here</a>.
<p>
This calculator is based on my <a href="https://kirkmcdonald.github.io/calc.html">Factorio calculator</a>, and was created primarily to see what the project would look like if rewritten from scratch, applying lessons learned over the years spent developing the original.
<p>
Satisfactory is a simpler game for which to calculate ratios than Factorio. This simplicity means that it is easier for this calculator to support certain features that would be very difficult to add to the Factorio calculator, but which I have wanted to implement for a long time. This can be seen in the use of a <a href="https://en.wikipedia.org/wiki/Sankey_diagram">Sankey diagram</a> in the visualizer, among other things.
<p>
If you wish to support the calculator, please consider donating to <a href="https://www.patreon.com/kirkmcdonald">my Patreon campaign</a>. Any amount helps. And thank you!
</div>
</div>
</body>
</html>