[TWIG][CSS] Shortcuts now work in small screen sizes. Header icons further polish. Profile navigation structural rework.

This commit is contained in:
Eliseu Amaro 2021-08-30 21:01:32 +01:00 committed by Hugo Sales
parent ca2eff2906
commit 7dc390ca1c
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
5 changed files with 124 additions and 144 deletions

View File

@ -11,7 +11,7 @@
*/
--unit-size: 0.5rem;
--main-size: 1.4rem;
--medium-size: 1.2rem;
--medium-size: 1.15rem;
--small-size: 1rem;
/* colours and shadows */
@ -40,9 +40,14 @@
background-size: 100% 100%;
}
.anchor-hidden {
display: none;
}
/* HEADER AND SIDEPANELS */
#header {
z-index: 1;
font-size: var(--main-size);
height: 3rem;
display: flex;
@ -50,18 +55,13 @@
top: 0;
background-color: var(--bg1);
padding: var(--unit-size);
width: 100%;
align-items: center;
padding: var(--unit-size);
box-shadow: var(--shadow);
}
/* content should be rendered after the header, not bellow */
#header + * {
margin-top: 3rem;
}
#instance {
display: flex;
align-items: center;
@ -96,10 +96,7 @@
/* CONTAINS ALL ELEMENTS BESIDES HEADER */
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-top: 3rem;
margin-left: 20%;
margin-right: 20%;
padding: var(--unit-size);
@ -457,11 +454,11 @@ input[type=file]:hover {
}
/* MEDIA QUERIES */
/* sidepanels need to be shown by default on desktop, hidden on mobile */
.panel .panel-content {
display: flex;
flex-direction: column;
font-size: var(--small-size);
/* should remain in place for the user */
position: fixed;
@ -473,7 +470,6 @@ input[type=file]:hover {
/* should occupy the entire vertical real estate */
height: 100%;
padding: var(--unit-size);
}
@ -486,12 +482,19 @@ input[type=file]:hover {
width: 100%;
max-width: 20%;
}
a[id|="anchor"]:target + * {
animation-name: highlight;
animation-duration: 500ms;
animation-timing-function: ease;
}
}
@media (max-width: 1200px) {
/* content should occupy the entire width at this size */
.container {
margin: unset;
margin-left: unset;
margin-right: unset;
}
.content {
@ -504,8 +507,9 @@ input[type=file]:hover {
}
#panel-left-toggle:checked ~ .panel-content,
#panel-right-toggle:checked ~ .panel-content {
display: flex;
#panel-right-toggle:checked ~ .panel-content,
a[id|="anchor"]:target ~ .panel-content {
display: flex !important;
width: 100%;
background-color: var(--bg2);
@ -595,9 +599,3 @@ input[type=file]:hover {
box-shadow: initial;
}
}
[id|="anchor"]:target + * {
animation-name: highlight;
animation-duration: 500ms;
animation-timing-function: ease;
}

View File

@ -5,20 +5,30 @@
#panel-left-toggle:not(:checked),
#panel-left-toggle:checked {
position: absolute;
opacity: 0;
top: -100%;
}
#panel-left-toggle:focus + * {
border-radius: 4px;
border: 2px solid var(--white);
}
#panel-left-icon {
cursor: pointer !important;
border: 2px solid transparent;
height: 100%;
width: auto;
}
.panel-left nav {
font-size: var(--medium-size);
}
/* PROFILE */
.profile-nav {
font-family: var(--display-font);
}
.profile-nav nav {
display: inline-grid;
margin-bottom: var(--main-size);
}
.profile {
display: flex;
flex-direction: column;
font-family: var(--display-font);
background-color: var(--translucent);
margin-bottom: var(--main-size);
border: solid 2px var(--bg2);
@ -28,56 +38,27 @@
box-sizing: border-box;
}
#profile-links {
display: flex;
align-items: center;
box-sizing: border-box;
margin-bottom: var(--unit-size);
#user {
align-content: center;
}
#user-avatar {
box-sizing: border-box;
border-radius: 50%;
padding: 0;
}
#user-avatar img {
border-radius: var(--unit-size);
width: calc(3 * var(--main-size));
#user img {
float: left;
width: 5rem;
height: auto;
margin-right: var(--unit-size);
margin-right: 5px;
}
#user-avatar:hover,
#user-avatar:focus {
cursor: pointer;
background: none !important;
.profile-navigation {
margin-bottom: var(--main-size);
}
#user-avatar:hover img,
#user-avatar:focus img {
border-radius: 50% !important;
box-shadow: var(--shadow-light) !important;
}
#user-info {
display: flex;
flex-direction: column;
}
#user-tags {
font-family: var(--main-font);
padding-left: var(--unit-size);
}
#stats {
display: flex;
flex-direction: column;
font-size: var(--medium-size);
font-weight: bold;
.profile-navigation > * {
display: block;
}
/* TIMELINE NAVIGATION / PLUGINS */
.timeline-nav {
margin-bottom: var(--main-size);
}
.timeline-nav a,
.timeline-nav h1 {
display: flex;
@ -106,5 +87,5 @@
}
.footer {
font-size: var(--small-size);
}

View File

@ -5,5 +5,16 @@
#panel-right-toggle:not(:checked),
#panel-right-toggle:checked {
position: absolute;
opacity: 0;
top: -100%;
}
#panel-right-toggle:focus + * {
border-radius: 4px;
border: 2px solid var(--white);
}
#panel-right-icon {
cursor: pointer !important;
border: 2px solid transparent;
height: 100%;
width: auto;
}

View File

@ -1,22 +1,17 @@
<div class="panel panel-left">
<input type="checkbox" id="panel-left-toggle">
<label for="panel-left-toggle">{{ icon('menu', 'icon icon-left') | raw }}</label>
<label id="panel-left-icon" for="panel-left-toggle">{{ icon('menu', 'icon icon-left') | raw }}</label>
<a id="anchor-left-panel" class="anchor-hidden"></a>
<aside class="panel-content">
<nav class='profile-nav'>
{% if app.user %}
<section class='profile' role="complementary">
<div id="profile-links">
<a id="user-avatar" href="{{ path('settings') }}">
<section class='profile'>
<a id="user" href="{{ path('settings') }}">
<img src='{{ user_avatar }}' alt="Your avatar." class="icon icon-avatar">
</a>
<span id="user-info">
<a id="user-nick" href="{{ path('settings') }}">
<div id="user-info">
<h1>{{ user_nickname }}</h1>
</a>
<div id="user-tags">
<nav id="user-tags">
{% if user_tags %}
{% for tag in user_tags %}
<a href='#'> #{{ tag }}</a>
@ -24,21 +19,21 @@
{% else %}
{{ '(No tags)' | trans }}
{% endif %}
</div>
</span>
</div>
</nav>
<section id="stats">
<label>{{ 'Followers' | trans }} {{ user_followers }}</label>
<label>{{ 'Followed' | trans }} {{ user_followed }}</label>
<section id="user-stats">
{% if user_followers %}<h2>{{ 'Followers' | trans }} {{ user_followers }}</h2> {% endif %}
{% if user_followed %}<h2>{{ 'Followed' | trans }} {{ user_followed }}</h2> {% endif %}
</section>
</div>
</a>
{# {% for extra in profile_extras %}
{% include '/'~ extra.name ~ '/view.html.twig' with {'vars': extra.vars} only %}
{% endfor %} #}
</section>
<nav role="navigation">
<nav class="profile-navigation">
<a href='#'>Messages</a>
<a href="{{ path("replies", {'nickname' : user_nickname}) }}"
class='hover-effect {{ active("replies") }}'>Replies</a>
@ -51,14 +46,13 @@
</nav>
{% else %}
<nav>
<nav class="profile-navigation">
<a href="{{ path('login') }}" class='hover-effect {{ active('login') }}'>Login</a>
<a href="{{ path('register') }}">Register</a>
</nav>
{% endif %}
<div class="timeline-nav" role="menu">
<nav>
<nav class="timeline-nav" role="menu">
<h1 role="tab">Timeline</h1>
<nav class='sec-nav' role="navigation">
@ -81,10 +75,6 @@
</nav>
</nav>
</div>
</nav>
<div class="footer" role="contentinfo">
<a href="{{ path('doc_faq') }}" class='hover-effect {{ active('doc_faq') }}'>FAQ</a>
<a href="{{ path('doc_tos') }}" class='hover-effect {{ active('doc_tos') }}'>TOS</a>

View File

@ -1,6 +1,6 @@
<div class="panel panel-right">
<input type="checkbox" id="panel-right-toggle">
<label for="panel-right-toggle">{{ icon('notes', 'icon icon-right') | raw }}</label>
<label id="panel-right-icon" for="panel-right-toggle">{{ icon('notes', 'icon icon-right') | raw }}</label>
<a id="anchor-right-panel" class="anchor-hidden"></a>
<aside class="panel-content">