[CARDS][Navigation] Section styling more consistent and can now be selectively hidden by user

[COMPONENTS][Right] Changed additional options div class names
This commit is contained in:
Eliseu Amaro 2021-12-08 15:16:30 +00:00
parent a285128dab
commit 870f866c23
Signed by: eliseuamaro
GPG Key ID: 96DA09D4B97BC2D5
4 changed files with 63 additions and 46 deletions

View File

@ -13,7 +13,10 @@
<details class="section-widget-title-details" open="open" <details class="section-widget-title-details" open="open"
title="{{ 'Expand if you want to access more options.' | trans }}"> title="{{ 'Expand if you want to access more options.' | trans }}">
<summary class="section-title-summary"> <summary class="section-title-summary">
{{ "Create a note" | trans }}{{ icon('arrow-down', 'icon icon-details-open') | raw }} <h2>
{{ "Create a note" | trans }}
</h2>
{{ icon('arrow-down', 'icon icon-details-open') | raw }}
</summary> </summary>
<div class="section-form"> <div class="section-form">
@ -26,7 +29,10 @@
<details class="section-widget-subtitle-details"> <details class="section-widget-subtitle-details">
<summary class="section-subtitle-summary"> <summary class="section-subtitle-summary">
{{ "Additional options" | trans }}{{ icon('arrow-down', 'icon icon-details-close') | raw }} <h3>
{{ "Additional options" | trans }}
</h3>
{{ icon('arrow-down', 'icon icon-details-close') | raw }}
</summary> </summary>
{{ form_row(blocks['post_form'].language) }} {{ form_row(blocks['post_form'].language) }}
{{ form_row(blocks['post_form'].tag_use_canonical) }} {{ form_row(blocks['post_form'].tag_use_canonical) }}

View File

@ -22,12 +22,10 @@
align-self: center; align-self: center;
fill: var(--foreground); fill: var(--foreground);
} }
.edit-feed-link {
display: block;
float: right;
}
.active { .active {
font-weight: bold; font-size: 1.1em;
font-family: 'Poppins', sans-serif;
font-weight: 600;
} }
.anchor-hidden { .anchor-hidden {
width: 1px; width: 1px;

View File

@ -76,7 +76,7 @@
font-family: 'Open Sans',sans-serif; font-family: 'Open Sans',sans-serif;
font-weight: 700; font-weight: 700;
} }
.section-widget-subtitle-details :not(summary,svg) { .section-widget-subtitle-details :not(summary,svg,h3) {
border-radius: var(--smaller); border-radius: var(--smaller);
background: var(--gradient); background: var(--gradient);
padding: 6px 10px; padding: 6px 10px;
@ -98,19 +98,26 @@
background: var(--gradient) !important; background: var(--gradient) !important;
} }
.section-widget-subtitle-details[open] svg, .section-widget-subtitle-details[open] svg,
.section-widget-title-details[open] svg { .section-widget-title-details[open] .icon-details-open {
transform: rotate(180deg); transform: rotate(180deg);
animation: fadeOut 200ms cubic-bezier(0,0.55,0.45,1); animation: fadeOut 200ms cubic-bezier(0,0.55,0.45,1);
} }
.section-widget-subtitle-details:not([open]) svg, .section-widget-subtitle-details:not([open]) svg,
.section-widget-title-details:not([open]) svg { .section-widget-title-details:not([open]) .icon-details-open {
transform: initial; transform: initial;
animation: fadeIn 200ms cubic-bezier(0,0.55,0.45,1); animation: fadeIn 200ms cubic-bezier(0,0.55,0.45,1);
} }
.section-subtitle-summary, .section-subtitle-summary,
.section-title-summary { .section-title-summary {
display: flex; display: flex;
justify-content: space-between; }
.section-subtitle-summary h3,
.section-title-summary h2 {
margin-right: auto;
}
.section-subtitle-summary svg:last-child,
.section-title-summary svg:last-child {
margin-left: 4px;
} }
.section-form { .section-form {
display: flex; display: flex;

View File

@ -1,42 +1,48 @@
{% block feeds %} {% block feeds %}
<section class="section-widget section-widget-padded"> <section class="section-widget" title="{{ 'Feed navigation.' | trans }}">
<h2 class="section-title">{{ icon('logo', 'icon icon-logo') | raw }}{{ 'Feeds' | trans }} <details class="section-widget-title-details" open="open"
{% if app.user %} title="{{ 'Expand if you want to access more options.' | trans }}">
{# User custom feeds #} <summary class="section-title-summary">
<a class="edit-feed-link" href="{{ path('edit_feeds') }}">{{ icon('edit', 'icon icon-edit-feed') | raw }}</a> <h2>{{ 'Feeds' | trans }}</h2>
{% endif %} {% if app.user %}
</h2> {# User custom feeds #}
<nav class='sec-nav' tabindex="0" title="{{ 'Navigate through each feed.' | trans }}"> <a class="edit-feed-link" href="{{ path('edit_feeds') }}">{{ icon('edit', 'icon icon-edit-feed') | raw }}</a>
{% if not app.user %} {# Default feeds #} {% endif %}
<ul> {{ icon('arrow-down', 'icon icon-details-open') | raw }}
<li> </summary>
<a href="{{ path('main_public') }}" class='{{ active('main_public') }}'>
Public <nav class='section-widget-padded' tabindex="0" title="{{ 'Navigate through each feed.' | trans }}">
</a> {% if not app.user %} {# Default feeds #}
</li> <ul>
<li>
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>
Network
</a>
</li>
</ul>
{% else %}
<ul>
{% for link in get_feeds(current_actor) %}
<li> <li>
<a href="{{ link.getUrl() }}" class='{{ active(link.getRoute()) }}'>{{ link.getTitle() }}</a> <a href="{{ path('main_public') }}" class='{{ active('main_public') }}'>
</li> Public
{% endfor %}
{% for link in handle_event('AddMainNavigationItem', {'nickname': current_actor.getNickname()}) %}
<li>
<a href="{{ link['path'] }}" class='{{ active(link['path_id']) }}'>
{{ link['title'] }}
</a> </a>
</li> </li>
{% endfor %} <li>
</ul> <a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>
{% endif %} Network
</nav> </a>
</li>
</ul>
{% else %}
<ul>
{% for link in get_feeds(current_actor) %}
<li>
<a href="{{ link.getUrl() }}" class='{{ active(link.getRoute()) }}'>{{ link.getTitle() }}</a>
</li>
{% endfor %}
{% for link in handle_event('AddMainNavigationItem', {'nickname': current_actor.getNickname()}) %}
<li>
<a href="{{ link['path'] }}" class='{{ active(link['path_id']) }}'>
{{ link['title'] }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</nav>
</details>
</section> </section>
{% endblock feeds %} {% endblock feeds %}