minor: improved "no participation" great divide stats card
This commit is contained in:
parent
d86f928b6f
commit
14d9faa484
2 changed files with 10 additions and 4 deletions
|
|
@ -134,7 +134,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
|||
})
|
||||
})
|
||||
|
||||
const LoadStats = function(stats){
|
||||
const LoadStats = function(stats){
|
||||
const GreatDivideCard = document.getElementById('p+greatdivide_card')
|
||||
if (stats !== null) {
|
||||
let KDR = (stats.Kills / stats.Deaths)
|
||||
if (isNaN(KDR)) {
|
||||
|
|
@ -143,7 +144,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
|||
KDR = KDR.toFixed(4)
|
||||
}
|
||||
|
||||
document.getElementById('p+greatdivide_card').innerHTML = `
|
||||
GreatDivideCard.innerHTML = `
|
||||
<div class="mb-1">
|
||||
<b>
|
||||
<i class="fa-duotone fa-eye text-center d-inline-block" style="width:1.2em"></i>
|
||||
|
|
@ -255,7 +256,12 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
|||
});
|
||||
document.body.appendChild(Script);
|
||||
} else {
|
||||
document.getElementById('p+greatdivide_card').innerText = "This user hasn't participated in The Great Divide."
|
||||
GreatDivideCard.classList.add('text-center', 'py-5')
|
||||
GreatDivideCard.innerHTML = `
|
||||
<h1 class="display-3"><i class="fa-solid fa-face-thinking"></i></h1>
|
||||
<h5> Not Drafted </h5>
|
||||
<p class="mb-0">This user hasn't participated in The Great Divide.</p>
|
||||
`
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ const PlaceAllowlist = [
|
|||
GREATEST DIVISION
|
||||
<i class="fas fa-swords me-1 float-end"></i>
|
||||
</h6>
|
||||
<div class="card mcard mb-4" style="min-height: 226px; background-image: linear-gradient(rgba(0.7, 0.7, 0.7, 0.7), rgba(0.7, 0.7, 0.7, 0.7)), url(${ (HasTeam === true) ? (Team === "phantoms") ? 'https://c0.ptacdn.com/assets/N3DH4x5a6iW7raaQ-3lwHpRHHpWShdXc.png' : 'https://c0.ptacdn.com/assets/1HXpaoDLHJo2rrvwwxqJEDWvDZ6BgvSE.png' : '' }); background-size: cover; background-position: center; ${HasTeam === true ? 'border: 1.25px solid ' + ((Team === "phantoms") ? 'blue' : 'green') + ' !important;' : ''}">
|
||||
<div class="card mcard mb-4" style="min-height: 226px; background-image: linear-gradient(rgba(0.7, 0.7, 0.7, 0.7), rgba(0.7, 0.7, 0.7, 0.7)), url(${ (HasTeam === true) ? (Team === "phantoms") ? 'https://c0.ptacdn.com/assets/N3DH4x5a6iW7raaQ-3lwHpRHHpWShdXc.png' : 'https://c0.ptacdn.com/assets/1HXpaoDLHJo2rrvwwxqJEDWvDZ6BgvSE.png' : 'https://blog.polytoria.com/content/images/2024/06/TheGreatDivide.png' }); background-size: cover; background-position: center; ${HasTeam === true ? 'border: 1.25px solid ' + ((Team === "phantoms") ? 'blue' : 'green') + ' !important;' : 'border-color: #000 !important;'}">
|
||||
<div class="card-body" id="p+greatdivide_card">
|
||||
<button class="btn btn-primary btn-sm w-100">Load Statistics</button>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue