hamburger menu and header fixes
This commit is contained in:
parent
90af5d373f
commit
1be342d518
2 changed files with 74 additions and 3 deletions
|
@ -97,12 +97,16 @@ header {
|
||||||
grid-area: space-text;
|
grid-area: space-text;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
vertical-align: bottom;
|
|
||||||
margin-top: auto;
|
|
||||||
}
|
}
|
||||||
#space-image-container {
|
#space-image-container {
|
||||||
grid-area: space-image;
|
grid-area: space-image;
|
||||||
}
|
}
|
||||||
|
#menu-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#menu-checkbox {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (width > 1700px) {
|
@media screen and (width > 1700px) {
|
||||||
|
@ -122,7 +126,7 @@ header {
|
||||||
|
|
||||||
header {
|
header {
|
||||||
grid-template:
|
grid-template:
|
||||||
"logo logo" minmax(3cm, 10vh)
|
"logo hamburger-menu" minmax(3cm, 10vh)
|
||||||
"nav nav"
|
"nav nav"
|
||||||
"space-text space-image" min-content /
|
"space-text space-image" min-content /
|
||||||
auto min-content;
|
auto min-content;
|
||||||
|
@ -133,6 +137,69 @@ header {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
transition: max-height 0.2s cubic-bezier(0.86, 0, 0.07, 1),
|
||||||
|
margin 0.2s cubic-bezier(0.86, 0, 0.07, 1);
|
||||||
|
overflow-y: hidden;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hamburger menu */
|
||||||
|
#menu-checkbox:not(:checked) ~ nav {
|
||||||
|
max-height: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
#menu-checkbox:checked ~ nav {
|
||||||
|
max-height: 40vh;
|
||||||
|
}
|
||||||
|
#menu-label {
|
||||||
|
grid-area: hamburger-menu;
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
height: 1.2em;
|
||||||
|
width: 2em;
|
||||||
|
}
|
||||||
|
#menu-button {
|
||||||
|
display: block !important;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
|
||||||
|
&,
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
display: block;
|
||||||
|
background-color: var(--main-text-color);
|
||||||
|
position: absolute;
|
||||||
|
height: 0.2em;
|
||||||
|
width: 2em;
|
||||||
|
transition: all 200ms ease-in-out;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
margin-top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#menu-checkbox:checked + #menu-label #menu-button {
|
||||||
|
background: transparent;
|
||||||
|
&::before {
|
||||||
|
margin-top: 0;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
margin-top: 0;
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip to content element, lots of positioning styles copied from html5-boilerplate */
|
/* skip to content element, lots of positioning styles copied from html5-boilerplate */
|
||||||
|
|
|
@ -61,6 +61,10 @@ truncate(length=150) %} {% else %} {% set description = "" %} {% endif %}
|
||||||
src="{{ get_url(path='logo.svg', trailing_slash=false) }}"
|
src="{{ get_url(path='logo.svg', trailing_slash=false) }}"
|
||||||
alt="Chaostreff Backnang Logo"
|
alt="Chaostreff Backnang Logo"
|
||||||
/></a>
|
/></a>
|
||||||
|
<input type="checkbox" id="menu-checkbox" name="menu-checkbox" />
|
||||||
|
<label id="menu-label" for="menu-checkbox"
|
||||||
|
><div id="menu-button"></div
|
||||||
|
></label>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="{{ get_url(path='/#termine') }}">Termine</a>
|
<a href="{{ get_url(path='/#termine') }}">Termine</a>
|
||||||
<a href="{{ get_url(path='/#kontakt') }}">Kontakt</a>
|
<a href="{{ get_url(path='/#kontakt') }}">Kontakt</a>
|
||||||
|
|
Loading…
Add table
Reference in a new issue