-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
396 lines (373 loc) · 19 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117108133-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-117108133-1', { 'send_page_view': false });
</script>
<meta charset="utf-8">
<title>Hardpoint.io - Star Citizen ship fitting and comparison tool</title>
<meta name="description" content="Web application for planning and comparing loadouts of Star Citizen ships with detailed component breakdown and summary statistics." />
<meta name="keywords" content="star citizen,sc,cig,ship,vehicle,spaceship,loadout,fitting,equipment,gear,items,tool,planner,app,theory,comparison" />
<link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/quasar@2.0.0-beta.14/dist/quasar.prod.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="q-app">
<q-layout view="hhh lpr fff">
<q-header elevated class="bg-grey-9 text-white">
<q-toolbar>
<q-toolbar-title>
Hardpoint.io
<span class="version">v3.20.0b Live</span>
</q-toolbar-title>
<q-btn-dropdown stretch flat no-caps label="New Loadout">
<q-list dense>
<q-item :to="link.target" v-for="link in vehicleLinks" :key="link.name">
{{link.name}}
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn stretch flat no-caps label="Vehicle Comparison" to="/"></q-btn>
</q-toolbar>
</q-header>
<q-page-container>
<router-view></router-view>
</q-page-container>
<q-footer elevated class="bg-grey-9 text-white">
<div>
<img src="community.png">
<div class="footer-text">
This is an unofficial <a href="https://robertsspaceindustries.com/">Star Citizen</a> fansite not affiliated with the <a href="https://cloudimperiumgames.com/">Cloud Imperium</a> group of companies.
<br />
All content on this site not authored by its host or users are property of their respective owners.
</div>
<div class="footer-text">
Feedback and sugggestions are appreciated on the <a href="https://discord.gg/M4dEWZr">Hardpoint.io Discord server</a>.
<br />
Thanks to <a href="https://github.com/dolkensp/unp4k">unp4k</a> for the data extraction tool and <a href="https://github.com/">GitHub</a> for the hosting!
</div>
</div>
</q-footer>
</q-layout>
</div>
<template id="selector-group">
<div :class="['group-container', 'level' + level, {'group-bracket': prototype.members.length > 1}]">
<div class="group-indicator" v-if="prototype.members.length > 1">
{{prototype.members.length}}x
<br />
<q-btn
class="compact"
@click="toggle"
no-caps
color="primary"
:label="grouped ? 'Ungroup' : 'Group'">
</q-btn>
</div>
<div class="row">
<item-selector :level="level" :bindings="array" v-for="array in bindingsArrays" :key="array[0].port.name + array[0].itemName">
</item-selector>
<div class="row">
</div>
</template>
<template id="item-selector">
<div class="spacer col-2" v-for="leftpad in level" :key="'left' + leftpad"></div>
<div class="selector col-8 row q-pa-sm">
<q-expansion-item
@show="trackExpansion"
@mouseover="setHoveredBindings(bindings)"
@mouseleave="setHoveredBindings([])"
header-class="q-pa-sm"
ref="expansion"
:disable="prototype.uneditable">
<template v-slot:header>
<q-item-section class="selector-header q-pa-none">
<q-list>
<q-item class="q-pa-none" v-if="!prototype.item">
Empty
</q-item>
<q-item class="q-pa-none" v-if="prototype.item">
<q-item-section top>
<b>{{prototype.item.displayName || prototype.item.name}}</b>
</q-item-section>
<q-item-section top side class="text-black">
<b>Size {{prototype.item.size}} {{prototype.item.type}}</b>
</q-item-section>
</q-item>
<q-item class="q-pa-none" v-if="prototype.item">
<q-item-section top v-html="summary">
</q-item-section>
<q-item-section top side class="text-black">
<span>
<span v-if="prototype.extension.powerConsumed > 0">
{{prototype.extension.powerConsumed}}
<q-icon style="color: lightseagreen" name="flash_on" display="inline-block"></q-icon>
</span>
<span v-if="prototype.extension.emSignature > 0">
{{_formatNumber(prototype.extension.emSignature, 0)}} EM
</span>
</span>
</q-item-section>
</q-item>
</q-list>
</q-item-section>
</template>
<div v-for="type in distinctTypes" :key="type">
<q-table
:title="type"
title-class="selector-table-title"
class="selector-table q-pa-sm"
dense
flat
hide-pagination
:rows="prototype.getMatchingItems(type)"
:columns="getColumns(type)"
:pagination="allRowsPagination"
row-key="item.name">
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
:class="(props.row.item.name==prototype.itemName) ? 'bg-accent text-white' : ''"
@click="select(props.row.item.name)">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
{{col.value}}
</q-td>
</q-tr>
</template>
</q-table>
</div>
</q-expansion-item>
<q-list dense separator class="power-selector">
<q-item
disabled
clickable
:active="prototype.powerLevel == 'overclocked'">
Overclk
</q-item>
<q-item
clickable
:active="prototype.powerLevel == 'active'"
@click="setPowerLevel('active')">
Active
</q-item>
<q-item
clickable
:active="prototype.powerLevel == 'standby'"
@click="setPowerLevel('standby')">
Standby
</q-item>
</q-list>
</div>
<q-item class="spacer col-2" v-for="rightpad in 2 - level" :key="'right' + rightpad"></q-item>
<selector-group :level="level + 1" :groups="array" v-for="array in groupArrays" :key="array[0].name">
</selector-group>
</template>
<template id="coverage-display">
<div class="col-12 coverage-display">
<q-tabs no-caps dense v-model="selectedView">
<q-tab name="Top" label="Top"></q-tab>
<q-tab name="Side" label="Side"></q-tab>
<q-tab name="Front" label="Front"></q-tab>
<q-tab name="Free" label="Free"></q-tab>
</q-tabs>
<div class=" q-pa-sm">
<div class="canvas-container" ref="container">
<canvas width="32px" height="32px" ref="canvas"></canvas>
</div>
</div>
</div>
</template>
<template id="custom-loadout">
<div class="custom-loadout q-pa-sm" v-if="requiredItems.length > 0">
<q-card>
<q-item class="card-title">
<q-item-section>
Loadout
</q-item-section>
<q-item-section side>
<div>
<q-btn
class="compact q-mr-sm"
@click="removeLoadout()"
no-caps
color="negative"
label="Delete"
v-if="metadata.storageKey">
</q-btn>
<q-btn
:disabled="saveDisabled"
class="compact"
@click="clickSave()"
no-caps
color="primary"
label="Save">
</q-btn>
</div>
</q-item-section>
</q-item>
<q-list dense class="full-width">
<q-item class="card-item-padding" v-for="entry in requiredItems" :key="entry.name">
<q-item-section>
{{entry.count}}x {{entry.displayName || entry.name}}
</q-item-section>
<q-item-section class="text-faded" side v-if="entry.available">
{{_formatNumber(entry.count * entry.basePrice / 1000, 0)}}k
</q-item-section>
<q-item-section class="text-faded" side v-else>
Unavailable
</q-item-section>
</q-item>
</q-list>
</q-card>
<q-dialog v-model="saveDialog">
<q-card style="min-width: 350px">
<q-card-section>
<div class="text-h6">Loadout Name</div>
</q-card-section>
<q-card-section class="q-pt-none">
<q-input
dense
v-model="loadoutName"
autofocus
:rules="[val => !val || val.length <= 24 || 'Maximum 24 characters']"
@keyup.enter="saveLoadout()">
</q-input>
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn no-caps color="primary" label="Cancel" v-close-popup></q-btn>
<q-btn no-caps color="primary" :disabled="!loadoutName" label="Save" @click="saveLoadout()" v-close-popup></q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<template id="vehicle-details">
<div class="subheader">
<h4>
{{loadout.vehicle.displayName}}
<template v-if="metadata.loadoutName"> / {{metadata.loadoutName}}</template>
</h4>
</div>
<div class="row q-pa-md">
<div class="details-sections col-9">
<q-expansion-item
class="q-pa-sm"
header-class="section-header"
dark
default-opened
:label="sectionName"
v-for="sectionName in sectionNames"
:key="loadout.vehicle.name + sectionName">
<selector-group
:level="1"
:groups="[group]"
v-for="group in makeGroups(sectionBindings[sectionName])"
:key="group.name">
</selector-group>
</q-expansion-item>
</div>
<div class="details-cards col-3">
<custom-loadout :loadout="loadout" :metadata="metadata">
</custom-loadout>
<div class="q-pa-sm" v-if="showTurretCoverage">
<q-card>
<q-item class="card-title">
Turret Coverage
</q-item>
<coverage-display :loadout="loadout">
</coverage-display>
</q-card>
</div>
<div class="sticky-side">
<div class="q-pa-sm row" v-for="cardName in Object.keys(summaryValues)" :key="cardName">
<q-card class="col-12 row">
<q-item class="col-12 card-title">
{{cardName}}
</q-item>
<div class="col-6 q-pa-sm" v-for="entry in summaryValues[cardName]" :key="entry.name">
<q-item-section>
<q-item-label>{{entry.name}}</q-item-label>
<q-item-label class="card-value text-faded">
<span class="summary-value">{{entry.value}}</span>
{{entry.units}}
</q-item-label>
</q-item-section>
</div>
</q-card>
</div>
</div>
</div>
</div>
</template>
<template id="vehicle-grid">
<div class="q-pa-md">
<q-item class="q-pa-none q-pb-md">
<q-item-section>
<q-input class="vehicle-search" dense outlined clearable placeholder="Search" v-model="filter.searchText">
<template v-slot:prepend>
<q-icon name="search"></q-icon>
</template>
</q-input>
</q-item-section>
<q-item-section side>
<q-btn
@click="filter.compareSelected = !filter.compareSelected"
:disabled="filter.selectedRows.length == 0 && !filter.compareSelected"
no-caps
color="primary"
:label="filter.compareSelected ? 'Show All' : 'Compare Selected'">
</q-btn>
</q-item-section>
</q-item>
<q-table
class="vehicle-grid"
dense
hide-bottom
selection="multiple"
v-model:selected="filter.selectedRows"
:row-key="rowKey"
:filter="filter"
:filter-method="filterRows"
:rows="loadouts"
:columns="columns"
:pagination="allRowsPagination">
<template v-slot:body-cell-edit="props">
<q-td :props="props">
<q-btn
class="compact"
@click="navigate(props.row)"
no-caps
color="primary"
label="Edit">
</q-btn>
</q-td>
</template>
</q-table>
</div>
</template>
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@4/dist/vue-router.global.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quasar@2.0.0-beta.14/dist/quasar.umd.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.98.0/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.98.0/examples/js/controls/TrackballControls.js"></script>
<script src ="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
<script src="data/vehicles.js"></script>
<script src="data/items.js"></script>
<script src="data/ammo_params.js"></script>
<script src="data/rotations.js"></script>
<script src="model.js"></script>
<script src="presentation.js"></script>
<script src="storage.js"></script>
<script src="controller.js"></script>
<script src="coverage.js"></script>
<script>
app.mount('#q-app');
</script>
</body>
</html>