Crea un effeetto modern fluid alla barra downBar quando si distacca dallo schhermo…
- User
Crea un effeetto modern fluid alla barra downBar quando si distacca dallo schhermo (Ovverro quando il marrginBottom diveenta -5px)
#inputBar{ width: 200px; padding: 7px; border-radius: 20px; background-color: #111; outline: none; color: white; border: none; z-index: 5; }
#downBar { position: fixed; bottom: -5px; left: 50%; transform: translateX(-50%); padding: 15px; border-radius: 30px; background-color: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); box-shadow: 0 0 5px 1px #000; width: 250px; z-index: 5; transition: 200ms ease-out; }
document.addEventListener("DOMContentLoaded", function() { const input = document.querySelector("#inputBar"); const bar = document.querySelector("#downBar"); const gridItems = document.querySelectorAll(".card-container"); const neonLight = document.querySelector(".neon-light-down");
input.addEventListener("input", function() { const searchTerm = input.value.trim().toLowerCase(); gridItems.forEach(function(container) { const cards = container.querySelectorAll(".card"); cards.forEach(function(card) { const itemName = card.querySelector("h3").textContent.toLowerCase(); if (itemName.includes(searchTerm)) { container.style.display = "flex"; card.style.display = "block"; } else { card.style.display = "none"; } }); }); }); bar.addEventListener("mouseenter", function() { neonLight.style.opacity = "1"; }); input.addEventListener("focus", function() { bar.style.marginBottom = "30px"; neonLight.style.opacity = "1"; }); input.addEventListener("focusout", function() { bar.style.marginBottom = "-5px"; neonLight.style.opacity = "0"; }); bar.addEventListener("mouseleave", function() { neonLight.style.opacity = "0"; });});
- Assistant