mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-01-11 12:31:12 +01:00
Adjust pity color on weapon banner
This commit is contained in:
parent
8802f50098
commit
5a241551ec
2 changed files with 6 additions and 3 deletions
|
@ -239,7 +239,7 @@
|
|||
<SummaryItem avg={avg[types[0].id]} type={types[0]} />
|
||||
{/if}
|
||||
{#if avg[types[1].id]}
|
||||
<SummaryItem avg={avg[types[1].id]} type={types[1]} />
|
||||
<SummaryItem avg={avg[types[1].id]} type={types[1]} legendaryPity={80} />
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex flex-col space-y-4">
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
export let avg;
|
||||
export let type;
|
||||
export let legendaryPity = 90;
|
||||
export let colorMultiplier = 120;
|
||||
|
||||
let numberFormat = Intl.NumberFormat('en', {
|
||||
maximumFractionDigits: 2,
|
||||
|
@ -13,7 +15,7 @@
|
|||
});
|
||||
|
||||
function calculateColor(percentage) {
|
||||
const hue = percentage * 120;
|
||||
const hue = percentage * colorMultiplier;
|
||||
return `color: hsl(${hue}, 100%, 60%);`;
|
||||
}
|
||||
|
||||
|
@ -85,7 +87,8 @@
|
|||
<div class="flex flex-wrap mt-2 overflow-y-auto" style="max-height: 500px;">
|
||||
{#each avg.legendary.pulls as pull}
|
||||
<span class="pity {textSize}"
|
||||
>{$t(pull.name)} <span style={calculateColor((90 - pull.pity) / 90)}>{pull.pity}</span></span
|
||||
>{$t(pull.name)}
|
||||
<span style={calculateColor((legendaryPity - pull.pity) / legendaryPity)}>{pull.pity}</span></span
|
||||
>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue