From f3e17078769e9c853f0e7715844af97ea076ce22 Mon Sep 17 00:00:00 2001 From: mxgic1337 <60188749+mxgic1337@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:30:30 +0100 Subject: [PATCH] feat: changed position of the rating in search results --- package.json | 2 +- src/search_page.ts | 4 ++-- src/styles/steam.less | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 20cbb33..cd28682 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/search_page.ts b/src/search_page.ts index 85c47d7..2b32e31 100644 --- a/src/search_page.ts +++ b/src/search_page.ts @@ -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'])) }) } } \ No newline at end of file diff --git a/src/styles/steam.less b/src/styles/steam.less index 22d882e..3cfe2e9 100644 --- a/src/styles/steam.less +++ b/src/styles/steam.less @@ -37,9 +37,10 @@ background-color: fade(@color, 20%) !important; &.search { + position: relative; + top: -5px; padding: 0 6px; border-radius: 4px; - margin-left: 6px; } } }