Skip to content

Commit

Permalink
feat: changed position of the rating in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
mxgic1337 committed Jan 9, 2025
1 parent bac8d78 commit f3e1707
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protonfox",
"version": "0.3.1",
"version": "0.4.0",
"description": "Extension that displays information about game compatibility with Proton on Steam.",
"type": "module",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/search_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ function checkSearchResults() {
const games = document.getElementsByClassName('search_result_row')
for (const game of games) {
if (game.getElementsByClassName('tag').length > 0) { continue; }
const name = game.getElementsByClassName('title')[0]
const name = game.getElementsByClassName('platform_img')[0].parentElement || game.getElementsByClassName('title')[0]
const gameId = getGameID(game.getAttribute('href') || "10");
getProtonDBRating(gameId).then(async (rating) => {
if (game.getElementsByClassName('tag').length > 0) { return; }
name.appendChild(createSpan(upperCase(rating), ['tag', rating, 'search']))
name.prepend(createSpan(upperCase(rating), ['tag', rating, 'search']))
})
}
}
3 changes: 2 additions & 1 deletion src/styles/steam.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
background-color: fade(@color, 20%) !important;

&.search {
position: relative;
top: -5px;
padding: 0 6px;
border-radius: 4px;
margin-left: 6px;
}
}
}
Expand Down

0 comments on commit f3e1707

Please sign in to comment.