From 3131002d02c0cb987ce53600df1c6d3f51d39ea4 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Mon, 2 Jul 2018 02:01:28 -0400 Subject: [PATCH] Use full body skin render for the avatar image. There's room for improvement here, but it works for now. --- app/assets/css/launcher.css | 4 +++- app/assets/js/scripts/landing.js | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/assets/css/launcher.css b/app/assets/css/launcher.css index f657ecb..1d00243 100644 --- a/app/assets/css/launcher.css +++ b/app/assets/css/launcher.css @@ -2305,7 +2305,9 @@ input:checked + .toggleSwitchSlider:before { box-shadow: 0px 0px 10px 0px rgb(0, 0, 0); overflow: hidden; position: relative; - background-image: url('https://cdn.discordapp.com/avatars/169197209630277642/6650b5a50e1cb3d00a79b9b88b9a0cd4.png'); + /*background-image: url('https://cdn.discordapp.com/avatars/169197209630277642/6650b5a50e1cb3d00a79b9b88b9a0cd4.png');*/ + background-position: center; + background-repeat: no-repeat; background-size: contain; } diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 524d470..9c14cbe 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -121,8 +121,13 @@ document.getElementById('avatarOverlay').onclick = (e) => { // Bind selected account function updateSelectedAccount(authUser){ let username = 'No Account Selected' - if(authUser != null && authUser.username != null){ - username = authUser.displayName + if(authUser != null){ + if(authUser.displayName != null){ + username = authUser.displayName + } + if(authUser.uuid != null){ + document.getElementById('avatarContainer').style.backgroundImage = `url('https://crafatar.com/renders/body/${authUser.uuid}')` + } } user_text.innerHTML = username }