Skip to content

Commit

Permalink
fix the shop again and the stats
Browse files Browse the repository at this point in the history
I FORGOT TO PUSH
  • Loading branch information
tposejank committed Aug 31, 2024
1 parent e9bd587 commit d669364
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 54 deletions.
6 changes: 3 additions & 3 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
}

:root {
--season-accent-1: #6dc2ff;
--season-accent-2: #fff;
--season-accent-1: #69a452;
--season-accent-2: rgb(0, 49, 0);
--crew-pack-position: 0;
--theme-color: #101014;
--border-color: #1b1b20;
Expand Down Expand Up @@ -653,7 +653,7 @@ select {
left: 0;
top: 0;

color: black;
color: white;
font-family: headings-squash;
}

Expand Down
16 changes: 4 additions & 12 deletions festival/view/js/song.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,14 @@ function loadViewer() {
for (let page of _pages) {
let _users = {}
try {
let response = await fetch('https://raw.githubusercontent.com/FNLookup/festival/main/leaderboards/season4/' + viewTrack.id + '/' + instrumentStr + '_' + page + '_Users.json')
_users = await response.json()

response = await fetch('https://raw.githubusercontent.com/FNLookup/festival/main/leaderboards/season4/' + viewTrack.id + '/' + instrumentStr + '_' + page + '.json')
response = await fetch('https://raw.githubusercontent.com/FNLookup/festival-leaderboards/main/leaderboards/season5/' + viewTrack.id + '/' + instrumentStr + '_' + page + '.json')
let data = await response.json()

for (let entry of data.entries) {
//console.log(entry)

let entryContainer = gne('div')
entryContainer.classList.add('festival-leaderboard-entry-parent')
entryContainer.classList.add('festival-leaderboard-entry-parent', 'fortnite-button-border')

let entryFirstInfo = gne('div')
entryFirstInfo.classList.add('flex', 'festival-leaderboard-entry')
Expand All @@ -161,12 +158,7 @@ function loadViewer() {

let name = gne('a')
name.classList.add('festival-entry-name')
if (Object.keys(_users).includes(entry.teamId)) {
//console.log('Yes')
name.innerHTML += _users[entry.teamId].displayName
} else {
name.innerText = entry.teamId
}
name.innerText = entry.userName

let score = gne('a')
score.classList.add('festival-entry-score')
Expand Down Expand Up @@ -284,7 +276,7 @@ function loadViewer() {
generateItems(allEntries.slice(0, perPage))
}

fetch('https://api.github.com/repos/FNLookup/festival/commits?path=leaderboards/season4/' + viewTrack.id + '/').then(r=>r.json()).then(r=> {
fetch('https://api.github.com/repos/FNLookup/festival-leaderboards/commits?path=leaderboards/season5/' + viewTrack.id + '/').then(r=>r.json()).then(r=> {
if (r.length > 0) fetchLeaderboardData(_instruments[0])
else {
leaderBoardEntries.innerHTML = '<h2>Leaderboard not available</h2>'
Expand Down
18 changes: 15 additions & 3 deletions items/shop/js/item-shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ function createItems() {
"height": 0
};

if (section_name === null) {
section_name = 'Unknown_Category_Section_THIS IS USED AS FALLBACK'
}

if (category === null) {
category = section_name;
}
Expand Down Expand Up @@ -202,6 +206,7 @@ function createItems() {
//console.log(categories_final)

let shopContainer = document.getElementById('main')
let theJamTracksHaveBeenSkipped = false;

let labelRight = document.getElementById('label-right')
labelRight.onclick = () => {
Expand All @@ -214,6 +219,7 @@ function createItems() {
let classContainer = gne('div')
classContainer.classList.add('filter-class-container')

// console.log(category)
classContainer.innerHTML += '<h2 class="filter-class-name" style="text-align: right;">' + category.name.toUpperCase() + '</h2>'

let groupContainer = gne('div')
Expand All @@ -232,7 +238,13 @@ function createItems() {
let sectionHeight = 425;

//console.log(section.id)
if (section.id == 'JamTracks0819.97') continue;
if (section.id.includes('JamTracks')) {
if (!theJamTracksHaveBeenSkipped) {
shopContainer.innerHTML += '<br><a href="/festival/" class="fortnite-button fortnite-button-border">Go to Jam Tracks</a>'
theJamTracksHaveBeenSkipped = true;
}
continue;
}

shopContainer.innerHTML += `<div class="shop-section-section-container" style="display: flex; flex-direction: column; align-content: flex-start; flex-wrap: wrap; height: ${sectionHeight}px;" id="Section_${section.id}" count="${section.count}"></div>`
}
Expand Down Expand Up @@ -343,7 +355,7 @@ function makeShopCard(item) {
// section_c = document.getElementsByName(section_name)[0];
// }

if (item.section.id == 'JamTracks0819.97') return;
if (item.section.id.includes('JamTracks')) return;

let section_c = document.getElementById('Section_' + item.section.id)

Expand Down Expand Up @@ -495,7 +507,7 @@ function makeShopCard(item) {

if (displayAsset.renderData.OffsetImage_Y != undefined) {
img_obj.classList.add('override-styles');
console.log(displayAsset.renderData.OffsetImage_Y + '' + item.displayName);
// console.log(displayAsset.renderData.OffsetImage_Y + '' + item.displayName);
img_obj.style.setProperty('--y-off', displayAsset.renderData.OffsetImage_Y + 'px');
}
}
Expand Down
7 changes: 1 addition & 6 deletions statistics/index.html → stats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
<link rel="stylesheet" href="/css/style.css">
<script src="/js/backend.js" type="text/javascript"></script>
<script src="/js/script.js" type="text/javascript"></script>
<script type="text/javascript" src="js/playerstats.js"></script>
<script type="text/javascript" src="js/stats.js"></script>
</head>

<body>
<div class="season-video">
<video autoplay loop playsinline class="fn-season-video" id="fn-video"></video>
<div class="fn-dot-mask"></div>
</div>

<div class="nav-container">
</div>

Expand Down
76 changes: 46 additions & 30 deletions statistics/js/playerstats.js → stats/js/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ function searchPlayer(ID) {

let requestData = getRequestData('stats&account=' + uID);
fetch(requestData.url, requestData.data).then(res => res.json()).then(res => {
content.innerHTML += '<h1 class="header-text-bold">Battle Pass</h1><hr> <div class="progress-bar-bg"><div class="progress-bar" style="width: ' + res.account.process_pct + '%;"><a class="percentage">Level ' + res.account.level + '</a></div></div>';
thestatsfrfr = document.createElement('div')

content.innerHTML += '<h1 class="header-text-bold">Account Stats</h1><hr>'
thestatsfrfr.innerHTML += '<h1 class="header-text-bold">Battle Pass</h1><hr> <div class="progress-bar-bg"><div class="progress-bar" style="width: ' + res.account.process_pct + '%;"><a class="percentage">Level ' + res.account.level + '</a></div></div>';

thestatsfrfr.innerHTML += '<h1 class="header-text-bold">Account Stats</h1><hr>'

let statCategories = [
{ name: 'Global Stats', stats: res.global_stats },
(res.per_input.keyboardmouse ? { name: 'Keyboard & Mouse Stats', stats: res.per_input.keyboardmouse } : undefined),
(res.per_input.gamepad ? { name: 'Gamepad', stats: res.per_input.gamepad } : undefined),
(res.per_input.touch ? { name: 'Touch', stats: res.per_input.touch } : undefined)
{ name: 'Keyboard & Mouse Stats', stats: res.per_input.keyboardmouse },
{ name: 'Gamepad', stats: res.per_input.gamepad },
{ name: 'Touch', stats: res.per_input.touch }
]

for (let category of statCategories) {
Expand All @@ -28,24 +30,22 @@ function searchPlayer(ID) {
let globalTitle = gne('h2');
globalTitle.innerHTML = category.name;
globalTitle.classList.add('header-text-bold');
let globalBoxContent = gne('div')
globalBoxContent.classList.add('stats-content');

globalBox.append(globalTitle, globalBoxContent)
globalBox.append(globalTitle)

content.appendChild(globalBox)
thestatsfrfr.appendChild(globalBox)

for (let thing of things) {
let thingsSequelThings = category.stats[thing]
let thingsSequel = Object.getOwnPropertyNames(thingsSequelThings)

let box = gne('div')
let box = document.createElement('div')

let title = document.createElement('h3');
title.innerHTML = getLabel(thing);
title.classList.add('links');
title.classList.add('pointer');
title.classList.add('header-text-bold')
let stattitle = document.createElement('h3');
stattitle.innerHTML = getLabel(thing);
stattitle.classList.add('links');
stattitle.classList.add('pointer');
stattitle.classList.add('header-text-bold')

let sa = document.createElement('i');
sa.classList.add('arrow');
Expand All @@ -55,21 +55,16 @@ function searchPlayer(ID) {
tab_contents.classList.add('stats-content', 'stats-items');
tab_contents.classList.add('hidden');

title.appendChild(sa);

//console.log(title);

box.append(title, tab_contents)
globalBoxContent.append(box)
stattitle.appendChild(sa);

let FUCK = function() {
globalBox.append(box)
stattitle.onclick = function() {
sa.classList.toggle('sideways');
tab_contents.classList.toggle('hidden');
console.log('a')
}
//FUCK();
};

title.onclick = FUCK;
box.appendChild(stattitle)
box.appendChild(tab_contents)

for (let thingy of thingsSequel) {
let value = thingsSequelThings[thingy];
Expand Down Expand Up @@ -100,18 +95,39 @@ function searchPlayer(ID) {
}
}

if (globalBoxContent.children.length == 0) {
globalBoxContent.innerHTML = '<img src="' + marioDancing + '"><p>There\'s nothing to see here. Maybe invite this player to join the game?</p>';
if (globalBox.children.length == 0) {
globalBox.innerHTML = '<img src="' + marioDancing + '"><p>There\'s nothing to see here. Maybe invite this player to join the game?</p>';
}
}

content.innerHTML += '</h1><h1 class="header-text-bold">Level History</h1><hr>'
content.append(thestatsfrfr)

let levelHistoryBullshit = ''
let cardContainerHTML = ''
for (let levelHistory of res.accountLevelHistory) {
cardContainerHTML += '<div class="account-season-level-card"><img src="/assets/images/seasons/' + levelHistory.season + '.jpg" alt="Season ' + levelHistory.season + '"><div class="account-level-card-details"><h3>Season ' + levelHistory.season + '</h3><div class="progress-bar-bg"><div class="progress-bar" style="width: ' + levelHistory.process_pct + '%;"><a class="percentage">Level ' + levelHistory.level + '</a></div></div></div></div>'
}

content.innerHTML += '<div id="level-history" class="account-level-history">' + cardContainerHTML + '</div>'
levelHistoryBullshit += '<div id="level-history" class="account-level-history">' + cardContainerHTML + '</div>'

let lhtBS = document.createElement('h1')
lhtBS.innerText = 'Level History'
lhtBS.classList.add('header-text-bold')
lhtBS.classList.add('links');
lhtBS.classList.add('pointer');
let thh = document.createElement('i');
thh.classList.add('arrow');
thh.classList.add('sideways');
lhtBS.append(thh);
content.append(lhtBS)
let levelHistoryContainerBS = document.createElement('div')
levelHistoryContainerBS.innerHTML = levelHistoryBullshit
levelHistoryContainerBS.classList.add('hidden')
content.append(levelHistoryContainerBS)
lhtBS.onclick = function() {
thh.classList.toggle('sideways');
levelHistoryContainerBS.classList.toggle('hidden');
};
}).catch(error => {
let eText = document.createElement('h1');
console.error(error);
Expand Down

0 comments on commit d669364

Please sign in to comment.