From c3c53908305aa310c9db5aaf062904f9ab9e4877 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Sun, 23 Oct 2022 01:31:17 +0200 Subject: [PATCH] fix user images, many thanks to Wopiie! --- assets/launcher.css | 12 +++++------- preload/preload.js | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/assets/launcher.css b/assets/launcher.css index e7ba5fa..6a30c11 100644 --- a/assets/launcher.css +++ b/assets/launcher.css @@ -122,13 +122,11 @@ border: 5px solid white; border-radius: 0.4rem; box-shadow: 0 0 10px rgba(0, 0, 0, 0.349); -} - -#user-img { - border-radius: .2rem; - width: 80px; - /* somehow its misplaced without that */ - transform: translate(-0.25px, 0.25px) scale(1.05); + background-image: url(https://a.ez-pp.farm/0); + width: 100px; + height: 100px; + background-size: cover; + background-position: center; } .form-outline .form-control:focus~.form-notch .form-notch-leading { diff --git a/preload/preload.js b/preload/preload.js index dfb2495..bd42cd1 100644 --- a/preload/preload.js +++ b/preload/preload.js @@ -25,7 +25,7 @@ window.addEventListener('DOMContentLoaded', () => { } else { $('#welcome-text').text(`Nice to see you!`); $('#account-action').text('Click to login'); - $('#user-img').prop('src', `https://a.ez-pp.farm/0`) + $('.user-image').css('background-image', `url(https://a.ez-pp.farm/0)`) loggedIn = false; ipcRenderer.send("perform-logout"); Swal.fire({ @@ -95,7 +95,7 @@ window.addEventListener('DOMContentLoaded', () => { $('#login-password').val(""); $('#welcome-text').text(`Welcome back, ${responseData.user.name}!`); $('#account-action').text('Not you?'); - $('#user-img').prop('src', `https://a.ez-pp.farm/${responseData.user.id}`); + $('.user-image').css('background-image', `url(https://a.ez-pp.farm/${responseData.user.id})`); loggedIn = true; changePage('launch'); }) @@ -138,7 +138,7 @@ window.addEventListener('DOMContentLoaded', () => { changePage("launch"); $('#welcome-text').text(`Welcome back, ${data.user.name}!`); $('#account-action').text('Not you?'); - $('#user-img').prop('src', `https://a.ez-pp.farm/${data.user.id}`) + $('.user-image').css('background-image', `url(https://a.ez-pp.farm/${data.user.id})`); loggedIn = true; break; }