Skip to content

Commit

Permalink
sum small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tposejank committed Aug 31, 2024
1 parent 5500a12 commit 3299265
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
26 changes: 12 additions & 14 deletions account/change/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@
}

function resetAccounts() {
// BUT
let lang = localStorage.requestLanguage

localStorage.clear()

localStorage.requestLanguage = lang

localStorage.accountId = null
localStorage.accountName = null
localStorage.accounts = null
window.location.reload()

// MIGRATION NEEDED HERE!
Expand All @@ -82,7 +78,7 @@
function loadSwitcher() {
let modal = document.getElementById('account-change-modal')

if (localStorage.accounts === undefined || localStorage.accounts.length === 0) {
if (localStorage.accounts === undefined || (localStorage.accounts === 'null' || localStorage.accounts === null) || localStorage.accounts.length === 0) {
modal.innerHTML = `<h2 class="header-text-bold" tkey="account_change:link_new">Link your account</h2><div class="flex flex-wrap player-data">
<input type="text" placeholder="User Name" class="fortnite-button-border" id="player-name" title="Account Name">
<button id="discover" onclick="lookupPlayer()" class="fortnite-button-border" tkey="account_change:search">Search</button>
Expand Down Expand Up @@ -137,12 +133,14 @@
</script>

<script>
for (let paragraph of document.getElementById('accounts').children) {
paragraph.onclick = function() {
changeAccount({
accountId: paragraph.getAttribute('accountid'),
accountName: paragraph.getAttribute('accountname')
})
if (document.getElementById('accounts') != null) {
for (let paragraph of document.getElementById('accounts').children) {
paragraph.onclick = function() {
changeAccount({
accountId: paragraph.getAttribute('accountid'),
accountName: paragraph.getAttribute('accountname')
})
}
}
}
</script>
Expand Down
9 changes: 5 additions & 4 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ select {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(13rem, 2fr));
grid-auto-rows: 5rem;
grid-gap: 2px;
grid-gap: 5px;
}

.stat-item {
Expand All @@ -1998,19 +1998,20 @@ select {
justify-content: center;
color: white;
background-color: rgb(16, 16, 16);
transition: background-color .25s, scale .25s;
transition: all .25s;
border-radius: 15px;
}

.stat-item:hover {
background-color: rgb(27, 26, 26);
scale: 1.05;
cursor: default;
z-index: 100;
}

.stat-item-title {
font-size: 18px;
text-transform: uppercase;
font-family: burbank-bold;
font-family: headings-squash;
}

.stat-item-content {
Expand Down
2 changes: 1 addition & 1 deletion stats/js/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function searchPlayer(ID) {
//console.log(value, label)

let containera = document.createElement('div');
containera.classList.add('stat-item');
containera.classList.add('stat-item', 'fortnite-button-border');

let code = document.createElement('p');
code.innerHTML = label;
Expand Down

0 comments on commit 3299265

Please sign in to comment.