From 0e3a3b3ecdd9dc2871ddaa4ee0c3fea2b1a67407 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Fri, 30 Jun 2023 23:17:03 +1000 Subject: [PATCH] fix: removed duplicate companies --- gaseous-server/wwwroot/pages/game.html | 30 ++++++++++++++++--------- gaseous-server/wwwroot/styles/style.css | 4 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/gaseous-server/wwwroot/pages/game.html b/gaseous-server/wwwroot/pages/game.html index 6682078..211a88e 100644 --- a/gaseous-server/wwwroot/pages/game.html +++ b/gaseous-server/wwwroot/pages/game.html @@ -128,24 +128,34 @@ var gamePublisherLoaded = false; if (result.involvedCompanies) { ajaxCall('/api/v1/games/' + gameId + '/companies', 'GET', function (result) { + var lstDevelopers = []; + var lstPublishers = []; + for (var i = 0; i < result.length; i++) { var companyLabel = document.createElement('span'); companyLabel.className = 'gamegenrelabel'; companyLabel.innerHTML = result[i].company.name; if (result[i].involvement.developer == true) { - if (gameHeaderDeveloperLabel.innerHTML.length > 0) { - gameHeaderDeveloperLabel += ", "; + if (!lstDevelopers.includes(result[i].company.name)) { + if (gameHeaderDeveloperLabel.innerHTML.length > 0) { + gameHeaderDeveloperLabel += ", "; + } + gameHeaderDeveloperLabel.innerHTML += result[i].company.name; + + gameDeveloperLabel.appendChild(companyLabel); + + lstDevelopers.push(result[i].company.name); + + gameDeveloperLoaded = true; } - gameHeaderDeveloperLabel.innerHTML += result[i].company.name; - - gameDeveloperLabel.appendChild(companyLabel); - - gameDeveloperLoaded = true; } else { if (result[i].involvement.publisher == true) { - gamePublisherLabel.appendChild(companyLabel); - gamePublisherLoaded = true; + if (!lstPublishers.includes(result[i].company.name)) { + lstPublishers.push(result[i].company.name); + gamePublisherLabel.appendChild(companyLabel); + gamePublisherLoaded = true; + } } } } @@ -346,7 +356,7 @@ for (var i = 0; i < gameScreenshots_Items.length; i++) { if (gameScreenshots_Items[i].id == gameScreenshots_Selected.id) { gameScreenshots_Items[i].classList.add('gamescreenshosts_gallery_item_selected'); - gameScreenshots_Selected.scrollIntoView(); + gameScreenshots_Selected.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" }); } else { gameScreenshots_Items[i].classList.remove('gamescreenshosts_gallery_item_selected'); } diff --git a/gaseous-server/wwwroot/styles/style.css b/gaseous-server/wwwroot/styles/style.css index ebf6388..85bf0e0 100644 --- a/gaseous-server/wwwroot/styles/style.css +++ b/gaseous-server/wwwroot/styles/style.css @@ -16,7 +16,7 @@ h3 { border-bottom-style: solid; /*border-bottom-color: #916b01;*/ - border-bottom-width: 3px; + border-bottom-width: 1px; /*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/ border-image: linear-gradient(to right, rgba(255,0,0,1) 0%, rgba(251,255,0,1) 16%, rgba(0,255,250,1) 30%, rgba(0,16,255,1) 46%, rgba(250,0,255,1) 62%, rgba(255,0,0,1) 78%, rgba(255,237,0,1) 90%, rgba(20,255,0,1) 100%) 5; @@ -388,7 +388,7 @@ iframe { } .gamescreenshosts_gallery_item:hover { - border-color: lightblue; + border-color: lightgray; } .gamescreenshosts_gallery_item_selected {