forked from GICodeWarrior/fir
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
212 lines (201 loc) · 8.02 KB
/
index.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en">
<head>
<title>Foxhole Logi Pyramid</title>
<meta charset="utf-8" />
<meta name="description" content="Calculate your logi deliveries with screenshots" />
<meta name="referrer" content="same-origin" />
<link rel="icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="includes/main.css" />
<link rel="modulepreload" href="includes/frontend.mjs" />
<link rel="modulepreload" href="includes/screenshot.mjs" />
<link rel="modulepreload" href="includes/ocr.mjs" />
<script defer crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.0/html2canvas.min.js" integrity="sha512-UcDEnmFoMh0dYHu0wGsf5SKB7z7i5j3GuXHCnb3i4s44hfctoLihr896bxM0zL7jGkcHQXXrJsFIL62ehtd6yQ=="></script>
<script defer crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/tesseract.js/3.0.2/tesseract.min.js" integrity="sha512-V245eVDwUZJ8QSJmPCsSRJ7btziSNHeGXqjB7e9m3YPTn/pBxPn9YJygW52iBjUe9cHbsGImBnAL7tsAEsUHmQ=="></script>
<script defer crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/tensorflow/4.19.0/tf.min.js" integrity="sha512-igqUV3/dgEwEgy7rlTGkkROXefZSjO/FsffNNQmkcoBm/SSbiVLfJ8paV+/KRx9tqia0eK6V4oxvUlF7lZZwzg=="></script>
<script defer crossorigin src="https://apis.google.com/js/api.js"></script>
<script defer src="https://accounts.google.com/gsi/client"></script>
<script type="module" src="includes/main.js"></script>
</head>
<body>
<h2>Foxhole Pyramid Report</h2>
<form>
<p>From the ingame map, Take a screenshot of the base inventory tooltip you want to supply. <a href='#help'>Help!</a></p>
<label class="upload-screenshot">
<input accept="image/*" type="file" multiple>
</label>
</form>
<div class='top-menu'>
<button class='copy-stockpile'>82dk copy</button>
<button class="reset-pyramid">Reset</button>
<label class='filter-full'>Filter<input name='filter-full' type='checkbox'></label>
<select name='definition'>
<option disabled>Pyramids</option>
<option value='fmat'>FMAT</option>
<option value='fmatBasic'>FMAT Basic</option>
</select>
<select name='format'>
<option disabled>Metric Format</option>
<option value='crates'>Crates Required</option>
<option value='required'>Items Required</option>
<option value='current'>Current Items</option>
<option value='current-desired'>Current / Desired</option>
</select>
</div>
<div class='processing-status'>Processed: <span>0 of 0</span></div>
<div id="pyramid"></div>
<div id="pyramid-footnote">
<div class='color-legend'>
<span style="color:darkred;">◼</span> 0-25% |
<span style="color:darkorange;">◼</span> 25-50% |
<span style="color:goldenrod;">◼</span> 50-100% |
<span style="color:darkgreen;">◼</span> 100%+
</div>
<span class='snow'>*</span> Only supply when snowing in region.
</div>
<div style="display:flex;">
<div class="render"></div>
<div style="display:none" class="report"></div>
</div>
<footer>
<p>Created by [82DK]BagOfDoom using <a href="https://github.com/GICodeWarrior/fir">fir</a></p>
<p>Suggestions and issues can be posted on <a href="https://github.com/Shard/fir/issues">github</a></p>
<p><a href="https://www.foxholegame.com/">Foxhole</a> and it's IP is owned by <a href="https://www.siegecamp.com/">Siege Camp</a></p>
</footer>
<div id="help" class='hidden'>
<div>
<h2>Help</h2>
<h3>What am i looking at?</h3>
<p>The supply pyramid represents the basics needs of any frontline Relic or Bunker Base that is expected to see active combat. Items that are displayed higher are cosnidered higher priority and should be supplied first if available.</p>
<p>The number displayed depends on the format selected, but by default represents the amount of items left to deliver once a valid screenshot has been provided.</p>
<p>Not every item is displayed as it either too niche or cannot fit in a dunne truck such as firetrucks or emplacements.</p>
<h3>It's not working!</h3>
<p>The technology involved uses machine learning image recongintion to gather the data and based on factors such as how tight your crop, low resolution and use of icon mods can all make it difficult to determine the correct values.</p>
<p>If possible, try leaving more space around the tooltip, using a higher resolution (1080p should be fine) or update your icon pack or use a different pack.</p>
<p>Icon packs are a difficult problem to solve, but it has been tested with <a href="https://sentsu.itch.io/foxhole-ui-label-icons">Sentsu's UI Label Icons</a> and <a href="https://thewindowsuser92.itch.io/foxhole-vanilla-item-icons">Vanilla Item Icons</a> and minimal issues have been noticed. If you have clean screenshots you are will to share, feel free to open a github issue or message bagofdoom on discord.</p>
</div>
</div>
<style>
body{
background: black;
color: white;
font-family: sans-serif;
}
.upload-screenshot{
max-width: 250px;
display: block;
margin: 0 auto;
}
#help{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}
#help > div{
background: #222;
padding: 1em;
border-radius: 0.5em;
margin: 3em;
max-height: 80%;
max-width: 1024px;
overflow: auto;
}
#help.hidden{ display: none; }
h2{margin:0;}
#pyramid {
display: flex;
flex-direction: column;
align-items: center;
font-family: Courier, monospace;
}
#pyramid .row {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 8px;
}
#pyramid .item {
margin-right: 4px;
overflow: hidden;
height: 42px;
padding: 2px;
transition: all 0.2s ease-in-out;
}
#pyramid .depleted{ background-color:darkred; }
#pyramid .depleted:hover{ background-color:red; }
#pyramid .low{ background-color:darkorange; }
#pyramid .low:hover{ background-color:orange; }
#pyramid .medium{ background-color:goldenrod; }
#pyramid .medium:hover{ background-color:gold; }
#pyramid .full{ background-color:darkgreen; }
#pyramid .full:hover{ background-color:green; }
#pyramid.empty .item{ background-color:#191919; }
#pyramid.empty .item:hover{ background-color:#333; }
#pyramid > div canvas, #pyramid > div img{float:left;}
#pyramid > div span{
line-height: 34px;
padding: 8px;
min-width: 20px;
display: inline-block;
text-align: center;
font-weight: bold;
}
#pyramid-footnote{
font-size: 0.8em;
text-align: center;
margin-top: 1em;
}
.color-legend span{font-size: 36px;font-weight: bold;vertical-align: middle;line-height: 16px;}
form{text-align:center;}
.render{ margin: 20px auto; }
body:last-child::after{display:none;}
div.render{height: auto;background:black;resize:none;}
.processing-status{
position: fixed;
bottom: 5px;
right: 5px;
}
.top-menu{
position: fixed;
top: 8px;
right: 8px;
}
.filter-full{
display:inline-flex;
}
#pyramid.filter-full .item.full{
display:none;
}
footer{
text-align: center;
font-size: 10px;
}
footer p{
margin: 0 0 2px 0;
}
a{ color: lightblue; }
a:visted{ color: lightblue; }
a:hover{text-decoration:none;}
input[type=file]{padding:8px;margin:0 auto 12px auto;}
input[type=file]:hover{background:#222;}
/* Parka */
#pyramid div.item[title="Caoivish Parka"]::after{
display: block;
content: "*";
color: #66bee1;
float: right;
margin-left: -20px;
font-weight: bold;
font-size: 20px;
}
span.snow{color: #66bee1;font-weight:bold;font-size:2em;vertical-align:middle;}
</style>
</body>
</html>