diff --git a/hidden-search/script.js b/hidden-search/script.js index e8eb0d05..4deb732f 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 4dadd304..7cd759ce 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,