Revised some UI elements

This commit is contained in:
W13R 2022-05-14 11:28:32 +02:00
parent fc2bf922d2
commit 9406bbad97
6 changed files with 51 additions and 72 deletions

View file

@ -22,9 +22,7 @@
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="userPanel">
{% include "userPanel.html" %} {% include "userPanel.html" %}
</div>
{% endif %} {% endif %}

View file

@ -1,31 +1,36 @@
{% load i18n %} {% load i18n %}
<div class="dropDownMenu" id="dropDownMenu"> <div class="userPanel">
<button class="dropDownButton" id="dropDownMenuButton"> <div class="userInfo">
<div> {% if user.first_name != "" %}
{% if user.first_name != "" %} {% translate "User" %}: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})
{% translate "User" %}: {{ user.first_name }} {{ user.last_name }} ({{ user.username }})
{% else %}
{% translate "User" %}: {{ user.username }}
{% endif %}
&nbsp;-&nbsp;
{% if user.balance < 0.01 %}
<span class="userBalanceWarn">{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
{% else %}
<span>{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
{% endif %}
</div>
</button>
<div class="dropDownList">
<a class="button dropDownChoice" id="navBarBtnHome" href="/">Home</a>
<a class="button dropDownChoice" id="navBarBtnHistory" href="/history">{% translate "History" %}</a>
<a class="button dropDownChoice" id="navBarBtnStatistics" href="/statistics">{% translate "Statistics" %}</a>
<a class="button dropDownChoice" id="navBarBtnDeposit" href="/deposit">{% translate "Deposit" %}</a>
{% if user.is_superuser %}
<a class="button dropDownChoice" href="/admin/">Admin Panel</a>
{% else %} {% else %}
<a class="button dropDownChoice" href="/accounts/password_change/">{% translate "Change Password" %}</a> {% translate "User" %}: {{ user.username }}
{% endif %} {% endif %}
<a class="button dropDownChoice" href="/accounts/logout">{% translate "Logout" %}</a> &nbsp;-&nbsp;
{% if user.balance < 0.01 %}
<span class="userBalanceWarn">{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
{% else %}
<span>{% translate "Balance" %}: {{ user.balance }}{{ currency_suffix }}</span>
{% endif %}
</div>
<div class="horizontalButtonList">
<a class="button" id="navBarBtnHome" href="/">Home</a>
<a class="button" id="navBarBtnDeposit" href="/deposit">{% translate "Deposit" %}</a>
<div class="dropDownMenu" id="dropDownMenu">
<button class="dropDownButton" id="dropDownMenuButton">
<div>{% translate "Account" %}</div>
</button>
<div class="dropDownList">
<a class="button dropDownChoice" id="navBarBtnHistory" href="/history">{% translate "History" %}</a>
<a class="button dropDownChoice" id="navBarBtnStatistics" href="/statistics">{% translate "Statistics" %}</a>
{% if user.is_superuser %}
<a class="button dropDownChoice" href="/admin/">Admin Panel</a>
{% else %}
<a class="button dropDownChoice" href="/accounts/password_change/">{% translate "Change Password" %}</a>
{% endif %}
<a class="button dropDownChoice" href="/accounts/logout">{% translate "Logout" %}</a>
</div>
</div>
</div> </div>
</div> </div>

View file

@ -1,11 +1,3 @@
#depositAmount { #depositAmount {
width: 10rem; width: 10rem;
}
main {
margin-top: 0;
}
@media only screen and (max-width: 700px) {
main {
margin-top: -15vh;
}
} }

View file

@ -54,7 +54,6 @@ main > h1 {
flex-direction: column; flex-direction: column;
justify-content: start; justify-content: start;
align-items: center; align-items: center;
margin-top: 10vh;
} }
.passwordOverlay > form { .passwordOverlay > form {
min-width: unset; min-width: unset;

View file

@ -58,20 +58,23 @@ main {
align-items: center; align-items: center;
flex-grow: 1; flex-grow: 1;
width: 100%; width: 100%;
margin-top: calc(-14rem + 2vh); margin-top: 2rem;
} }
.userPanel { .userPanel {
width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: flex-start; align-items: center;
min-width: fit-content;
margin-top: 1rem; margin-top: 1rem;
pointer-events: none; font-size: 1rem;
width: 90%;
} }
.userPanel > div { .userInfo span {
margin: 0 1rem; font-size: 1.1rem;
}
.userPanel > .horizontalButtonList {
margin-left: auto;
margin-right: 0;
} }
.userBalanceWarn { .userBalanceWarn {
color: var(--color-error); color: var(--color-error);
@ -118,25 +121,19 @@ main > h1 {
box-shadow: none; box-shadow: none;
text-align: center; text-align: center;
justify-content: center; justify-content: center;
pointer-events: all;
} }
.dropDownButton, .dropDownChoice { .dropDownButton, .dropDownChoice {
font-size: 1rem; font-size: 1rem;
} }
.dropDownButton > div::after {
content: '\25BC';
display: inline-block;
transition: transform 100ms;
padding: 0 .3rem;
}
.dropDownList { .dropDownList {
position: absolute;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
pointer-events: none; pointer-events: none;
border-radius: var(--glass-corner-radius) !important; border-radius: var(--glass-corner-radius) !important;
backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
z-index: 200; z-index: 200;
margin-top: .5rem; margin-top: 3.2rem;
opacity: 0%; opacity: 0%;
transition: opacity 100ms; transition: opacity 100ms;
} }
@ -166,12 +163,6 @@ main > h1 {
visibility: visible; visibility: visible;
pointer-events: visible; pointer-events: visible;
} }
.dropDownVisible > .dropDownButton > div::after {
transform: rotate(180deg);
}
.userPanel .dropDownButton, .userPanel .dropDownChoice {
font-size: 1.1rem;
}
/* FOOTER */ /* FOOTER */
.footer { .footer {
z-index: 990; z-index: 990;
@ -215,8 +206,8 @@ tr:nth-child(2n+2) {
} }
/* /*
Rounded corners on table cells apparently don't work with Rounded corners on table cells apparently don't work with
Firefox (91), so Firefox users won't have rounded corners Firefox, so Firefox users won't have rounded corners
on tables. Won't fix that by myself. on tables. Can't fix that by myself.
*/ */
table tr:first-child th:first-child { table tr:first-child th:first-child {
border-top-left-radius: var(--glass-corner-radius); border-top-left-radius: var(--glass-corner-radius);
@ -285,7 +276,6 @@ form .button, form button {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: var(--font-family); font-family: var(--font-family);
font-size: .9rem;
text-decoration: none; text-decoration: none;
text-align: center !important; text-align: center !important;
background: var(--glass-bg); background: var(--glass-bg);
@ -341,7 +331,9 @@ input[type="text"], input[type="password"], input[type="number"] {
flex-direction: row; flex-direction: row;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
width: 100%; }
.horizontalButtonList > .button, .horizontalButtonList > button, .horizontalButtonList > div {
margin: 0 .5rem;
} }
.errorText { .errorText {
margin-top: 1rem; margin-top: 1rem;
@ -365,8 +357,9 @@ h1 {
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.userPanel > div { .userPanel > .horizontalButtonList {
margin: 0; margin-right: 0;
margin-bottom: .5rem; margin-left: 0;
margin-top: .5rem;
} }
} }

View file

@ -1,11 +1,3 @@
main {
margin-top: 0;
}
form { form {
width: 22rem; width: 22rem;
}
@media only screen and (max-width: 700px) {
main {
margin-top: -15vh;
}
} }