Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix styling #2282

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/constants/weight/farming-weight.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,15 @@ export function calculateFarmingWeight(userProfile) {

output.weight += weight;

const mushroomScaling = 90_178.06;

const mushroomCollection = farmingCollection.find((a) => a.id === "MUSHROOM_COLLECTION")?.amount ?? 0;

const total = output.weight;
const doubleBreakRatio = total <= 0 ? 0 : (output.crops.CACTUS.weight + output.crops.SUGAR_CANE.weight) / total;
const normalRatio = total <= 0 ? 0 : (total - output.crops.CACTUS.weight - output.crops.SUGAR_CANE.weight) / total;

const mushroomWeight =
doubleBreakRatio * (mushroomCollection / (2 * mushroomScaling)) +
normalRatio * (mushroomCollection / mushroomScaling);
doubleBreakRatio * (mushroomCollection / (2 * crops.MUSHROOM_COLLECTION.weight)) +
normalRatio * (mushroomCollection / crops.MUSHROOM_COLLECTION.weight);

output.weight -= output.crops.MUSHROOM_COLLECTION.weight;
output.crops.MUSHROOM_COLLECTION.weight = mushroomWeight;
Expand Down
2 changes: 1 addition & 1 deletion src/stats/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function getItems(
}
});

let [
const [
armor,
equipment,
inventory,
Expand Down
18 changes: 9 additions & 9 deletions views/sections/stats/basic_stats.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="additional_stats_container">
<!-- Current Area -->
<% if (calculated.user_data?.current_area?.current_area !== undefined) { %>
<div class="additional-stat">
<div class="additional-stat">
<span class="stat-name"><%= calculated.user_data.current_area_updated ? 'Current' : 'Last' %> Area: </span>
<span class="stat-value"><%= calculated.user_data.current_area.current_area %></span>
</div>
Expand All @@ -22,18 +22,18 @@
<span class="stat-name">Joined: </span>
<span class="stat-value"><%= calculated.user_data.first_join.text %></span>
</span>
</div>
<% } %>
</div>
<% } %>

<!-- Purse -->
<% if ('purse' in calculated.currencies && calculated.currencies.purse > 0) { %>
<div class="additional-stat">
<span class="stat-name">Purse: </span>
<span class="stat-value"><%= helper.formatNumber(calculated.currencies.purse, true) %> Coin<%= Math.floor(calculated.currencies.purse) == 1 ? '': 's' %>
</span>
</div>
<% } %>
<% } %>

<!-- Bank -->
<% if ('bank' in calculated.currencies && calculated.currencies.bank > 0) { %>
<div class="additional-stat">
Expand Down Expand Up @@ -106,7 +106,7 @@
weight.total -= weight.skill;
weight.skill = 0;
}

if (weight.total === 0) {
continue;
} %>
Expand Down Expand Up @@ -138,7 +138,7 @@
</span>
</div>
<% } %>
<% } %>
<% } %>

<!-- Networth -->
<% if (calculated.networth.noInventory === false) { %>
Expand Down Expand Up @@ -240,4 +240,4 @@
</div>
<% } %>
</div>
</div>
</div>
8 changes: 4 additions & 4 deletions views/sections/stats/bestiary.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<h2 class="stat-header">Bestiary</h2>
<div class="stat-content">
<p class="stat-raw-values">
<% max = calculated.bestiary.milestone === calculated.bestiary.maxMilestone ? 'golden-text' : ''; %>
<% max = calculated.bestiary.milestone === calculated.bestiary.maxMilestone ? 'golden-text' : ''; %>
<span class="stat-name <%= max %>">Bestiary Level: </span>
<span class="stat-value <%= max %>"><%= calculated.bestiary.milestone / 10 %> / <%= calculated.bestiary.maxMilestone / 10 %></span>
<br>

<% max = calculated.bestiary.familiesUnlocked === calculated.bestiary.totalFamilies ? 'golden-text' : ''; %>
<% max = calculated.bestiary.familiesUnlocked === calculated.bestiary.totalFamilies ? 'golden-text' : ''; %>
<span class="stat-name <%= max %>">Families Unlocked: </span>
<span class="stat-value <%= max %>"><%= calculated.bestiary.familiesUnlocked %> / <%= calculated.bestiary.totalFamilies %></span>
<br>

<% max = calculated.bestiary.familiesMaxed === calculated.bestiary.totalFamilies ? 'golden-text' : ''; %>
<% max = calculated.bestiary.familiesMaxed === calculated.bestiary.totalFamilies ? 'golden-text' : ''; %>
<span class="stat-name <%= max %>">Families Completed: </span>
<span class="stat-value <%= max %>"><%= calculated.bestiary.familiesMaxed %> / <%= calculated.bestiary.totalFamilies %></span>
<br>
Expand All @@ -37,7 +37,7 @@
<div class="chip-icon-wrapper">
<div style="background-image:url(<%= family.texture %>)" class="item-icon custom-icon"></div>
</div>

<div class="chip-text">
<% max = family.tier >= family.maxTier ? 'max-stat' : ''; %>
<div class="bestiary-name <%= max %>"><span class="stat-name"><%= family.name %> </span><span class="stat-value"><%= family.tier %></span></div>
Expand Down
2 changes: 1 addition & 1 deletion views/sections/stats/bingo.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a class="stat-anchor" id="Bingo"></a>
<h2 class="stat-header">Bingo</h2>
<div class="stat-content">
<p class="stat-raw-values">
<p class="stat-raw-values">
<!-- Bingo Profiles -->
<% if (calculated.bingo.profiles !== undefined) { %>
<span class="stat-name">Bingo Profiles:</span>
Expand Down
10 changes: 5 additions & 5 deletions views/sections/stats/collections.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<a class="stat-anchor" id="Collections"></a>
<h2 class="stat-header">Collections</h2>
<div class="stat-content">

<% max = calculated.collections.maxedCollections === calculated.collections.totalCollections ? 'golden-text' : ''; %>
<span class="stat-name <%= max %>">Maxed Collections: </span>
<span class="stat-value <%= max %>"><%= calculated.collections.maxedCollections %> / <%= calculated.collections.totalCollections %></span>

<% for (const [category, categoryData] of Object.entries(calculated.collections)) { %>
<% if (categoryData.collections === undefined || categoryData.collections.length === 0) {
continue;
Expand All @@ -23,11 +23,11 @@
<span class="category-header-detail">(<%= categoryData.maxTiers %> / <%= categoryData.totalTiers %> max)</span>
<% } %>
</div>
<div class="collections">
<% for (const collection of categoryData.collections) {
<div class="collections">
<% for (const collection of categoryData.collections) {
let amountsTooltip = "";

if (collection.amounts !== undefined) {
if (collection.amounts !== undefined) {
amountsTooltip = collection.amounts.map(amount => `<span class="stat-name">${amount.username}: </span><span class="stat-value">${amount.amount.toLocaleString()}</span>`).join('<br>') + `<br><br><span class="stat-name">Total: </span><span class="stat-value">${collection.totalAmount.toLocaleString()}</span>`;
} else if (collection.rewards !== undefined) {
amountsTooltip = `<span class="stat-name">Rewards:</span>`;
Expand Down
8 changes: 4 additions & 4 deletions views/sections/stats/crimson_isle.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%
<%

function getDojoRank(points) {
if (points >= 1000) return 'S'
Expand All @@ -23,13 +23,13 @@ function getDojoRank(points) {
<span class="stat-name">Selected Faction: </span>
<span class="stat-value"><%= calculated.crimson_isle.factions.selected_faction %></span>
<br>

<!-- Mage Faction Reputation -->
<% max = calculated.crimson_isle.factions.mages_reputation >= 12000 ? 'golden-text' : '' %>
<span class="stat-name <%= max %>">Mage Reputation: </span>
<span class="stat-value <%= max %>"><%= calculated.crimson_isle.factions.mages_reputation.toLocaleString() %></span>
<br>

<!-- Barbarian Faction Reputation -->
<% max = calculated.crimson_isle.factions.barbarians_reputation >= 12000 ? 'golden-text' : '' %>
<span class="stat-name <%= max %>">Barbarian Reputation: </span>
Expand Down Expand Up @@ -67,7 +67,7 @@ function getDojoRank(points) {

<% if (calculated.crimson_isle.dojo?.total_points) { %>
<p class="stat-sub-header">Dojo Completions</p>

<!-- Dojo Points -->
<% max = calculated.crimson_isle.dojo.total_points >= 7000 ? 'golden-text' : '' %>
<span class="stat-name <%= max %>">Total Points: </span>
Expand Down
20 changes: 10 additions & 10 deletions views/sections/stats/items/accessories.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%
<%

function formatEnrichment(string) {
let enrichment = string.split('_').join(' ').trim()
Expand Down Expand Up @@ -30,7 +30,7 @@ function getEnrichments(accessories) {
if (filteredAccessories.length === 0) {
return;
}

const enrichmentCounts = {};
filteredAccessories.map((accessory) => {
if (constants.SPECIAL_ACCESSORIES[helper.getId(accessory)]?.allowsEnrichment === false) return;
Expand All @@ -45,11 +45,11 @@ function getEnrichments(accessories) {
<span class="stat-value color-<%= stat.replaceAll("_", "-") %>">
<%= amount %>× <%= formatEnrichment(enrichment) %>
</span>

<% if (enrichment !== Object.keys(enrichmentCounts).pop()) { %>
<span class="bonus-divider" role="separator"> // </span>
<% }
}
<% }
}
}

function itemIcon(item, classes) { %>
Expand Down Expand Up @@ -110,7 +110,7 @@ function itemIcon(item, classes) { %>
<% if (calculated.accessories.magical_power.abiphone) { %>
<span style='color: var(--§<%= constants.RARITY_COLORS["rare"] %>);' class='grey-text'>Abicase</span> = <span style='color: var(--§6);' class='grey-text'>+<%= calculated.accessories.magical_power.abiphone %> MP</span><br>
<% } %>

<% if (calculated.accessories.magical_power.rift_prism) { %>
<span style='color: var(--§<%= constants.RARITY_COLORS["rare"] %>);' class='grey-text'>Rift Prism:</span> = <span style='color: var(--§6);' class='grey-text'>+<%= calculated.accessories.magical_power.rift_prism %> MP</span><br>
<% } %>
Expand All @@ -127,7 +127,7 @@ function itemIcon(item, classes) { %>
</span>
<br>
</p>

<!-- Active Accessories -->
<% if (items.accessories.accessories.find(a => !a.isInactive) != undefined) { %>
<div class="accessory-list">
Expand Down Expand Up @@ -168,7 +168,7 @@ function itemIcon(item, classes) { %>

<!-- Missing Accessories and Missing Accessory Upgrades -->
<% if (calculated.accessories.missing.length > 0 || calculated.accessories.upgrades.length > 0) {
if (inactiveAccessories.length > 0) { %>
if (inactiveAccessories.length > 0) { %>
<br>
<% } %>

Expand All @@ -177,7 +177,7 @@ function itemIcon(item, classes) { %>
<!-- Missing Accessories -->
<% if (calculated.accessories.missing.length > 0) { %>
<p class="stat-sub-header">Missing Accessories<span data-tippy-content='Missing accessories that are <strong>not</strong> upgrades of another accessory.'></span></p>

<% for (const [index, accessory] of calculated.accessories.missing.entries()) { %>
<div tabindex="0" data-missing-accessory-index="<%= index %>" class="rich-item piece piece-<%= accessory.rarity %>-bg missing-accessory">
<div style='background-image: url("<%= accessory.texture_path %>")' class="piece-icon item-icon custom-icon"></div>
Expand All @@ -188,7 +188,7 @@ function itemIcon(item, classes) { %>
<!-- Missing Accessory Upgrades -->
<% if (calculated.accessories.upgrades.length > 0) { %>
<p class="stat-sub-header">Missing Accessory Upgrades<span data-tippy-content='Missing accessories that are upgrades of a lower tier accessory.'></span></p>

<% for (const [index, accessory] of calculated.accessories.upgrades.entries()) { %>
<div tabindex="0" data-upgrade-accessory-index="<%= index %>" class="rich-item piece piece-<%= accessory.rarity %>-bg missing-accessory">
<div style='background-image: url("<%= accessory.texture_path %>")' class="piece-icon item-icon custom-icon"></div>
Expand Down
2 changes: 1 addition & 1 deletion views/sections/stats/items/inventory.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<div class="inventory-tab-name">Quiver</div>
</button>
<% } %>

<% if (items.museum && items.museum.length > 0) { %>
<button class="inventory-tab" data-inventory-type="museum">
<div class="inventory-tab-icon item-icon custom-icon" style="background-image: url(/head/438cf3f8e54afc3b3f91d20a49f324dca1486007fe545399055524c17941f4dc)"></div>
Expand Down
8 changes: 4 additions & 4 deletions views/sections/stats/minions.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<br>

<!-- Bonus Minion Slots (Community Shop) -->
<% if (calculated.misc?.profile_upgrades?.minion_slots !== undefined) { %>
<% if (calculated.misc?.profile_upgrades?.minion_slots !== undefined) { %>
<% max = calculated.misc.profile_upgrades.minion_slots === 5 ? 'golden-text' : '' %>
<span class="stat-name <%= max %>">Bonus Minion Slots: </span>
<span class="stat-value <%= max %>"><%= calculated.misc.profile_upgrades.minion_slots %> / <%= constants.PROFILE_UPGRADES['minion_slots'] %></span>
Expand All @@ -33,7 +33,7 @@
<span class="stat-value <%= max %>"><%= calculated.minions.maxedMinions %> / <%= calculated.minions.totalMinions %></span>
<br>
</p>

<!-- Unlocked Minions -->
<% for (const [category, categoryData] of Object.entries(calculated.minions.minions)) { %>
<% if (categoryData.minions === undefined) continue; %>
Expand All @@ -49,8 +49,8 @@
<% } %>
</div>

<div class="collections">
<% for (const minion of categoryData.minions) {
<div class="collections">
<% for (const minion of categoryData.minions) {
let amountsTooltip = "";
for (let i = 1; i <= minion.maxTier; i++) {
amountsTooltip += `<div class='minion-variant ${minion.tiers.includes(i) ? "minion-crafted" : ""}'>${helper.romanize(i)}</div>`
Expand Down
2 changes: 1 addition & 1 deletion views/sections/stats/misc.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 class="stat-header">Miscellaneous</h2>
<div class="stat-content">
<!-- Essence (Essence and Essence Shop) -->
<% if (calculated.dungeons?.essence !== undefined) { %>
<% if (calculated.dungeons?.essence !== undefined) { %>
<%- include('./misc/essence.ejs', {}); %>
<% } %>

Expand Down
12 changes: 6 additions & 6 deletions views/sections/stats/misc/auctions.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<div class="category-icon">
<div class="item-icon icon-266_0"></div>
</div>

<span class="category-name">Auctions sold</span>
</div>

<p class="stat-raw-values">
<!-- Fees Paid -->
<% if (calculated.misc.auctions.fees !== undefined) { %>
<% if (calculated.misc.auctions.fees !== undefined) { %>
<span class="stat-name">Fees: </span>
<span class="stat-value"><%= calculated.misc.auctions.fees.toLocaleString() %></span>
<br>
Expand Down Expand Up @@ -38,7 +38,7 @@
<br>
`;
}

const itemsSold = Object.values(calculated.misc.auctions.total_sold).reduce((a, b) => a + b, 0); %>

<span data-tippy-content='<%= tooltip %>'>
Expand All @@ -54,7 +54,7 @@
<div class="category-icon">
<div class="item-icon icon-264_0"></div>
</div>

<span class="stat-sub-header">Auctions bought</span>
</div>

Expand All @@ -67,7 +67,7 @@
<% } %>

<!-- Highest Bid -->
<% if (calculated.misc.auctions.highest_bid !== undefined) { %>
<% if (calculated.misc.auctions.highest_bid !== undefined) { %>
<span class="stat-name">Highest Bid: </span>
<span class="stat-value"><%= calculated.misc.auctions.highest_bid.toLocaleString() %></span>
<br>
Expand All @@ -94,7 +94,7 @@
if (rarity === "total") {
continue;
}

tooltip += `
<span class="stat-name piece-${rarity.toLowerCase()}-fg">${helper.capitalizeFirstLetter(rarity)}: </span>
<span class="stat-value">${amount.toLocaleString()}</span>
Expand Down
Loading
Loading