-
Notifications
You must be signed in to change notification settings - Fork 3
/
panic_jtr.html
418 lines (372 loc) · 11.4 KB
/
panic_jtr.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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<!DOCTYPE html>
<html>
<head>
<title>SWGOH Tools - JTR Panic Farming Calculator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<meta charset="utf-8" />
<style>
p { max-width: 800px;}
.swgoh_ad {
position: absolute;
left:0;
top:90px;
width:0;
height:0px;
}
#ad {
width:100%;
height:60px;
}
h3 {
font-size: 1.2em;
margin-bottom: 4px;
}
@-webkit-keyframes blinker {
from,
49.9% {
opacity: 0;
}
50%,
to {
opacity: 1;
}
}
@-webkit-keyframes fader {
50% {
opacity: 0;
}
}
b.nowrap {
white-space: nowrap;
}
#panic {
text-align: center;
}
.dontpanic {
color: green;
font-size: 50px;
}
.panic {
color: red;
font-size: 50px;
animation: blinker 1s linear infinite;
}
.maybepanic {
color: black;
font-size: 50px;
animation: blinker 1s linear infinite;
}
#dontpanic, #dont, #do {
display: none;
}
@media(min-width: 520px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 328px; height: 90px; } }
@media(min-width: 720px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 528px; height: 90px; } }
@media(min-width: 920px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 728px; height: 90px; } }
@media(min-width: 1200px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 1000px; height: 90px; } }
</style>
<script src="https://use.fontawesome.com/c278e2b3ff.js"></script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
var storage = null;
if(window.localStorage) storage = window.localStorage;
else if(window.globalStorage) storage = window.globalStorage[location.hostname];
var left = 0;
function cacheForm(name) {
var val = fetch(name);
if(val) $('#'+name).val(val);
$('#'+name).on("change",function(e) {
store(name,$('#'+name).val());
});
}
function store(key,val) {
storage.setItem(key,val);
}
function fetch(key) {
return storage.getItem(key);
}
function getLeft() {
var days = parseInt($("#days").val())+6;
left = new Date().setHours(24*days);
update();
}
function timer() {
var now = new Date().getTime();
var display = (left - now)/(1000*60);
$('#timeleft').html(display.toFixed(3)+" minutes left!");
}
function update() {
var c = parseInt(update1('chew'));
var h = parseInt(update1('han'));
var total = c+h;
$('#total_total').html(total);
var days = parseInt($("#days").val())+6;
var perDay = total/days;
$('#ends').html(days+1);
$('#perday').html(Math.ceil(perDay*10)/10);
//free = 189 energy = 3.9 shards
//1 = 120 = 2.4 shards (100 crystals)
//2 = 120 = 2.4 shards (100 crystals)
//3 = 120 = 2.4 shards (100 crystals)
// 16 shards per day avaialable from shipments at 320/4 shards (80/s)
//4 = 120 = 2.4 shards (200 crystals)
//5 = 120 = 2.4 shards (200 crystals)
//6 = 120 = 2.4 shards (400 crystals)
var refreshes = 0;
var shipments = 0;
var crystals = 0;
var special_total = 0;
$('#dont').hide();
$('#do').hide();
if(perDay<=3.9) { //free crystals
$('#dont').show();
} else if(perDay<=6.3) { //1 refresh
refreshes = 1;
crystals = 100;
$('#dont').show();
} else if(perDay<=8.7) { //2 refreshes
refreshes = 2;
crystals = 200;
$('#dont').show();
} else if(perDay<=11.1) { //3 refreshes
refreshes = 3;
crystals = 300;
$('#dont').show();
} else if(perDay<=13.5) { //4 refreshes
refreshes = 4;
crystals = 500;
$('#dont').show();
} else if(perDay<=15.1) { //3 refreshes + 1 shipment
refreshes = 3;
shipments = 1;
crystals = 620;
$('#do').show();
} else if(perDay<=15.9) { //5 refreshes
refreshes = 5;
crystals = 700;
$('#do').show();
} else if(perDay<=17.5) { //4 refreshes + 1 shipment
refreshes = 4;
shipments = 1;
crystals = 820;
$('#do').show();
} else if(perDay<=19.1) { //3 refreshes + 2 shipments
refreshes = 3;
shipments = 2;
crystals = 940;
$('#do').show();
} else if(perDay<=19.9) { //5 refreshes + 1 shipment
refreshes = 5;
shipments = 1;
crystals = 1020;
$('#do').show();
} else if(perDay<=21.5) { //4 refreshes + 2 shipment
refreshes = 4;
shipments = 2;
crystals = 1140;
$('#do').show();
} else if(perDay<=23.1) { //3 refreshes + 3 shipments
refreshes = 3;
shipments = 3;
crystals = 1260;
$('#do').show();
} else if(perDay<=23.9) { //5 refreshes + 2 shipments
refreshes = 5;
shipments = 2;
crystals = 1340;
$('#do').show();
} else if(perDay<=25.5) { //4 refreshes + 3 shipments
refreshes = 4;
shipments = 3;
crystals = 1460;
$('#do').show();
} else if(perDay<=27.1) { //3 refreshes + 4 shipments
refreshes = 3;
shipments = 4;
crystals = 1580;
$('#do').show();
} else if(perDay<=27.9) { //5 refreshes + 3 shipments
refreshes = 5;
shipments = 3;
crystals = 1660;
$('#do').show();
} else if(perDay<=29.5) { //4 refreshes + 4 shipments
refreshes = 4;
shipments = 4;
crystals = 1780;
$('#do').show();
} else if(perDay<=31.9) { //5 refreshes + 4 shipments
refreshes = 5;
shipments = 4;
crystals = 1980;
$('#do').show();
} else if(perDay<=34.3) { //6 refreshes + 4 shipments
refreshes = 6;
shipments = 4;
crystals = 2380;
$('#do').show();
} else if(perDay<=36.7) { //7 refreshes + 4 shipments
refreshes = 7;
shipments = 4;
crystals = 2780;
$('#do').show();
} else {
refreshes = "7+";
shipments = 4;
crystals = "2780+";
special_total = 2780*days;
$('#do').show();
}
$("#refreshes").html(refreshes);
$("#shipments").html(shipments);
$("#crystals").html(crystals);
$("#totalcrystals").html(crystals*days);
if(refreshes=="7+") $("#totalcrystals").html(special_total+"+");
}
function update1(who) {
var stars = parseInt($('#'+who+'_stars').val());
var shards = parseInt($('#'+who+'_shards').val());
if(isNaN(stars)) stars = 0;
if(isNaN(shards)) shards = 0;
if(stars>=7) {
$("#"+who+"_sh").hide();
} else {
$("#"+who+"_sh").show();
}
var remain7 = 0;
if(stars==7) {
remain7 = 0;
} else if(stars==6) {
$('#'+who+'_max').html("100");
remain7 = 100-shards;
} else if(stars==5) {
$('#'+who+'_max').html("85");
remain7 = 185-shards;
} else if(stars==4) {
$('#'+who+'_max').html("65");
remain7 = 250-shards;
} else if(stars==3) {
$('#'+who+'_max').html("30");
remain7 = 280-shards;
} else if(stars==2) {
$('#'+who+'_max').html("25");
remain7 = 305-shards;
} else if(stars==1) {
$('#'+who+'_max').html("15");
remain7 = 320-shards;
} else {
$('#'+who+'_max').html("10");
remain7 = 330-shards;
}
$('#'+who+'_total').html(remain7);
return remain7;
}
function panic() {
update();
$('#panic').hide();
$('#dontpanic').show();
return false;
}
cacheForm("chew_stars");
cacheForm("chew_shards");
cacheForm("han_stars");
cacheForm("han_shards");
//cacheForm("days");
$("#chew_stars").on("change", update);
$("#chew_shards").on("change", update);
$("#han_stars").on("change", update);
$('#han_shards').on("change", update);
$('#days').on("change", getLeft);
var now = new Date().getTime();
var days = 1513299681000-now;
days = Math.ceil(days/(86400000));
//$('#days').val(days);
$('#button').on("click", panic);
setInterval(timer,130);
getLeft();
update();
});
</script>
</head>
<body>
<div id="top">
<a href="http://www.swgoh.life/index.html" id="logoClick"></a>
<div id="ad">
<!-- Swgoh.life -->
<ins class="adsbygoogle swgoh_ad"
style="display:block"
data-ad-client="ca-pub-0176506581219642"
data-ad-slot="9855290481"
data-ad-format="horizontal"></ins>
<script>
//https://support.google.com/adsense/answer/6307124
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<div id="middleSolo">
<h1><a href="http://www.swgoh.life/index.html">More Tools</a> > <a href="http://www.swgoh.life/panic.html">Panic Farming</a> > Panic Farming Calculator</h1>
<p>Enter your stars/shards for each toon you are panicing about and we'll tell you if you really need to panic.</p>
<div class="half">
<form action="#" method="post">
<h3>Veteran Smuggler Chewbacca:</h3>
Stars: <input type="text" id="chew_stars" name="chew_stars" value="1" size="2" />/ 7<br />
<span id="chew_sh">Shards: <input type="text" id="chew_shards" name="chew_shards" value="0" size="2" />/ <span id="chew_max">15</span><br /></span>
<br />
<h3>Veteran Smuggler Han Solo:</h3>
Stars: <input type="text" id="han_stars" name="han_stars" value="1" size="2" />/ 7<br />
<span id="han_sh">Shards: <input type="text" id="han_shards" name="han_shards" value="0" size="2" />/ <span id="han_max">15</span><br /></span>
<br />
<h3>How many days until the event starts?</h3>
<input type="text" id="days" name="days" value="" size="3" /><br /><br />
<input type="submit" id="button" value="Should I Panic?" class="btn" />
<br /><br />
</form>
</div>
<div class="half">
<div id="panic">
<b class="maybepanic">DON'T PANIC</b>
</div>
<div id="dontpanic">
<h3>Shards Needed:</h3>
<span id="chew_total"></span> shards needed for Veteran Smuggler Chewbacca.<br />
<span id="han_total"></span> shards needed for Veteran Smuggler Han Solo.<br />
<span id="total_total"></span> total shards needed.<br />
<br />
<h3>Farming Required:</h3>
The event ends in <span id="ends"></span> days. You need to farm <span id="perday"></span> shards per day.<br /><br />
You need to do <b class="nowrap"><span id="refreshes"></span> cantina refreshes</b> every day and purchase
<b class="nowrap"><span id="shipments"></span> shipments</b> (4 shards for 320 crystals) each day.<br />
<br />
This will require <span id="crystals"></span> crystals per day. <b class="nowrap"><span id="totalcrystals"></span> crystals total</b>.<br />
<br />
<b class="dontpanic" id="dont">DON'T PANIC</b>
<b class="panic" id="do">OK, PANIC</b>
<b id="timeleft"></b>
</div>
</div>
<br /><br /><hr /><ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-0176506581219642"
data-ad-slot="6732943283"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-92624-14', 'auto');
ga('send', 'pageview');
</script>
</div>
<div id="foot">
<p>SWGOH.LIFE is not affiliated with EA, EA Capital Games, Disney or Lucasfilm LTD.</p>
</div>
</body>
</html>