HTML:
<input type="checkbox" id="menu-toggle"/> <label id="trigger" for="menu-toggle"></label> <label id="burger" for="menu-toggle"></label> <ul id="menu"> <li class="menuLi"><a class="menuA" href="#">Activités à la ferme</a></li> <li class="menuLi"><a class="menuA" href="#">Séjour à la ferme</a></li> <li class="menuLi"><a class="menuA" href="#">Ferme équestre</a></li> <li class="menuLi"><a class="menuA" href="#">élevage chevaux</a></li> <li class="menuLi"><a class="menuA" href="#">Produits fermiers</a></li> <hr class="seperate"> <li class="menuLi"><a class="menuA" href="#">Notre Philosophie</a></li> <li class="menuLi"><a class="menuA" href="#">Notre équipe</a></li> <li class="menuLi"><a class="menuA" href="#">Accès et contact</a></li> </ul>
CSS:
@keyframes checked-anim { 50% { width: 100vw; height: 100vh; } 100% { width: 100%; height: 100%; border-radius: 0; } } @keyframes not-checked-anim { 0% { width: 100vw; height: 100vh; } } .menuLi, .menuA, .seperate { color: #3a3a3a; font: 14pt "Roboto", sans-serif; font-weight: 700; line-height: 1.8; text-decoration: none; text-transform: none; list-style: none; outline: 0; display: none; z-index: 1; animation-direction: reverse; line-height: 50px; } .menuLi { width: 400px; text-indent: 56px; z-index: 1; } .menuA:focus { display: block; color: #333; background-color: #eee; transition: all .5s; z-index: 1; } #trigger, #burger, #burger:before, #burger:after { position: absolute; top: 25px; right: 25px; background-color: var(--menu-color-hover); width: 30px; height: 5px; transition: .2s ease; cursor: pointer; z-index: 2; } #trigger { height: 25px; background: none; z-index: 2; } #burger:before { content: " "; top: 10px; left: 0; z-index: 2; } #burger:after { content: " "; top: 20px; left: 0; z-index: 2; } #menu-toggle:checked + #trigger + #burger { top: 35px; transform: rotate(360deg); transition: transform .2s ease; z-index: 2; } #menu-toggle:checked + #trigger + #burger:before { width: 20px; top: -2px; left: 18px; transform: rotate(45deg) translateX(-5px); transition: transform .2s ease; z-index: 2; } #menu-toggle:checked + #trigger + #burger:after { width: 20px; top: 2px; left: 18px; transform: rotate(-45deg) translateX(-5px); transition: transform .2s ease; z-index: 2; } #menu { position: absolute; right: 0; margin: 0; padding: 0; width: 110px; height: 110px; background-color: #fff; border-bottom-left-radius: 100%; box-shadow: 0 2px 5px rgba(0,0,0,0.26); animation: not-checked-anim .1s both; transition: .1s; z-index: 1; } #menu li:nth-child(1){ margin-top: 11vh; } #menu li:nth-child(7):before{ content: "Qui somme-nous ?"; color: var(--black); text-transform: uppercase; font-size: 25px; } #menu-toggle:checked + #trigger + #burger + #menu { animation: checked-anim 1s ease both; z-index: 1; } #menu-toggle:checked + #trigger ~ #menu > .menuLi, .menuA { display: block; z-index: 1; } #menu-toggle:checked + #trigger ~ #menu > .seperate { display: block; z-index: 1; } .seperate{ background: var(--black); width: 30%; margin-left: 7%; } [type="checkbox"]:not(:checked), [type="checkbox"]:checked { display: none; z-index: 1; }