Skip to content

Commit

Permalink
rebuild menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Kivou-2000607 committed Oct 13, 2019
1 parent 57a98f9 commit f22c341
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 191 deletions.
68 changes: 43 additions & 25 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,8 @@
{% block jquery %}{% endblock %}
<script>

$(document).on('click', 'a.yata-link-awards', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading awards (1 API call)</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
});

$(document).on('click', 'a.yata-link-target', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading targets</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
});

$(document).on('click', 'a.yata-link-chain', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading faction (2 API calls)</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
});

$(document).on('click', 'a.yata-link-bazaar', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading bazaar (1 API call)</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
});

$(document).on('click', 'a.yata-link-stock', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading stocks (1 API call)</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
});

$(document).on('click', 'a.yata-link-loot', function(e){
$("#yata-login").html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Loading loot</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
$(document).on('click', 'a[class^="yata-link"]', function(e){
$(this).html('<i class="fas fa-spinner fa-pulse"></i>');
});

$(document).on('click', 'a.news-read', function(e){
Expand Down Expand Up @@ -114,6 +94,43 @@
}
});

// refresh timer target update
window.setInterval(function(){
$("span#loot-countdown").each(function() {
var timeRefresh = $.trim($(this).text());
var splitRefresh = timeRefresh.split(" ");
var sRefresh = 0;
if (splitRefresh.length == 2) {
sRefresh = parseInt(splitRefresh[0]);
} else if (splitRefresh.length == 4) {
sRefresh = parseInt(splitRefresh[2]) + 60 * parseInt(splitRefresh[0]);
} else if (splitRefresh.length == 6) {
sRefresh = parseInt(splitRefresh[4]) + 60 * parseInt(splitRefresh[2]) + 3600 * parseInt(splitRefresh[0]);
}

sRefresh --;
sRefresh = Math.max(sRefresh, 0)
if (sRefresh == 0) {
$(this).parent("span").addClass("error");
$(this).parent("span").html("NOW");
}
hRefresh = Math.floor(sRefresh / 3600);
sRefresh = sRefresh % 3600;
mRefresh = Math.floor(sRefresh / 60);
sRefresh = sRefresh % 60;
if (hRefresh) {
spad = ("0"+sRefresh.toString()).slice(-2);
$(this).html(hRefresh.toString()+" hrs "+mRefresh.toString()+" mins "+spad+" s");
}
else if (mRefresh) {
spad = ("0"+sRefresh.toString()).slice(-2);
$(this).html(mRefresh.toString()+" mins "+spad+" s");
} else {
$(this).html(sRefresh.toString()+" s");
}
});
}, 1000);

</script>

<!-- favicon -->
Expand All @@ -134,10 +151,11 @@
<div id="container">
<div id="content">
{# <h1><img src="{% static "logo/yata.full.svg" %}" alt="YATA - Yet Another Torn App"></h1> #}
<h1>{% include "svg/yata.full.svg" %}</h1>
{# <h1>{% include "svg/yata.full.svg" %}</h1> #}
{# <h1><b>YATA:</b> <b>Y</b>et <b>A</b>nother <b>T</b>orn <b>A</b>pp</a></h1> #}

{% include "yata/login.html" %}
<div id="yata-login">
{% include "yata/login.html" %}
</div>
{% include "yata/section-message.html" %}
{% include "yata/error.html" %}

Expand Down
84 changes: 0 additions & 84 deletions templates/loot/categories.html

This file was deleted.

14 changes: 7 additions & 7 deletions templates/yata.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
check: $("#yata-login-remember").is(':checked'),
csrfmiddlewaretoken: document.getElementsByName('csrfmiddlewaretoken')[0].value,
});
reload.html('<h2 class="title grey"><i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Connecting to API (1 API call)</h2><div class="module"><i class="fas fa-spinner fa-pulse"></i></div>');
reload.find("td.d").html('<i class="fas fa-spinner fa-pulse"></i>&nbsp;&nbsp;Connecting to API (1 API call)');
});

$(document).on('click', '#yata-delete-submit', function(e){
Expand All @@ -46,12 +46,12 @@
It has been designed to enhance your gameplay using information from the <a href="http://api.torn.com" target="_blank">official Torn API</a>.<br />
To see what's in there, sign in and browse through the following categories.
</p>
<p><a class="yata-link-bazaar" href="{% url 'bazaar:index' %}"><i class="fas fa-store"></i>&nbsp;&nbsp;<b>Bazaar overview</b></a>: Look at the current bazaar prices and market value tendencies to sell or buy at the best prices.</p>
<p><a class="yata-link-stock" href="{% url 'stock:index' %}"><i class="fas fa-chart-line"></i>&nbsp;&nbsp;<b>Stock overview</b></a>: View all the stock shares, prices and tendencies.</p>
<p><a class="yata-link-chain" href="{% url 'chain:index' %}"><i class="fas fa-fist-raised"></i>&nbsp;&nbsp;<b>Faction</b></a>: Build your chain reports, join them together and monitor the faction.</p>
<p><a class="yata-link-target" href="{% url 'target:index' %}"><i class="fas fa-crosshairs"></i>&nbsp;&nbsp;<b>Targets</b></a>: Remember your good targets and maximize your respect gains during chains.</p>
<p><a class="yata-link-awards" href="{% url 'awards:index' %}"><i class="fas fa-medal"></i>&nbsp;&nbsp;<b>Awards</b></a>: Track the next award you can get.</p>
<p><a class="yata-link-loot" href="{% url 'loot:index' %}"><i class="fas fa-user-secret"></i>&nbsp;&nbsp;<b>Loot</b></a>: Gives the timing of when NPCs are reaching the different loot levels.</p>
<p><a class="yata-link-bazaar" href="{% url 'bazaar:index' %}"><i class="fas fa-store"></i>&nbsp;&nbsp;<b>Bazaar overview</b></a><br> Look at the current bazaar prices and market value tendencies to sell or buy at the best prices.</p>
<p><a class="yata-link-stock" href="{% url 'stock:index' %}"><i class="fas fa-chart-line"></i>&nbsp;&nbsp;<b>Stock overview</b></a><br> View all the stock shares, prices and tendencies.</p>
<p><a class="yata-link-chain" href="{% url 'chain:index' %}"><i class="fas fa-fist-raised"></i>&nbsp;&nbsp;<b>Faction</b></a><br> Build your chain reports, join them together and monitor the faction.</p>
<p><a class="yata-link-target" href="{% url 'target:index' %}"><i class="fas fa-crosshairs"></i>&nbsp;&nbsp;<b>Targets</b></a><br> Remember your good targets and maximize your respect gains during chains.</p>
<p><a class="yata-link-awards" href="{% url 'awards:index' %}"><i class="fas fa-medal"></i>&nbsp;&nbsp;<b>Awards</b></a><br> Track the next award you can get.</p>
<p><a class="yata-link-loot" href="{% url 'loot:index' %}"><i class="fas fa-user-secret"></i>&nbsp;&nbsp;<b>Loot</b></a><br> Gives the timing of when NPCs are reaching the different loot levels.</p>
{% if player %}
<hr class="sep">
<p><a id="yata-delete-submit" class="error" href="{% url 'delete' %}"><i class="fas fa-user-slash"></i>&nbsp;&nbsp;Delete account: </a> All your information will be removed from the database.</p>
Expand Down
Loading

0 comments on commit f22c341

Please sign in to comment.