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

View File

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

View File

@ -1,81 +1,66 @@
.content { form {
display: flex; width: 50%;
flex-wrap: wrap; margin-left: auto;
margin-top: calc(4 * var(--main-size)); margin-right: auto;
justify-content: center;
align-items: center; padding: var(--main-size);
margin-left: 1%; background-image: radial-gradient(ellipse at 10% 10%, var(--bg3), var(--accent-blue)),
margin-right: 1%; url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAElBMVEUAAACUkpSEhoSMioyMjoyEgoRr6djFAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAU1JREFUKJEVUcl1xTAIpAVLSgECXIAYUoCAX0Bi919LlCPLm5ValiOUUe2+ZRVFuYpKXFsUX9aIp0V6GtC8VRhNL0X2fikvswhKrNDhes7pbpPkufFAtI0B76LEjfc2bgdHDk6RX4A/sjt6LCylfoYpNYYJx/9COhIugsjluzN9VGZ/Hnl51jIH2ba+Ywsy2RJCFdoDe8Obw61TXGAv+ewExMRJs7gd7YcimPuk42uMqY2VJ1fK+bDL32rb7kwok/la/u7Mrz7Xf0DTssSP2Btp1ZS0zw35tM/SsJKgWNLcRh+/th1QqntwtM3Tx0LNosoBYbM3qjJFiMeLsMH2i5BcQdU3n9sJHOE1Hoqn1GA/bm4s0YkVB/y4r0PbltF32FpljXmdlOOwbDvFWkoDYLppSG4pnM6UxX3Src1lhXeU36FOu3o+R2vNaHME/wESUl9/3zMniwAAAABJRU5ErkJggg==);
margin-bottom: 1%; background-blend-mode: multiply;
border-radius: var(--unit-size);
} }
form { fieldset {
font-size: var(--medium-size); display: flex;
background-color: var(--bg2); flex-direction: column;
padding: calc(2 * var(--unit-size));
border-radius: var(--unit-size); font-family: var(--display-font);
border: solid 2px var(--accent-low); font-size: var(--main-size);
}
fieldset legend {
margin-bottom: var(--main-size);
}
br {
margin-bottom: var(--unit-size);
} }
label { label {
font-family: 'Montserrat', sans-serif; font-family: var(--display-font);
font-weight: 700; 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%; width: 100%;
} }
button { 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], fieldset div:last-child {
input[type=password], text-align: end;
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;
}

View File

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

View File

@ -13,9 +13,15 @@
<div class="alert alert-danger" role="alert">{{ flashError }}</div> <div class="alert alert-danger" role="alert">{{ flashError }}</div>
{% endfor %} {% endfor %}
<div class="register-info"> {{ form_start(registration_form) }}
{{ form(registration_form) }} <fieldset>
</div> <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> </div>
{% endblock body %} {% endblock body %}

View File

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