Skip to content

Commit

Permalink
Use full body skin render for the avatar image.
Browse files Browse the repository at this point in the history
There's room for improvement here, but it works for now.
  • Loading branch information
dscalzi committed Jul 2, 2018
1 parent 651c2d6 commit 3131002
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
9 changes: 7 additions & 2 deletions app/assets/js/scripts/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3131002

Please sign in to comment.