[TWIG][CSS] Left and Right panels now using a checkbox trick to control their visibility. Details element couldn't be properly controlled by CSS without breaking accessibility.
This commit is contained in:
parent
6e6b2ea87b
commit
e73af2b887
|
@ -80,16 +80,6 @@
|
||||||
transition: var(--cubic-transition);
|
transition: var(--cubic-transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel aside {
|
|
||||||
font-size: var(--medium-size);
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
|
|
||||||
width: 20%;
|
|
||||||
animation: var(--fade-in);
|
|
||||||
padding: var(--unit-size);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
fill: var(--white);
|
fill: var(--white);
|
||||||
width: 1em;
|
width: 1em;
|
||||||
|
@ -109,6 +99,9 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
|
margin-left: 20%;
|
||||||
|
margin-right: 20%;
|
||||||
padding: var(--unit-size);
|
padding: var(--unit-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,11 +109,8 @@
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-left: 20%;
|
|
||||||
margin-right: 20%;
|
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 60%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-blocks {
|
.markdown-blocks {
|
||||||
|
@ -258,54 +248,6 @@
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MEDIA RESIZE */
|
|
||||||
@media (min-width: 1200px) {
|
|
||||||
/* no need to make the panels disappear at this size */
|
|
||||||
/*.icon-left,
|
|
||||||
.icon-right {
|
|
||||||
visibility: hidden;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
/* content should occupy the entire width at this size */
|
|
||||||
.content {
|
|
||||||
margin: unset;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* by default they are hidden */
|
|
||||||
.panel aside {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel:not(:focus-within or :not[open]) aside {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.panel[open]:focus-within aside,
|
|
||||||
.panel[open] {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.panel[open] aside {
|
|
||||||
padding: var(--unit-size);
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
|
|
||||||
background-color: var(--bg3);
|
|
||||||
background-image: url(../images/bg.png);
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
min-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel[open] aside .footer {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* SECTIONS */
|
/* SECTIONS */
|
||||||
.section-widget {
|
.section-widget {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -494,6 +436,62 @@ input[type=file]:hover {
|
||||||
color: var(--white) !important;
|
color: var(--white) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MEDIA QUERIES */
|
||||||
|
|
||||||
|
/* sidepanels need to be shown by default on desktop, hidden on mobile */
|
||||||
|
.panel .panel-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
/* should remain in place for the user */
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
|
||||||
|
/* should be bellow header */
|
||||||
|
margin-top: 3rem;
|
||||||
|
|
||||||
|
/* should occupy the entire vertical real estate */
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
padding: var(--unit-size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.panel label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.panel .panel-content {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 1200px) {
|
||||||
|
/* content should occupy the entire width at this size */
|
||||||
|
.container {
|
||||||
|
margin: unset;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-left-toggle:not(:checked) ~ .panel-content,
|
||||||
|
#panel-right-toggle:not(:checked) ~ .panel-content {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-left-toggle:checked ~ .panel-content,
|
||||||
|
#panel-right-toggle:checked ~ .panel-content {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
background-color: var(--bg2);
|
||||||
|
background-image: url(../images/bg.png);
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ANIMATIONS */
|
/* ANIMATIONS */
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
#left-panel {
|
.panel-left .panel-content {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#panel-left-toggle:not(:checked),
|
||||||
|
#panel-left-toggle:checked {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* PROFILE */
|
/* PROFILE */
|
||||||
.profile-nav {
|
.profile-nav {
|
||||||
font-family: var(--display-font);
|
font-family: var(--display-font);
|
||||||
|
@ -99,6 +105,6 @@
|
||||||
padding-left: var(--unit-size);
|
padding-left: var(--unit-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer * {
|
.footer {
|
||||||
font-size: var(--small-size);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#right-panel {
|
.panel-right .panel-content {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#right-container .section-form {
|
#panel-right-toggle:not(:checked),
|
||||||
font-size: var(--small-size) !important;
|
#panel-right-toggle:checked {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
|
@ -31,12 +31,7 @@
|
||||||
<body class="bg" aria-atomic="true">
|
<body class="bg" aria-atomic="true">
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<header id='header' role="banner">
|
<header id='header' role="banner">
|
||||||
<details class="panel" id="left-container" aria-live="polite">
|
{{ block("leftpanel", "stdgrid.html.twig") }}
|
||||||
<summary tabindex="0" aria-roledescription="Left Panel. Expand to login, register or navigate this instance.">
|
|
||||||
{{ icon('menu', 'icon icon-left') | raw }}
|
|
||||||
</summary>
|
|
||||||
{{ block("leftpanel", "stdgrid.html.twig") }}
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<a id='instance' href="{{ path('main_public') }}" tabindex="0" aria-roledescription="This instance name.">
|
<a id='instance' href="{{ path('main_public') }}" tabindex="0" aria-roledescription="This instance name.">
|
||||||
<div aria-hidden="true">{{ icon('logo', 'icon icon-logo') | raw }}</div>
|
<div aria-hidden="true">{{ icon('logo', 'icon icon-logo') | raw }}</div>
|
||||||
|
@ -44,12 +39,7 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
<details class="panel" id="right-container" aria-live="polite">
|
|
||||||
<summary tabindex="0" aria-roledescription="Right Panel. Expand to create a new note.">
|
|
||||||
{{ icon('notes', 'icon icon-right') | raw }}
|
|
||||||
</summary>
|
|
||||||
{{ block("rightpanel", "stdgrid.html.twig") }}
|
{{ block("rightpanel", "stdgrid.html.twig") }}
|
||||||
</details>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
{% endblock header %}
|
{% endblock header %}
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<aside id='left-panel' role="region" tabindex="-1">
|
<div class="panel panel-left">
|
||||||
<nav class='profile-nav'>
|
<input type="checkbox" id="panel-left-toggle">
|
||||||
|
<label for="panel-left-toggle">{{ icon('menu', 'icon icon-left') | raw }}</label>
|
||||||
|
|
||||||
{% if app.user %}
|
<aside class="panel-content">
|
||||||
<section class='profile' role="complementary">
|
<nav class='profile-nav'>
|
||||||
<div id="profile-links">
|
{% if app.user %}
|
||||||
<a id="user-avatar" href="{{ path('settings') }}">
|
<section class='profile' role="complementary">
|
||||||
<img src='{{ user_avatar }}' alt="Your avatar." class="icon icon-avatar">
|
<div id="profile-links">
|
||||||
</a>
|
<a id="user-avatar" href="{{ path('settings') }}">
|
||||||
|
<img src='{{ user_avatar }}' alt="Your avatar." class="icon icon-avatar">
|
||||||
|
</a>
|
||||||
|
|
||||||
<span id="user-info">
|
<span id="user-info">
|
||||||
<a id="user-nick" href="{{ path('settings') }}">
|
<a id="user-nick" href="{{ path('settings') }}">
|
||||||
<h1>{{ user_nickname }}</h1>
|
<h1>{{ user_nickname }}</h1>
|
||||||
</a>
|
</a>
|
||||||
|
@ -22,70 +25,71 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section id="stats">
|
<section id="stats">
|
||||||
<label>{{ 'Followers' | trans }} {{ user_followers }}</label>
|
<label>{{ 'Followers' | trans }} {{ user_followers }}</label>
|
||||||
<label>{{ 'Followed' | trans }} {{ user_followed }}</label>
|
<label>{{ 'Followed' | trans }} {{ user_followed }}</label>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{# {% for extra in profile_extras %}
|
{# {% for extra in profile_extras %}
|
||||||
{% include '/'~ extra.name ~ '/view.html.twig' with {'vars': extra.vars} only %}
|
{% include '/'~ extra.name ~ '/view.html.twig' with {'vars': extra.vars} only %}
|
||||||
{% endfor %} #}
|
{% endfor %} #}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<nav role="navigation">
|
<nav role="navigation">
|
||||||
<a href='#'>Messages</a>
|
<a href='#'>Messages</a>
|
||||||
<a href="{{ path("replies", {'nickname' : user_nickname}) }}"
|
<a href="{{ path("replies", {'nickname' : user_nickname}) }}"
|
||||||
class='hover-effect {{ active("replies") }}'>Replies</a>
|
class='hover-effect {{ active("replies") }}'>Replies</a>
|
||||||
{% for link in handle_event('InsertLeftPanelLink', user_nickname) %}
|
{% for link in handle_event('InsertLeftPanelLink', user_nickname) %}
|
||||||
{{ link | raw }}
|
{{ link | raw }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<a href="{{ path('settings') }}"
|
<a href="{{ path('settings') }}"
|
||||||
class='hover-effect {{ active('settings_') }}'>Settings</a>
|
class='hover-effect {{ active('settings_') }}'>Settings</a>
|
||||||
<a href='{{ path('logout') }}'>Logout</a>
|
<a href='{{ path('logout') }}'>Logout</a>
|
||||||
</nav>
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
<nav>
|
|
||||||
<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>
|
|
||||||
<h1 role="tab">Timeline</h1>
|
|
||||||
|
|
||||||
<nav class='sec-nav' role="navigation">
|
|
||||||
<a href="{{ path('main_public') }}"
|
|
||||||
class='{{ active('main_public') }}'>Public</a>
|
|
||||||
|
|
||||||
{% if user_nickname is defined %}
|
|
||||||
<a href="{{ path("home_all", {'nickname' : user_nickname}) }}"
|
|
||||||
class='{{ active("home_all") }}'>Home</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
|
|
||||||
|
|
||||||
{% if main_nav_tabs is defined %}
|
|
||||||
{% for tab in main_nav_tabs %}
|
|
||||||
<a href="{{ path(tab['route']) }}"
|
|
||||||
class='{{ active(tab['route']) }}'>{{ tab['title'] }}</a>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
</nav>
|
</nav>
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
<nav>
|
||||||
|
<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>
|
||||||
|
<h1 role="tab">Timeline</h1>
|
||||||
|
|
||||||
|
<nav class='sec-nav' role="navigation">
|
||||||
|
<a href="{{ path('main_public') }}"
|
||||||
|
class='{{ active('main_public') }}'>Public</a>
|
||||||
|
|
||||||
|
{% if user_nickname is defined %}
|
||||||
|
<a href="{{ path("home_all", {'nickname' : user_nickname}) }}"
|
||||||
|
class='{{ active("home_all") }}'>Home</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
|
||||||
|
|
||||||
|
{% if main_nav_tabs is defined %}
|
||||||
|
{% for tab in main_nav_tabs %}
|
||||||
|
<a href="{{ path(tab['route']) }}"
|
||||||
|
class='{{ active(tab['route']) }}'>{{ tab['title'] }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</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>
|
||||||
|
<a href="{{ path('doc_privacy') }}" class='hover-effect {{ active('doc_privacy') }}'>Privacy</a>
|
||||||
|
<a href="{{ path('doc_source') }}" class='hover-effect {{ active('doc_source') }}'>Source</a>
|
||||||
|
<a href="{{ path('doc_version') }}" class='hover-effect {{ active('doc_version') }}'>Version</a>
|
||||||
</div>
|
</div>
|
||||||
|
</aside>
|
||||||
</nav>
|
</div>
|
||||||
|
|
||||||
<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>
|
|
||||||
<a href="{{ path('doc_privacy') }}" class='hover-effect {{ active('doc_privacy') }}'>Privacy</a>
|
|
||||||
<a href="{{ path('doc_source') }}" class='hover-effect {{ active('doc_source') }}'>Source</a>
|
|
||||||
<a href="{{ path('doc_version') }}" class='hover-effect {{ active('doc_version') }}'>Version</a>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
|
@ -1,52 +1,57 @@
|
||||||
<aside id='right-panel' role="region" tabindex="-1">
|
<div class="panel panel-right">
|
||||||
{% if post_form is defined %}
|
<input type="checkbox" id="panel-right-toggle">
|
||||||
<section class="section-widget" role="complementary" aria-label={{ 'Create a new note.' | trans }}>
|
<label for="panel-right-toggle">{{ icon('notes', 'icon icon-right') | raw }}</label>
|
||||||
<details class="section-title">
|
|
||||||
<summary class="section-title-menu">
|
|
||||||
{{ "Create a note" | trans }}
|
|
||||||
{{ icon('plus-circle', 'icon icon-plus') | raw }}
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
{% for tab in tabs %}
|
<aside class="panel-content">
|
||||||
<a class="section-title-menu-element" href={{ path(tab['href']) }}>{{ tab['title'] }}</a>
|
{% if post_form is defined %}
|
||||||
{% endfor %}
|
<section class="section-widget" role="complementary" aria-label={{ 'Create a new note.' | trans }}>
|
||||||
</details>
|
<details class="section-title">
|
||||||
|
<summary class="section-title-menu">
|
||||||
|
{{ "Create a note" | trans }}
|
||||||
|
{{ icon('plus-circle', 'icon icon-plus') | raw }}
|
||||||
|
</summary>
|
||||||
|
|
||||||
<div class="section-form">
|
{% for tab in tabs %}
|
||||||
{{ form_start(post_form) }}
|
<a class="section-title-menu-element" href={{ path(tab['href']) }}>{{ tab['title'] }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</details>
|
||||||
|
|
||||||
<span class="section-form-target">
|
<div class="section-form">
|
||||||
|
{{ form_start(post_form) }}
|
||||||
|
|
||||||
|
<span class="section-form-target">
|
||||||
{{ form_label(post_form.to) }}
|
{{ form_label(post_form.to) }}
|
||||||
{{ form_widget(post_form.to) }}
|
{{ form_widget(post_form.to) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{ form_row(post_form.visibility, {'attr': {'class': 'section-form-scope'}}) }}
|
{{ form_row(post_form.visibility, {'attr': {'class': 'section-form-scope'}}) }}
|
||||||
|
|
||||||
{{ form_row(post_form.content, {'attr': {'class': 'section-form-textarea'}}) }}
|
{{ form_row(post_form.content, {'attr': {'class': 'section-form-textarea'}}) }}
|
||||||
|
|
||||||
<label for="{{ post_form.attachments.vars.id }}" class="section-form-options">
|
<label for="{{ post_form.attachments.vars.id }}" class="section-form-options">
|
||||||
{{ form_widget(post_form.attachments) }}
|
{{ form_widget(post_form.attachments) }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{{ form_row(post_form.post_note, {'attr': {'class': 'section-form-send'}}) }}
|
{{ form_row(post_form.post_note, {'attr': {'class': 'section-form-send'}}) }}
|
||||||
|
|
||||||
{{ form_end(post_form) }}
|
{{ form_end(post_form) }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% set current_path = app.request.get('_route') %}
|
|
||||||
{% if right_panel_vars is defined %}
|
|
||||||
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars}) %}
|
|
||||||
<section class="section-widget">
|
|
||||||
{{ block | raw }}
|
|
||||||
</section>
|
</section>
|
||||||
{% endfor %}
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path}) %}
|
{% set current_path = app.request.get('_route') %}
|
||||||
<section class="section-widget">
|
{% if right_panel_vars is defined %}
|
||||||
{{ block | raw }}
|
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars}) %}
|
||||||
</section>
|
<section class="section-widget">
|
||||||
{% endfor %}
|
{{ block | raw }}
|
||||||
{% endif %}
|
</section>
|
||||||
</aside>
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path}) %}
|
||||||
|
<section class="section-widget">
|
||||||
|
{{ block | raw }}
|
||||||
|
</section>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</aside>
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user