[UI] Cropping avatar as a circle, proper preview done

This commit is contained in:
rainydaysavings 2020-07-28 17:08:08 +01:00 committed by Hugo Sales
parent 574fb38225
commit 774383a3c1
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
10 changed files with 106 additions and 75 deletions

View File

@ -80,10 +80,8 @@
.icon-avatar { .icon-avatar {
order: 1; order: 1;
height: calc(5 * var(--unit-size)); height: calc(5 * var(--unit-size));
weight: auto; calc(5 * var(--unit-size));
width: 25%;
margin-right: var(--small-size); margin-right: var(--small-size);
clip-path: circle(2.5em at center);
} }
.info { .info {

View File

@ -90,9 +90,8 @@
.icon-avatar { .icon-avatar {
order: 1; order: 1;
height: calc(5 * var(--unit-size)); height: calc(5 * var(--unit-size));
width: 25%; width: calc(5 * var(--unit-size));
margin-right: var(--small-size); margin-right: var(--small-size);
clip-path: circle(2.5em at center);
} }
.info { .info {

View File

@ -90,9 +90,8 @@
.icon-avatar { .icon-avatar {
order: 1; order: 1;
height: calc(5 * var(--unit-size)); height: calc(5 * var(--unit-size));
width: 5em; width: calc(5 * var(--unit-size));
margin-right: var(--small-size); margin-right: var(--small-size);
clip-path: circle(2.5em at center);
} }
.info { .info {

View File

@ -1,9 +1,14 @@
.content { .content {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: calc(3 * var(--main-size)); margin-top: calc(5 * var(--main-size));
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-left: var(--nav-size); margin-left: var(--nav-size);
margin-right: 0; margin-right: 0;
} }
.content div {
width: 100%;
text-align: center;
}

View File

@ -226,9 +226,17 @@ select {
max-width: 100%; max-width: 100%;
} }
#img-container { #img-container {
display: flex; margin: var(--main-size) auto;
margin-top: var(--main-size); max-width: 60%;
margin-left: auto; }
margin-right: auto; .cropper-view-box,
max-width: 500px; .cropper-face {
border-radius: 50%;
}
button {
background-color: #f6f6f6;
padding: var(--small-size);
border: none;
border-radius: var(--small-size);
} }

View File

@ -224,9 +224,17 @@ select {
max-width: 100%; max-width: 100%;
} }
#img-container { #img-container {
display: flex; margin: var(--main-size) auto;
margin-top: var(--main-size); max-width: 80%;
margin-left: auto; }
margin-right: auto; .cropper-view-box,
max-width: 500px; .cropper-face {
border-radius: 50%;
}
button {
background-color: #f6f6f6;
padding: var(--small-size);
border: none;
border-radius: var(--small-size);
} }

View File

@ -225,9 +225,17 @@ select {
max-width: 100%; max-width: 100%;
} }
#img-container { #img-container {
display: flex; margin: var(--main-size) auto;
margin-top: var(--main-size); max-width: 80%;
margin-left: auto; }
margin-right: auto; .cropper-view-box,
max-width: 500px; .cropper-face {
border-radius: 50%;
}
button {
background-color: #f6f6f6;
padding: var(--small-size);
border: none;
border-radius: var(--small-size);
} }

View File

@ -29,6 +29,6 @@
No notices here. No notices here.
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock body %}
{% block javascripts %}{% endblock %} {% block javascripts %}{% endblock %}

View File

@ -24,12 +24,14 @@
{% if app.user %} {% if app.user %}
<div class="mb-3"> <div class="mb-3">
You are logged in as {{ app.user.username }}, <a href="{{ path('app_logout') }}">Logout</a> You are logged in as {{ app.user.username }}, <a
href="{{ path('app_logout') }}">Logout</a>
</div> </div>
{% endif %} {% endif %}
<div class="register-info"> <div class="register-info">
<label for="inputNickname">Nickname</label> <label for="inputNickname">Nickname</label>
<input type="text" value="{{ last_username }}" name="nickname" id="inputNickname" class="form-control" required autofocus> <input type="text" value="{{ last_username }}" name="nickname" id="inputNickname"
class="form-control" required autofocus>
<label for="inputPassword">Password</label> <label for="inputPassword">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" required> <input type="password" name="password" id="inputPassword" class="form-control" required>
</div> </div>

View File

@ -20,3 +20,7 @@
</div> </div>
</div> </div>
{% endblock form %} {% endblock form %}
{% block javascripts %}
<script type="text/javascript" src="{{ asset('assets/javascript/cropping.js') }}"></script>
{% endblock %}