From 2b700d614427ef9db6e4dbef294e314463c28d54 Mon Sep 17 00:00:00 2001 From: Mi1Col Date: Thu, 12 Dec 2024 18:45:40 +0100 Subject: [PATCH] hidden-search modification a little of change in the css style, and I have fixed a bug, when the text field was not visible you could still type, now it is not. --- hidden-search/script.js | 4 +++- hidden-search/style.css | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hidden-search/script.js b/hidden-search/script.js index e8eb0d0..4deb732 100644 --- a/hidden-search/script.js +++ b/hidden-search/script.js @@ -4,5 +4,7 @@ const input = document.querySelector('.input') btn.addEventListener('click', () => { search.classList.toggle('active') - input.focus() + if (search.classList != 'search' && 'active') { + input.focus(search) + } }) \ No newline at end of file diff --git a/hidden-search/style.css b/hidden-search/style.css index 4dadd30..7cd759c 100644 --- a/hidden-search/style.css +++ b/hidden-search/style.css @@ -27,12 +27,13 @@ body { padding: 15px; height: 50px; width: 50px; - transition: width 0.3s ease; + transition: width 0.5s ease; } .btn { background-color: #fff; border: 0; + border-radius: 0px 10px 10px 0px; cursor: pointer; font-size: 24px; position: absolute; @@ -40,7 +41,7 @@ body { left: 0; height: 50px; width: 50px; - transition: transform 0.3s ease; + transition: transform 0.5s ease; } .btn:focus,