[TWIG][SETTINGS] WIP. Settings navigation early sketch.

Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
This commit is contained in:
Eliseu Amaro 2021-07-28 20:16:27 +01:00 committed by Hugo Sales
parent a6f5c61aef
commit 10d7462d02
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
10 changed files with 197 additions and 404 deletions

View File

@ -360,4 +360,16 @@ figcaption a:link {
opacity: unset;
transform: none;
}
}
@keyframes fadeOut {
100% {
opacity: 0;
transform: translateY(-10px);
}
0% {
opacity: unset;
transform: none;
}
}

View File

@ -61,7 +61,6 @@ details > summary::-webkit-details-marker {
/* have IE ignore the detail elements altogether */
@supports not (-ms-ime-align: auto) {
details summary {
cursor: pointer;
}

View File

@ -1,307 +1,87 @@
.content {
display: flex;
flex-wrap: wrap;
margin-top: calc(4 * var(--main-size));
justify-content: center;
align-items: center;
margin-left: var(--nav-size);
margin-right: var(--nav-size);
.main-nav {
margin-bottom: var(--unit-size);
font-size: var(--main-size);
border-radius: var(--unit-size);
padding: var(--unit-size);
box-sizing: border-box;
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;
}
.main {
width: 100%;
margin-left: var(--unit-size);
margin-right: var(--unit-size);
box-shadow: var(--shadow);
border-radius: var(--small-size);
border: solid 2px var(--accent-low);
background-color: var(--bg3);
.main-nav ul {
margin-top: var(--main-size);
}
.set-nav {
order: 1;
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
flex: 1;
background-color: var(--bg1);
padding: var(--medium-size);
.main-nav ul li {
font-size: var(--medium-size);
font-family: var(--head-font);
border-radius: var(--small-size) var(--small-size) 0 0;
}
.set-nav ul {
display: flex;
align-items: stretch;
justify-content: space-evenly;
width: 100%;
margin-left: calc(2 * var(--side-margin));
margin-right: calc(2 * var(--side-margin));
padding: 0;
}
border-radius: var(--unit-size);
box-sizing: border-box;
.set-nav li {
display: block;
flex: 0 1 auto;
list-style-type: none;
font-weight: 700;
}
padding: var(--unit-size);
margin-bottom: var(--small-size);
.set-nav a {
color: var(--accent);
}
.set-nav a:hover {
color: var(--fg);
transition: all 0.8s ease;
}
.active {
color: var(--fg) !important;
font-weight: 700;
}
.secondary {
display: flex;
flex-wrap: wrap;
background-color: var(--bg3);
margin: var(--unit-size);
border: solid 2px var(--accent-low);
border-radius: var(--small-size);
box-shadow: var(--shadow);
background-color: var(--translucent);
}
.form {
order: 3;
padding: calc(2 * var(--unit-size));
height: 100%;
width: 100%;
border-radius: 0 0 var(--small-size) var(--small-size);
}
.form-single {
order: 2;
padding: calc(2 * var(--unit-size));
height: 100%;
width: 100%;
border-radius: var(--small-size);
}
.form label,
.form-single label {
font-size: var(--medium-size);
}
/* FORMS ------------------------------*/
label {
display: inline-block;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
width: 100%;
}
input[type=text] {
margin-top: calc(var(--unit-size) * 0.5);
width: calc(100% - var(--unit-size));
background-color: var(--bg2);
box-shadow: var(--shadow);
border: solid 2px var(--accent-low);
padding: calc(var(--unit-size) * 0.5) calc(var(--unit-size) * 0.5);
color: var(--fg);
border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size);
}
.form input[type=checkbox] {
float: left;
margin-right: calc(var(--unit-size) * 0.5);
margin-top: calc(var(--unit-size) * 0.2);
}
button[type=submit] {
background: var(--bg1);
padding: calc(var(--unit-size) * 0.8) calc(var(--unit-size) * 2);
color: var(--fg);
border-style: solid;
border-color: var(--accent);
font-size: var(--main-size);
border-radius: var(--unit-size);
border-width: 2px;
font-family: 'Montserrat', sans-serif;
font-size: var(--small-size);
font-weight: 700;
padding: var(--unit-size);
box-sizing: border-box;
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;
}
#save_bio {
margin-top: calc(var(--unit-size) * 0.5);
width: calc(100% - var(--unit-size));
height: calc(10 * var(--unit-size));
box-shadow: var(--shadow);
background-color: var(--bg2);
border: solid 2px var(--accent-low);
padding: calc(var(--unit-size) * 0.5) calc(var(--unit-size) * 0.5);
color: var(--fg);
border-radius: calc(var(--unit-size) * 0.5);
.form #save {
margin-top: var(--main-size);
font-size: var(--medium-size);
word-wrap: break-word;
resize: vertical;
}
#save_phone_number {
margin-top: calc(var(--unit-size) * 0.5);
width: calc(100% - var(--unit-size));
background-color: var(--bg2);
box-shadow: var(--shadow);
border: solid 2px var(--accent-low);
padding: calc(var(--unit-size) * 0.5) calc(var(--unit-size) * 0.5);
color: var(--fg);
border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size);
}
#save_language {
margin-top: calc(var(--unit-size) * 0.5);
background-color: var(--bg2);
box-shadow: var(--shadow);
border: solid 2px var(--accent-low);
padding: calc(var(--unit-size) * 0.5) calc(var(--unit-size) * 0.5);
color: var(--fg);
border-radius: calc(var(--unit-size) * 0.5);
font-size: var(--medium-size);
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-image: url("../../icons/drop.svg");
background-size: var(--main-size);
background-position: 95% 50%;
background-repeat: no-repeat;
}
.help-text {
font-size: var(--medium-size);
font-style: italic;
color: var(--fg);
margin-bottom: var(--unit-size);
}
.form-single input[type=checkbox] {
margin-left: var(--unit-size);
}
/* JS CROPPING */
#img-cropped {
display: block;
max-width: 100%;
}
#img-container {
margin: var(--main-size) auto;
max-width: 60%;
}
.cropper-view-box,
.cropper-face {
border-radius: 50%;
}
/* NOTIFICATIONS TABS */
/* visual feedback */
ul input[type=radio] + label {
color: var(--accent);
}
ul input[type=radio]:checked + label {
color: var(--fg);
}
ul input[type=radio]:focus + label {
color: var(--fg);
}
/* show/hide each tab */
ul input[type=radio]:not(:checked) + label + div {
display: none;
}
ul input[type=radio]:checked + label + div {
display: flex;
}
/* hide radio buttons */
input[type=radio] {
position: absolute;
z-index: 1;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
#form-tabs {
order: 2;
width: 100%;
font-size: var(--medium-size);
}
#form-tabs ul {
display: flex;
flex-wrap: wrap;
border-radius: 0 0 var(--unit-size) var(--unit-size);
background-color: var(--bg1);
justify-content: space-evenly;
width: 100%;
}
#form-tabs ul label {
order: 1;
flex: 0;
}
#tabs {
padding: var(--medium-size);
text-transform: capitalize;
}
#form-tabs ul .form {
order: 2;
padding: calc(2 * var(--unit-size));
background-color: var(--bg3) !important;
height: 100%;
margin-left: 0;
margin-right: 0;
margin-top: 0;
box-shadow: none;
border-radius: 0 0 var(--unit-size) var(--unit-size);
font-size: var(--unit-size);
}
#form-tabs ul .form form {
width: 100%;
}
#form-tabs ul .form form div label {
margin-bottom: calc(var(--unit-size) * 0.5);
}
.secondary button[type=submit] {
background: var(--bg1);
padding: 0.6em 1.2em;
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;
padding: var(--unit-size);
box-sizing: border-box;
background-color: var(--translucent);
}
.secondary button[type=submit]:focus,
.secondary button[type=submit]:hover {
border-radius: var(--unit-size);
box-shadow: 0 0 8px var(--accent);
.icon-details-open {
fill: var(--white);
}
.section-title-settings summary:focus,
.section-title-settings summary:hover {
border-radius: var(--unit-size) !important;
padding: var(--unit-size) var(--small-size) var(--unit-size) var(--small-size) !important;
background: var(--white) !important;
color: var(--bg1) !important;
transition: all 0.4s ease;
}
.section-title-settings summary:focus .icon-details-open,
.section-title-settings summary:hover .icon-details-open {
fill: var(--bg1);
transition: all 0.4s ease;
}
/* SECTION DETAILS OPENED */
.section-title-settings[open] svg {
transform: rotate(180deg);
animation: fadeOut 300ms;
}
.section-title-settings[open] .set-nav li:first-of-type {
margin-top: var(--unit-size);
}
.section-title-settings[open] .set-nav li:last-of-type {
margin-bottom: 0;
}
/* SECTION DETAILS CLOSED */
.section-title-settings:not([open]) svg {
transform: initial;
animation: fadeIn 300ms;
}

View File

@ -0,0 +1,7 @@
<!-- https://github.com/primer/octicons -->
<!-- MIT License -->
<svg class="{{ iconClass|default('') }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
<title>arrow-down</title>
<path fill-rule="evenodd"
d="M13.03 8.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.47 9.28a.75.75 0 011.06-1.06l2.97 2.97V3.75a.75.75 0 011.5 0v7.44l2.97-2.97a.75.75 0 011.06 0z"></path>
</svg>

After

Width:  |  Height:  |  Size: 430 B

View File

@ -0,0 +1,7 @@
<!-- https://github.com/primer/octicons -->
<!-- MIT License -->
<svg class="{{ iconClass|default('') }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
<title>plus-circle</title>
<path fill-rule="evenodd"
d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.75 4.75a.75.75 0 00-1.5 0v2.5h-2.5a.75.75 0 000 1.5h2.5v2.5a.75.75 0 001.5 0v-2.5h2.5a.75.75 0 000-1.5h-2.5v-2.5z"></path>
</svg>

After

Width:  |  Height:  |  Size: 462 B

View File

@ -1,22 +1,12 @@
{% extends 'settings/base.html.twig' %}
{% block title %}Notification Settings{% endblock %}
{% block title %}Account Settings{% endblock %}
{% block body %}
{% block page_name %}Account{% endblock %}
<div class='content'>
<div class="main">
{% block primary_nav %}
{{ parent() }}
{% endblock primary_nav %}
<div class="secondary">
{% block form %}
<div class='form-single'>
{{ form(acc) }}
</div>
{% endblock form %}
</div>
</div>
{% block form %}
<div class='form-single'>
<h1>Settings / Profile</h1>
{{ form(acc) }}
</div>
{% endblock body %}
{% endblock form %}

View File

@ -8,12 +8,9 @@
<script src="{{ asset('assets/javascript/cropperjs/cropper.js') }}"></script>
{% endblock %}
{% block body %}
{{ parent() }}
{% endblock body %}
{% block form %}
<div class='form'>
<h1>Settings / Profile</h1>
{{ form(avatar) }}
<div id="img-container">
<img id="img-cropped">

View File

@ -2,18 +2,14 @@
{% block meta %}
{{ parent() }}
<link href="{{ asset('assets/icons/arrow-down.svg.twig') }}" rel="icon"/>
{% endblock %}
{% block title %}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings.css') }}"
media="screen and (min-width: 1300px)">
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings_mid.css') }}"
media="screen and (max-width: 1300px)">
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings_small.css') }}"
media="screen and (max-width: 750px)">
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/settings/settings.css') }}">
{% endblock %}
{% block header %}
@ -21,37 +17,83 @@
{% endblock %}
{% block body %}
{% block left %}
{{ parent() }}
{% endblock %}
<div class="content">
<div class="main">
{% block primary_nav %}
<nav class='set-nav'>
<ul>
<li>
<a href="{{ path('settings_personal_info') }}"
class='hover-effect {{ active('settings_personal_info', 'settings_avatar', 'settings_profile_') }}'>Profile</a>
</li>
<li>
<nav class='main-nav'>
<h1>Settings</h1>
<ul>
<li>
<details class="section-title-settings">
<summary>
<h1>Profile {{ icon('arrow-down', 'icon icon-details-open') | raw }}</h1>
<em>Personal Information, Avatar and Profile</em>
</summary>
<section>
<nav class='set-nav'>
<ul>
<li>
<a href="{{ path('settings_personal_info') }}"
class='hover-effect {{ active('settings_personal_info') }}'>Personal Info</a>
</li>
<li>
<a href="{{ path('settings_avatar') }}"
class='hover-effect {{ active('settings_avatar') }}'>Avatar</a>
</li>
{% for tab in profile_tabs %}
<li>
<a href="{{ path(tab['route']) }}"
class='hover-effect {{ active(tab['route']) }}'>{{ tab['title'] }}</a>
</li>
{% endfor %}
</ul>
</nav>
</section>
</details>
{# <a href="{{ path('settings_personal_info') }}" #}
{# class='hover-effect {{ active('settings_personal_info', 'settings_avatar', 'settings_profile_') }}'>Profile</a> #}
</li>
<li>
<details class="section-title-settings">
<summary>
<a href="{{ path('settings_account') }}"
class='hover-effect {{ active('settings_account') }}'>Account</a>
</li>
<li>
class='hover-effect {{ active('settings_account') }}'>
<h1>Account</h1>
<em>Email, Password and Language</em>
</a>
</summary>
<section>
</section>
</details>
</li>
<li>
<details class="section-title-settings">
<summary>
<a href="{{ path('settings_notifications') }}"
class='hover-effect {{ active('settings_notifications') }}'>Notifications</a>
</li>
</ul>
</nav>
{% endblock primary_nav %}
class='hover-effect {{ active('settings_notifications') }}'>
<h1>Notifications</h1>
<em>Enable/disable notifications (Email, XMPP, Replies...)</em>
</a>
</summary>
{% block secundary_nav %}
{% endblock secundary_nav %}
<section>
{% block form %}
{% endblock form %}
</div>
</section>
</details>
{# <a href="{{ path('settings_notifications') }}"
class='hover-effect {{ active('settings_notifications') }}'>Notifications</a> #}
</li>
</ul>
</nav>
<hr>
{% block form %}
{% endblock %}
</div>
{% endblock body %}

View File

@ -6,32 +6,21 @@
{{ parent() }}
{% endblock %}
{% block body %}
<div class='content'>
<div class="main">
{% block primary_nav %}
{{ parent() }}
{% endblock primary_nav %}
{% block form %}
<div id='form-tabs'>
<h1>Settings / Notifications </h1>
<div class="secondary">
{% block form %}
<div id='form-tabs'>
<ul>
{% for transport, form in tabbed_forms %}
<input type="radio" id="toggle-{{ transport }}" name="tabs"
value="toggle-{{ transport }}" {% if transport == "email" %} checked {% endif %}>
<label for="toggle-{{ transport }}" id='tabs'>
{{ transport }}
</label>
<div id="form_{{ transport }}" class='form'>
{{ form(form) }}
</div>
{% endfor %}
</ul>
</div>
{% endblock form %}
</div>
</div>
<ul>
{% for transport, form in tabbed_forms %}
<input type="radio" id="toggle-{{ transport }}" name="tabs"
value="toggle-{{ transport }}" {% if transport == "email" %} checked {% endif %}>
<label for="toggle-{{ transport }}" id='tabs'>
{{ transport }}
</label>
<div id="form_{{ transport }}" class='form'>
{{ form(form) }}
</div>
{% endfor %}
</ul>
</div>
{% endblock body %}
{% endblock form %}

View File

@ -2,41 +2,11 @@
{% block title %}Profile Settings{% endblock %}
{% block body %}
<div class='content'>
<div class="main">
{% block primary_nav %}
{{ parent() }}
{% endblock primary_nav %}
{% block form %}
<div class='form'>
<h1>Settings / Profile</h1>
<div class="secondary">
{% block secundary_nav %}
<nav class='set-nav'>
<ul>
<li>
<a href="{{ path('settings_personal_info') }}"
class='hover-effect {{ active('settings_personal_info') }}'>Personal Info</a>
</li>
<li>
<a href="{{ path('settings_avatar') }}"
class='hover-effect {{ active('settings_avatar') }}'>Avatar</a>
</li>
{% for tab in profile_tabs %}
<li>
<a href="{{ path(tab['route']) }}"
class='hover-effect {{ active(tab['route']) }}'>{{ tab['title'] }}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endblock secundary_nav %}
{% block form %}
<div class='form'>
{{ form(prof) }}
</div>
{% endblock form %}
</div>
</div>
{{ form(prof) }}
</div>
{% endblock body %}
{% endblock form %}