In this code, although I applied,
nav.classList.toggle("blur-0");
list.classList.toggle("blur-none");
but the Navbar and the Navbar Menu get blurred.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./output.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Document</title>
</head>
<body>
<nav class="flex bg-green-600 w-screen h-[40px] max-md:h-[65px] sticky top-0">
<div class="max-md:ml-[15px] font-bold w-[5%] h-[75%] p-[2px] m-[7px] flex justify-center items-center">Logo</div>
<div class="font-bold p-[2px] h-[75%] m-[7px] w-[35%] flex justify-center items-center max-sm:w-[20%] max-md:mx-auto">Title</div>
<div class="bg-green-600 flex md:space-x-10 max-md:space-y-5 justify-end items-center w-[60%] max-md:w-screen max-md:flex-col max-md:absolute max-md:top-[-170%] duration-500" id="list">
<div class="font-bold">Services</div>
<div class="font-bold">About</div>
<div class="font-bold">Contact Us</div>
</div>
<div class="hidden max-md:flex justify-center items-center mr-[2%] w-[6%] h-[75%] p-[6px] m-[7px] cursor-pointer rounded-full hover:bg-green-700 duration-500 max-sm:w-[11%]">
<i class="fa fa-bars" id="icon"></i>
</div>
</nav>
<div class="h-[2000px] flex justify-center items-start bg-black w-screen">Helo</div>
<div class="w-screen h-[50px] bg-cyan-500 sticky top-0">hwlooo</div>
<div class="h-[2000px]">Helo</div>
<script>
const x = document.getElementById("icon");
const list = document.getElementById("list");
const nav = document.querySelector("nav");
x.onclick = (e)=>{
e.target.classList.value = (e.target.classList.value == "fa fa-bars") ? "fa fa-close" : "fa fa-bars";
list.classList.toggle("max-md:top-[99%]");
nav.classList.toggle("blur-0");
list.classList.toggle("blur-none");
document.body.classList.toggle("blur");
}
</script>
</body>
</html>
I also tried with some custom CSS, like I added two classes and applied the backdrop filter with 0 and blur(10px) and toggled those classes in body and navbar and navbar menu also, but nothing is working.