From 03b5d5547e7b42032080e0a7464378dec3958fc2 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 12 Aug 2018 05:45:03 +0000 Subject: [PATCH] Hide corner username until hovered --- webapp/titanembeds/static/css/embed.css | 9 ++++++--- webapp/titanembeds/static/js/embed.js | 3 +-- webapp/titanembeds/templates/embed.html.j2 | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/webapp/titanembeds/static/css/embed.css b/webapp/titanembeds/static/css/embed.css index d8b4b12..e574fb7 100644 --- a/webapp/titanembeds/static/css/embed.css +++ b/webapp/titanembeds/static/css/embed.css @@ -357,7 +357,7 @@ textarea.materialize-textarea:focus:not([readonly]) { #currentuserimage_parent { display: inline-block; - vertical-align: middle; + margin-top: 3px; } .currentuserimage { @@ -365,12 +365,15 @@ textarea.materialize-textarea:focus:not([readonly]) { } .currentusername { - display: inline-block; + display: none; position: relative; - top: 7px; left: 5px; } +#nameplate:hover #currentusername { + display: inline-block +} + #curuser_discrim { font-size: 50%; color: #FFFFFF; diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index e399fef..843ada7 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -1483,13 +1483,12 @@ discrim = null; } if (authenticated) { - $("#currentuserimage").show(); $("#currentuserimage").attr("src", avatar); $("#curuser_name").text(username); $("#curuser_discrim").text("#" + discrim); current_username_discrim = "#" + discrim; } else { - $("#currentuserimage").hide(); + $("#currentuserimage").attr("src", global_guest_icon); $("#curuser_name").text(username); $("#curuser_discrim").text("#" + userid); current_username_discrim = "#" + userid; diff --git a/webapp/titanembeds/templates/embed.html.j2 b/webapp/titanembeds/templates/embed.html.j2 index 06c1bd9..ad5180b 100644 --- a/webapp/titanembeds/templates/embed.html.j2 +++ b/webapp/titanembeds/templates/embed.html.j2 @@ -73,7 +73,7 @@