SAE_web/styles/header.css

240 lines
4.7 KiB
CSS
Raw Normal View History

2024-05-29 16:16:49 +02:00
@font-face {
font-family: "RobotoFlex";
src: url(../assets/fonts/RobotoFlex.ttf);
font-display: swap;
}
2024-06-11 11:27:08 +02:00
body {
overflow-x: hidden;
2024-06-12 00:39:18 +02:00
display: flex;
flex-direction: column;
2024-06-11 11:27:08 +02:00
}
2024-05-28 15:40:57 +02:00
.menu-container {
opacity: 0.97;
position: relative;
display: flex;
align-items: center;
margin-bottom: 20px;
background: #26272b;
2024-05-28 15:40:57 +02:00
color: #cdcdcd;
padding-inline: 20px;
height: 92px;
2024-05-28 15:40:57 +02:00
z-index: 1;
-webkit-user-select: none;
user-select: none;
box-sizing: border-box;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
2024-05-29 16:16:49 +02:00
font-family: "RobotoFlex";
2024-05-28 15:40:57 +02:00
}
.menu-logo {
line-height: 0;
margin: 0 20px;
}
.menu-logo img {
max-height: 50px;
max-width: 100px;
flex-shrink: 0;
}
.menu-container a {
text-decoration: none;
color: #232323;
transition: color 0.3s ease;
}
.menu-container a:hover {
color: #00c6a7;
2024-05-29 16:16:49 +02:00
transition: all 0.5s ease;
text-decoration: none;
2024-05-28 15:40:57 +02:00
}
.menu-container input {
display: block;
width: 35px;
height: 25px;
margin: 0;
position: absolute;
cursor: pointer;
opacity: 0; /* hide this */
z-index: 2; /* and place it over the hamburger */
-webkit-touch-callout: none;
}
/* Burger menu */
.menu-container span {
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;
background: #cdcdcd;
border-radius: 3px;
z-index: 1;
transform-origin: 4px 0px;
transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.55s ease;
}
.menu-container span:first-child {
transform-origin: 0% 0%;
}
.menu-container span:nth-child(3) {
transform-origin: 0% 100%;
}
.menu-container input:checked ~ span {
opacity: 1;
transform: rotate(45deg) translate(3px, -1px);
background: #232323;
}
.menu-container input:checked ~ span:nth-child(4) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
.menu-container input:checked ~ span:nth-child(3) {
transform: rotate(-45deg) translate(-5px, 11px);
}
.menu ul {
list-style: none;
}
.menu li {
2024-05-29 16:16:49 +02:00
margin-top: 1rem;
font-size: 18px;
vertical-align: center;
2024-05-28 15:40:57 +02:00
}
/* mobile styles */
@media only screen and (max-width: 767px) {
.menu-container {
flex-direction: column;
align-items: flex-end;
font-family: "RobotoFlex";
2024-05-28 15:40:57 +02:00
}
.menu-logo {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.menu-logo img {
max-height: 30px;
}
.menu {
position: absolute;
box-sizing: border-box;
width: 300px;
right: -300px;
top: 0;
margin: -20px;
padding: 75px 50px 50px;
background: #cdcdcd;
-webkit-font-smoothing: antialiased;
/* to stop flickering of text in safari */
transform-origin: 0% 0%;
transform: translateX(0%);
transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
}
.menu-container input:checked ~ .menu {
transform: translateX(-100%);
}
}
/* desktop styles */
@media only screen and (min-width: 768px) {
.menu-container {
width: 100%;
}
.menu-container a {
color: #cdcdcd;
}
.menu-container input {
display: none;
}
/* Burger menu */
.menu-container span {
display: none;
}
.menu {
position: relative;
width: 100%;
display: flex;
justify-content: space-between;
}
.menu ul {
display: flex;
padding: 0;
align-items: center;
2024-05-28 15:40:57 +02:00
}
.menu li {
padding: 0 20px;
}
/* Style pour le menu principal */
.menu-container ul {
list-style-type: none;
padding: 0;
}
.menu-container li {
display: inline-block;
position: relative;
padding: 10px 15px;
}
.menu-container a {
text-decoration: none;
color: white; /* Assurez-vous que la couleur des liens est blanche */
display: block;
}
/* Styles pour le menu déroulant */
.dropdown-content {
display: none; /* Masque par défaut le contenu déroulant */
position: absolute;
background-color: #26272b; /* Même couleur que le container */
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Ombre pour le menu déroulant */
z-index: 100;
width: 220px; /* ou la largeur qui correspond le mieux à votre design */
left: 50%;
transform: translateX(-50%);
}
.dropdown-content a {
color: white;
padding: 12px 16px;
text-decoration: none;
display: block;
white-space: nowrap; /* Garde les éléments de menu sur une seule ligne */
}
.dropdown:hover .dropdown-content {
display: block; /* Affiche le sous-menu au survol */
opacity: 1;
transition: opacity 0.5s ease; /* Transition douce pour l'opacité */
}
.dropdown-content {
opacity: 0; /* Initialement transparent */
transition: opacity 0.5s ease; /* Transition pour une apparition douce */
}
.dropdown:hover .dropdown-content {
opacity: 1; /* Pleine visibilité au survol */
}
2024-05-28 15:40:57 +02:00
}