NavBar
https://youtube.com/shorts/BTzD28YcHFs?si=0IF-17VHNHyjeYSx |
HTML CODE:-
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title></title> </head> <body> <div class="container"> <input type="radio" name="tabsMenu" id="tab1"> <input type="radio" name="tabsMenu" id="tab2"> <input type="radio" name="tabsMenu" id="tab3"> <input type="radio" name="tabsMenu" id="tab4"> <input type="radio" name="tabsMenu" id="tab5"> <div class="menu"> <label for="tab1"><i class="fa-solid fa-house"></i></label> <label for="tab2"><i class="fa-solid fa-user"></i></label> <label for="tab3"><i class="fa-solid fa-heart"></i></label> <label for="tab4"><i class="fa-solid fa-gear"></i></label> <label for="tab5"><i class="fa-solid fa-bell"></i></label> <div class="meta"></div> </div> </div> </body> </html> |
CSS CODE:-
body{ padding: 0px; margin: 0px; display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: black; } input{ visibility: hidden; display: none; } .menu{ position: relative; display: flex; gap: 70px; padding: 23px 35px; background-color: rgba(30, 39, 39, 0.5); border-radius: 20px; overflow: hidden; } i{ font-size: 25px; } label{ width: 20%; opacity: 0.3; color: white; cursor: pointer; transition: 0.5s; } label:hover{ opacity: 1; filter: drop-shadow(0 0 10px white) drop-shadow(0 0 20px white); } .container input:nth-child(1):checked ~ .menu label:nth-child(1), .container input:nth-child(2):checked ~ .menu label:nth-child(2), .container input:nth-child(3):checked ~ .menu label:nth-child(3), .container input:nth-child(4):checked ~ .menu label:nth-child(4), .container input:nth-child(5):checked ~ .menu label:nth-child(5){ color: white; opacity: 1; filter: drop-shadow(0 0 10px white) drop-shadow(0 0 20px white); } .meta{ position: absolute; left: 0; bottom: 0; width: 20%; height: 5px; transition: 0.5s; } .meta::before{ content: ""; position: absolute; left: 50%; transform: translateX(-50%); width: 40px; height: 100%; background-color: white; border-radius: 4px; filter: drop-shadow(0 0 10px white) drop-shadow(0 0 20px white) drop-shadow(0 0 30px white); } .container input:nth-child(1):checked ~ .menu .meta{ left: 0; } .container input:nth-child(2):checked ~ .menu .meta{ left: 20%; } .container input:nth-child(3):checked ~ .menu .meta{ left: 40%; } .container input:nth-child(4):checked ~ .menu .meta{ left: 60%; } .container input:nth-child(5):checked ~ .menu .meta{ left: 80%; } |