[TWIG][CSS] Register and Login styling done.

Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
This commit is contained in:
Eliseu Amaro 2021-07-26 15:30:55 +01:00 committed by Diogo Peralta Cordeiro
parent df44d92bb2
commit 8b4148a00d
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
6 changed files with 123 additions and 120 deletions

View File

@ -19,6 +19,7 @@
--bg1: #383E51;
--bg2: #434A60;
--bg3: #5C6684;
--translucent: #00000033;
--white: #EEDFD4;
--accent-blue: #8E8DBE;
@ -251,7 +252,7 @@ html {
.note-attachments > div {
margin: var(--small-size) 0 0 0;
border-radius: var(--unit-size);
background-color: #00000033;
background-color: var(--translucent);
}
.note-attachments > div figure {

View File

@ -30,6 +30,7 @@
}
.profile-nav nav {
margin-bottom: var(--main-size);
display: flex;
flex-direction: column;
}
@ -60,7 +61,6 @@
/* TIMELINE NAVIGATION / PLUGINS */
.timeline-nav,
.timeline-nav h1 {
margin-top: var(--main-size);
display: flex;
flex-direction: column;
}

View File

@ -1,81 +1,66 @@
.content {
display: flex;
flex-wrap: wrap;
margin-top: calc(4 * var(--main-size));
justify-content: center;
align-items: center;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 1%;
form {
width: 50%;
margin-left: auto;
margin-right: auto;
padding: var(--main-size);
background-image: radial-gradient(ellipse at 10% 10%, var(--bg3), var(--accent-blue)),
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAElBMVEUAAACUkpSEhoSMioyMjoyEgoRr6djFAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAU1JREFUKJEVUcl1xTAIpAVLSgECXIAYUoCAX0Bi919LlCPLm5ValiOUUe2+ZRVFuYpKXFsUX9aIp0V6GtC8VRhNL0X2fikvswhKrNDhes7pbpPkufFAtI0B76LEjfc2bgdHDk6RX4A/sjt6LCylfoYpNYYJx/9COhIugsjluzN9VGZ/Hnl51jIH2ba+Ywsy2RJCFdoDe8Obw61TXGAv+ewExMRJs7gd7YcimPuk42uMqY2VJ1fK+bDL32rb7kwok/la/u7Mrz7Xf0DTssSP2Btp1ZS0zw35tM/SsJKgWNLcRh+/th1QqntwtM3Tx0LNosoBYbM3qjJFiMeLsMH2i5BcQdU3n9sJHOE1Hoqn1GA/bm4s0YkVB/y4r0PbltF32FpljXmdlOOwbDvFWkoDYLppSG4pnM6UxX3Src1lhXeU36FOu3o+R2vNaHME/wESUl9/3zMniwAAAABJRU5ErkJggg==);
background-blend-mode: multiply;
border-radius: var(--unit-size);
}
form {
font-size: var(--medium-size);
background-color: var(--bg2);
padding: calc(2 * var(--unit-size));
border-radius: var(--unit-size);
border: solid 2px var(--accent-low);
fieldset {
display: flex;
flex-direction: column;
font-family: var(--display-font);
font-size: var(--main-size);
}
fieldset legend {
margin-bottom: var(--main-size);
}
br {
margin-bottom: var(--unit-size);
}
label {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
font-family: var(--display-font);
font-size: var(--medium-size);
}
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
background: var(--white) !important;
color: var(--bg1) !important;
transition: all 0.4s ease;
}
input[type="text"],
input[type="password"],
input[type="email"] {
all: unset;
background: var(--translucent);
padding: var(--unit-size) var(--small-size);
box-sizing: border-box;
border-radius: var(--unit-size);
font-size: var(--medium-size);
width: 100%;
}
button {
margin-top: var(--unit-size);
font-family: var(--display-font);
font-size: var(--medium-size);
align-self: flex-end;
padding: var(--unit-size) var(--small-size);
}
input[type=text],
input[type=password],
input[type=email] {
margin-top: calc(var(--unit-size) * 0.5);
background-color: var(--bg1);
color: var(--fg);
border-style: none;
padding: calc(var(--unit-size) * 0.5);
border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--unit-size);
margin-bottom: var(--unit-size);
width: calc(100% - var(--unit-size));
}
.active {
color: var(--fg) !important;
font-weight: 700;
}
input {
filter: none;
}
form input[type="checkbox"] {
position: unset !important;
}
form button[type=submit] {
background: var(--bg1);
padding: 0.3em 1em;
color: var(--fg);
border-style: solid;
border-color: var(--accent);
border-radius: var(--unit-size);
border-width: 2px;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
}
form button[type=submit]:focus,
form button[type=submit]:hover {
border-radius: var(--unit-size);
box-shadow: 0 0 8px var(--accent);
}
#login-notes {
margin: 0;
}
#login-main {
border: 0;
}
fieldset div:last-child {
text-align: end;
}

View File

@ -10,35 +10,47 @@
{% block body %}
<div class='content'>
<form method="post">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<fieldset>
<legend>Login</legend>
{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.username }}, <a
href="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}
<div class="register-info">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<p>
{% if app.user %}
<h1 class="mb-3">
You are logged in as {{ app.user.username }}.
<br>
<button class="btn btn-lg btn-primary">
<a href="{{ path('app_logout') }}">Logout</a>
</button>
</h1>
{% else %}
<label for="inputNickname">Nickname</label>
<br>
<input type="text" value="{{ last_username }}" name="nickname" id="inputNickname"
class="form-control" required autofocus>
<label for="inputPassword">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" required>
</div>
{% endif %}
</p>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<p>
<label for="inputPassword">Password</label>
<br>
<input type="password" name="password" id="inputPassword" class="form-control" required>
</p>
<div class="checkbox mb-3">
<label>
<input type="checkbox" name="_remember_me"> Remember me
</label>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
<p class="checkbox mb-3">
<label>Remember me</label>
<input type="checkbox" name="_remember_me">
</p>
<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
</fieldset>
</form>
</div>
{% endblock body %}

View File

@ -13,9 +13,15 @@
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
{% endfor %}
<div class="register-info">
{{ form(registration_form) }}
</div>
{{ form_start(registration_form) }}
<fieldset>
<legend>Register a new account</legend>
{{ form_row(registration_form.nickname) }} <p></p>
{{ form_row(registration_form.email) }} <p></p>
{{ form_row(registration_form.password) }} <p></p>
{{ form_row(registration_form.register) }}
</fieldset>
{{ form_end(registration_form) }}
</div>
{% endblock body %}

View File

@ -42,40 +42,39 @@
</nav>
{% else %}
<div class="profile">
<nav>
<a href="{{ path('login') }}" class='hover-effect {{ active('login') }}'>Login</a>
<a href="{{ path('register') }}">Register</a>
</nav>
</div>
<nav>
<a href="{{ path('login') }}" class='hover-effect {{ active('login') }}'>Login</a>
<a href="{{ path('register') }}">Register</a>
</nav>
{% endif %}
<div class="timeline-nav">
<h1>
<nav>
<a href="{{ path('main_public') }}"
class='{{ active('main_public', 'main_all', "home_all") }}'>Timeline</a>
</h1>
<hr>
<hr>
<nav class='sec-nav'>
<a href="{{ path('main_public') }}"
class='{{ active('main_public') }}'>Public</a>
<nav class='sec-nav'>
<a href="{{ path('main_public') }}"
class='{{ active('main_public') }}'>Public</a>
{% if user_nickname is defined %}
<a href="{{ path("home_all", {'nickname' : user_nickname}) }}"
class='{{ active("home_all") }}'>Home</a>
{% endif %}
{% if user_nickname is defined %}
<a href="{{ path("home_all", {'nickname' : user_nickname}) }}"
class='{{ active("home_all") }}'>Home</a>
{% endif %}
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
{% if main_nav_tabs is defined %}
{% for tab in main_nav_tabs %}
<a href="{{ path(tab['route']) }}"
class='{{ active(tab['route']) }}'>{{ tab['title'] }}</a>
{% endfor %}
{% endif %}
{% if main_nav_tabs is defined %}
{% for tab in main_nav_tabs %}
<a href="{{ path(tab['route']) }}"
class='{{ active(tab['route']) }}'>{{ tab['title'] }}</a>
{% endfor %}
{% endif %}
</nav>
</nav>
</div>
</div>