guichet/static/css/lesgv/burger.css

235 lines
4.3 KiB
CSS
Raw Normal View History

2023-07-21 13:40:14 +00:00
#menuToggle
{
display: block;
position: absolute;
/* top: 50px;
left: 50px; */
float: left;
top: 1rem;
left: 1rem;
z-index: 600;
-webkit-user-select: none;
user-select: none;
width: 100%;
}
#menuToggle a
{
text-decoration: none;
color: var(--color-link);
transition: color 0.3s ease;
}
#menuToggle a:hover
{
color: var(--color-link-hover);
}
#menu ul.submenu {
display: none;
position: absolute;
z-index: 50;
float: left;
background: var(--color-background);
list-style-type: none;
padding-right: 1rem;
padding-left: 1rem;
padding-top: 1rem;
border-radius: 0 0 1rem 1rem;
}
#menu ul.submenu li {
text-align: left;
}
#menu li:hover ul.submenu {
display: block;
}
#menuToggle input
{
display: block;
width: 40px;
height: 32px;
position: absolute;
/* top: -7px;
left: -5px; */
right: 3rem;
top: 1.25rem;
cursor: pointer;
opacity: 0; /* hide this */
z-index: 800; /* and place it over the hamburger */
-webkit-touch-callout: none;
}
#menuToggle div.burger {
float: right;
margin-right: 3rem;
}
/*
* Just a quick hamburger
*/
#menuToggle div.burger span
{
display: block;
width: 2rem;
height: 0.25rem;
margin-bottom: 0.25rem;
position: relative;
background: var(--color-text);
border-radius: 0.2rem;
z-index: 1;
/* transform-origin: -4px 0px; */
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0), background 0.5s cubic-bezier(0.77,0.2,0.05,1.0), opacity 0.55s ease;
right: 1rem;
top: 1rem;
/* display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background: var(--color-text);
border-radius: 3px;
z-index: 1;
transform-origin: 4px 0px;
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
opacity 0.55s ease; */
}
#menuToggle div.burger span:first-child
{
transform-origin: 0% 0%;
}
#menuToggle div.burger span:nth-last-child(2)
{
transform-origin: 0% 100%;
}
/*
* Transform all the slices of hamburger
* into a crossmark.
*/
#menuToggle input:checked ~ div.burger span
{
opacity: 1;
transform: rotate(-45deg) translate(-0.05rem, -0.1rem);
background: var(--color-secondary);
}
/* body.darkmode #menuToggle input:checked ~ span {
background: var(--color-secondary-dark);
} */
/*
* But let's hide the middle one.
*/
#menuToggle input:checked ~ div.burger span:nth-last-child(3)
{
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
/*
* Ohyeah and the last one should go the other direction
*/
#menuToggle input:checked ~ div.burger span:nth-last-child(2)
{
transform: rotate(45deg) translate(-0.1rem, -0.2rem);
}
/*
* Make this absolute positioned
* at the top left of the screen
*/
#menu
{
/* position: absolute; */
justify-content: space-between;
visibility: hidden;
/* width: 300px;
margin: -100px 0 0 -50px;
padding: 50px;
padding-top: 125px; */
margin: 0.5rem 1rem 0 1rem;
background: var(--color-background);
opacity: 0.9;
border: 1px solid;
border-radius: 1em;
list-style-type: none;
-webkit-font-smoothing: antialiased;
/* to stop flickering of text in safari */
/* transform-origin: 0% 0%;
transform: translate(-120%, 0); */
transform: visibility 1s linear;
transition-property: visibility;
/* transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0); */
padding-left: 0;
padding: 1rem;
/* left: 3rem; */
visibility: hidden;
opacity: 0;
top: -1rem;
display: flex;
/* grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; */
column-gap: 1rem;
flex-wrap: wrap;
}
#menu li
{
padding: 0 0 0.5rem 0;
font-size-adjust: 130%;
text-align: center;
}
/*
* And let's slide it in from the left
*/
#menuToggle input:checked ~ ul
{
visibility: visible;
opacity: 0.9;
transition: visibility 0s linear 0s, opacity 300ms;
}
@media (max-width: 1200px) {
#menu
{
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
}
}
@media (max-width: 800px) {
#menu
{
grid-template-columns: 1fr 1fr 1fr;
}
}
@media (max-width: 600px) {
#menu
{
grid-template-columns: 1fr;
}
}