Skip to content

Commit

Permalink
Authenticated Avatar in row
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumi3011 committed Feb 15, 2021
1 parent 05c2449 commit 661f4b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
16 changes: 0 additions & 16 deletions src/main/resources/public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,3 @@ body {
margin-bottom: 15px;
}

@media (max-width:474px){
nav{
flex-direction:column;
}
}
@media (max-width:320px){
#logins{
text-align: center;
}
.unauthenticated a:nth-child(1){
margin-bottom:5px;
}
.unauthenticated a:nth-child(2){
width:52%;
}
}
14 changes: 13 additions & 1 deletion src/main/resources/templates/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@
$(document).ready(
function () {
$("#loginLoading").show();
$(".unauthenticated .btn").hide();
$(".unauthenticated .btn").hide ();
$.ajax("/api/users/self", {
type: "GET",
complete: function(response){
const mediaQuery1 = window.matchMedia('(max-width:474px)');
const mediaQuery2 = window.matchMedia('(max-width:320px)');
switch(response.status){
case 200:
var data = response.responseJSON;
Expand All @@ -96,6 +98,16 @@
$("#loginLoading").hide();
$(".unauthenticated").show();
$(".unauthenticated .btn").show();
if(mediaQuery1.matches){
$('nav').css('flex-direction','column');
}
if(mediaQuery2.matches){
$('#logins').css('text-align','center');
$('.unauthenticated > a:nth-child(1)')
.css('margin-bottom','5px');
$('.unauthenticated > a:nth-child(2)')
.css('width','56%');
}
}
}
});
Expand Down

0 comments on commit 661f4b6

Please sign in to comment.