Awesome Search Button with Input Animation

Developer
Size
3,633 Kb
Views
8,096

How do I make an awesome search button with input animation?

What is a awesome search button with input animation? How do you make a awesome search button with input animation? This script and codes were developed by EY-Intuitive on 17 January 2023, Tuesday.

Awesome Search Button with Input Animation Previews

Awesome Search Button with Input Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Awesome Search Button with Input Animation</title> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { box-sizing: border-box;
}
*,
body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300;
}
.wrapper { text-align: center; margin: 100px auto;
}
.icon-search-container { display: inline-block; border: 2px solid #d9d9d9; border-radius: 50px; height: 50px; width: 50px; position: relative; transition: width 0.2s ease-out; backface-visibility: hidden;
}
.icon-search-container.active { width: 285px;
}
.icon-search-container.active .fa-times-circle { opacity: 1;
}
.icon-search-container.active .search-input { width: 200px;
}
.icon-search-container .fa-search { color: #2980b9; font-size: 30px; position: absolute; top: 7px; left: 8px; cursor: pointer;
}
.icon-search-container .fa-times-circle { opacity: 0; color: #d9d9d9; font-size: 20px; position: absolute; top: 12px; right: 8px; transition: opacity 0.2s ease-out; cursor: pointer;
}
.icon-search-container .search-input { position: absolute; cursor: default; left: 45px; top: 6px; width: 0; padding: 5px; border: none; outline: none; font-size: 18px; line-height: 20px; background-color: rgba(255, 255, 255, 0); transition: width 0.2s ease-out;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="wrapper"> <div class="icon-search-container" data-ic-class="search-trigger"> <span class="fa fa-search"></span> <input type="text" class="search-input" data-ic-class="search-input" placeholder="Search"/> <span class="fa fa-times-circle" data-ic-class="search-clear"></span> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Awesome Search Button with Input Animation - Script Codes CSS Codes

* { box-sizing: border-box;
}
*,
body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300;
}
.wrapper { text-align: center; margin: 100px auto;
}
.icon-search-container { display: inline-block; border: 2px solid #d9d9d9; border-radius: 50px; height: 50px; width: 50px; position: relative; transition: width 0.2s ease-out; backface-visibility: hidden;
}
.icon-search-container.active { width: 285px;
}
.icon-search-container.active .fa-times-circle { opacity: 1;
}
.icon-search-container.active .search-input { width: 200px;
}
.icon-search-container .fa-search { color: #2980b9; font-size: 30px; position: absolute; top: 7px; left: 8px; cursor: pointer;
}
.icon-search-container .fa-times-circle { opacity: 0; color: #d9d9d9; font-size: 20px; position: absolute; top: 12px; right: 8px; transition: opacity 0.2s ease-out; cursor: pointer;
}
.icon-search-container .search-input { position: absolute; cursor: default; left: 45px; top: 6px; width: 0; padding: 5px; border: none; outline: none; font-size: 18px; line-height: 20px; background-color: rgba(255, 255, 255, 0); transition: width 0.2s ease-out;
}

Awesome Search Button with Input Animation - Script Codes JS Codes

$(document).ready(function(){ var $searchTrigger = $('[data-ic-class="search-trigger"]'), $searchInput = $('[data-ic-class="search-input"]'), $searchClear = $('[data-ic-class="search-clear"]'); $searchTrigger.click(function(){ var $this = $('[data-ic-class="search-trigger"]'); $this.addClass('active'); $searchInput.focus(); }); $searchInput.blur(function(){ if($searchInput.val().length > 0){ return false; } else { $searchTrigger.removeClass('active'); } }); $searchClear.click(function(){ $searchInput.val(''); }); $searchInput.focus(function(){ $searchTrigger.addClass('active'); });
});
Awesome Search Button with Input Animation - Script Codes
Awesome Search Button with Input Animation - Script Codes
Home Page Home
Developer EY-Intuitive
Username ey_intuitive
Uploaded January 17, 2023
Rating 4.5
Size 3,633 Kb
Views 8,096
Do you need developer help for Awesome Search Button with Input Animation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

EY-Intuitive (ey_intuitive) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!