Added About us page, Changed some things with damage calculation, changed some things with links, Changed some HTML Code.
This commit is contained in:
@@ -17,15 +17,18 @@ def index():
|
||||
def get_guns():
|
||||
updated_guns = []
|
||||
for gun in guns:
|
||||
original_damage = gun['damage']
|
||||
# Calculate RPS, DPS, DPM, avgDPS
|
||||
rps = gun['rpm'] / 60
|
||||
dps = gun['damage'] * rps
|
||||
dps = original_damage * rps
|
||||
reload_time_min = gun['reload_time'] / 60
|
||||
dpm = (gun['mag_size'] * gun['damage']) / (reload_time_min + (gun['mag_size'] / gun['rpm']))
|
||||
dpm = (gun['mag_size'] * original_damage) / (reload_time_min + (gun['mag_size'] / gun['rpm']))
|
||||
avg_dps = dpm / 60
|
||||
total_damage = original_damage * gun['damage_multiplier']
|
||||
|
||||
# Add calculated stats to the gun data
|
||||
gun.update({
|
||||
'total_damage': total_damage,
|
||||
'rps': rps,
|
||||
'dps': dps,
|
||||
'dpm': dpm,
|
||||
@@ -35,10 +38,12 @@ def get_guns():
|
||||
|
||||
return jsonify(updated_guns)
|
||||
|
||||
|
||||
@app.route('/calculator')
|
||||
def calculator():
|
||||
return render_template('calculator.html')
|
||||
|
||||
|
||||
@app.route('/about_us')
|
||||
def about_us():
|
||||
return render_template('about_us.html')
|
||||
@@ -61,5 +66,6 @@ def average_dpm_calculation():
|
||||
dpm = float(dpm_calculation())
|
||||
return round(dpm / 60, 2)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
app.run(debug=True)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
{
|
||||
"id": 12,
|
||||
"name": "R870",
|
||||
"damage": 552,
|
||||
"damage": 92,
|
||||
"damage_multiplier": 6,
|
||||
"rpm": 70,
|
||||
"mag_size": 12,
|
||||
@@ -122,7 +122,7 @@
|
||||
{
|
||||
"id": 14,
|
||||
"name": "Scattergun",
|
||||
"damage": 232,
|
||||
"damage": 58,
|
||||
"damage_multiplier": 4,
|
||||
"rpm": 300,
|
||||
"mag_size": 7,
|
||||
@@ -132,7 +132,7 @@
|
||||
{
|
||||
"id": 16,
|
||||
"name": "Shorty",
|
||||
"damage": 116,
|
||||
"damage": 29,
|
||||
"damage_multiplier": 4,
|
||||
"rpm": 185,
|
||||
"mag_size": 8,
|
||||
@@ -142,7 +142,7 @@
|
||||
{
|
||||
"id": 18,
|
||||
"name": "AA12",
|
||||
"damage": 88,
|
||||
"damage": 22,
|
||||
"damage_multiplier": 4,
|
||||
"rpm": 300,
|
||||
"mag_size": 20,
|
||||
@@ -412,7 +412,7 @@
|
||||
{
|
||||
"id": 46,
|
||||
"name": "RC12",
|
||||
"damage": 200,
|
||||
"damage": 50,
|
||||
"damage_multiplier": 4,
|
||||
"rpm": 225,
|
||||
"mag_size": 10,
|
||||
@@ -772,7 +772,7 @@
|
||||
{
|
||||
"id": 83,
|
||||
"name": "SPAS-12",
|
||||
"damage": 192,
|
||||
"damage": 24,
|
||||
"damage_multiplier": 8,
|
||||
"rpm": 150,
|
||||
"mag_size": 8,
|
||||
|
||||
+9
-10
@@ -13,15 +13,14 @@ function populateTable(data) {
|
||||
const row = table.insertRow();
|
||||
row.insertCell(0).innerText = gun.id;
|
||||
row.insertCell(1).innerText = gun.name;
|
||||
row.insertCell(2).innerText = gun.damage;
|
||||
row.insertCell(3).innerText = gun.damage_multiplier;
|
||||
row.insertCell(4).innerText = gun.rpm;
|
||||
row.insertCell(5).innerText = gun.mag_size;
|
||||
row.insertCell(6).innerText = gun.reload_time;
|
||||
row.insertCell(7).innerText = gun.guntype;
|
||||
row.insertCell(8).innerText = gun.rps.toFixed(2);
|
||||
row.insertCell(9).innerText = gun.dps.toFixed(2);
|
||||
row.insertCell(10).innerText = gun.dpm.toFixed(2);
|
||||
row.insertCell(11).innerText = gun.avg_dps.toFixed(2);
|
||||
row.insertCell(2).innerText = gun.total_damage;
|
||||
row.insertCell(3).innerText = gun.rpm;
|
||||
row.insertCell(4).innerText = gun.mag_size;
|
||||
row.insertCell(5).innerText = gun.reload_time;
|
||||
row.insertCell(6).innerText = gun.guntype;
|
||||
row.insertCell(7).innerText = gun.rps.toFixed(2);
|
||||
row.insertCell(8).innerText = gun.dps.toFixed(2);
|
||||
row.insertCell(9).innerText = gun.dpm.toFixed(2);
|
||||
row.insertCell(10).innerText = gun.avg_dps.toFixed(2);
|
||||
});
|
||||
}
|
||||
+7
-1
@@ -7,6 +7,7 @@ body {
|
||||
z-index: -1; /* Send the background behind the content */
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
header nav {
|
||||
@@ -114,7 +115,7 @@ nav {
|
||||
/* Add a black background color to the top navigation */
|
||||
.topnav {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
right: 50px;
|
||||
top: 10px;
|
||||
background-color: #333;
|
||||
overflow: visible; /* Ensure dropdown content isn't clipped */
|
||||
@@ -209,3 +210,8 @@ nav {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.about_us_text{
|
||||
font-size: 20px;
|
||||
width: 50%;
|
||||
}
|
||||
+39
-1
@@ -47,7 +47,45 @@
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<body>
|
||||
<body class="background-image">
|
||||
<main>
|
||||
<h1>About Us</h1>
|
||||
<h3><b>Hey there!</b> You seem to have stumbled upon the TRL Stat Page created by <b>Fretux</b> and <b>Losernoob124!</b></h3><br>
|
||||
<h2>Our Mission</h2>
|
||||
<p class="about_us_text">This website exists because we want to provide the
|
||||
TRL Community with an easy go-to way to calculate DPS and DPM values to help players make informed decisions
|
||||
about their gameplay. Whether you're fine-tuning your new Deathwish Strategy or simply curious about firearm
|
||||
performance, we’ve got you covered. If you have suggestions, feedback, or want to contribute new stats or
|
||||
features, we’d love to hear from you, just contact us on Discord!
|
||||
</p>
|
||||
<h2>Our Story</h2>
|
||||
<p class="about_us_text">
|
||||
In the beginning, the only way to calculate DPS/DPM stats for certain operatives was, by using the Spreadsheet
|
||||
by Lanz1021 and a calculator, which quickly turned out to be (shockers) really annoying. TRL Stats started out
|
||||
as a side project, initially started by Losernoob124 to calculate gun stats more easily, but given up one after
|
||||
a couple of weeks. Eventually Fretux started working on it again and what initially was just a fun hobby grew
|
||||
into something much bigger, and through the help of Stack Overflow and many hours of programming, we
|
||||
turned it into a full-fledged website.
|
||||
</p>
|
||||
<h2>The Team</h2>
|
||||
<p class="about_us_text">
|
||||
<b>Fretux</b> - Frontend Developer and Data Specialist. Responsible for the designing of the website and making
|
||||
sure the gun stats are accurate and up to date.
|
||||
</p>
|
||||
<p class="about_us_text">
|
||||
<b>Losernoob124</b> - Backend Developer. Responsible for all the scripts that make sure the website functions
|
||||
correctly.
|
||||
</p>
|
||||
<h2>Frequently Asked Questions</h2>
|
||||
<p class="about_us_text"><b>How do you calculate DPS and DPM?</b></p>
|
||||
<p class="about_us_text">We put the data given by
|
||||
<a href="https://docs.google.com/spreadsheets/d/1hGGLMOKB5Tj3FSo38HX7WbIvOmMbgfE5ZApTSOZgnS8/edit?gid=0#gid=0">Lanz1021's
|
||||
Stat Sheet</a> into a <a href="https://www.w3schools.com/whatis/whatis_json.asp">.JSON (Javascript Object Notation)</a> file, which we use to calculate the DPS
|
||||
(damage per second) and DPM (damage per minute) of each weapon via a formula that is also mentioned on Lanz1021' Spreadsheet.</p>
|
||||
|
||||
<p class="about_us_text"><b>How often are stats updated?</b></p>
|
||||
<p class="about_us_text">We update the weapon stats every time a new update is released for TRL.</p><br>
|
||||
<h3 class="about_us_text">Thank you for visiting <b>TRL Stats</b>.</h3>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -57,7 +57,6 @@
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Damage</th>
|
||||
<th>Damage multiplier</th>
|
||||
<th>Rounds per minute</th>
|
||||
<th>Magazine Size</th>
|
||||
<th>Reload time</th>
|
||||
|
||||
Reference in New Issue
Block a user