From 2f4d5fcab23c97e50a57ab67b4c9d761d4a97f00 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 24 Apr 2022 23:55:36 -0700 Subject: [PATCH] scale favorites list with pixel ratio --- resources/js/index.js | 6 +++--- resources/style/index.css | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 898d5d4..999614e 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -230,11 +230,11 @@ async function handleFavoriteList() { const transform = window.getComputedStyle(document.querySelector('#ipList')).transform const xy = [ transform.split(',')[4], transform.split(',')[5] ] - let newY = parseInt(xy[1].replace(')', '')) - (27 * ipArr.length) + let newY = (27 * ipArr.length) * window.devicePixelRatio - if (ipArr.length === 0) newY -= 27 + if (ipArr.length === 0 || ipArr.length === 1) newY = 0 - ipList.style.transform = `translate(${xy[0]}px, ${newY}px)` + ipList.style.transform = `translate(${xy[0]}px, calc(56vh - ${newY}px)` } } diff --git a/resources/style/index.css b/resources/style/index.css index a3b2ec6..0e7ba46 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -52,6 +52,7 @@ body { #settingsPanel { width: 35%; height: 80%; + overflow: hidden; } #fullSettingsTitle { @@ -336,7 +337,7 @@ body { } #firstPanel { - background-position: -250px; + background-position: -200px; } /* Move the first official button to the position on the png */