Animated Search Icon
How do I make an animated search icon?
An animated icon that transforms from a magnifying glass to an X. What is a animated search icon? How do you make a animated search icon? This script and codes were developed by Kevin Haag on 29 November 2022, Tuesday.
Animated Search Icon - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated Search Icon</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="center"> <div class="mag-glass"></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>
Animated Search Icon - Script Codes CSS Codes
/* Just for Pen Layout */
body { width: 100%; height: 100%; background: #4f465a;
}
#center{ width:24px; height:24px; display:block; margin:-12px 0 0 -12px;; position:absolute; top:50%; left:50%;
}
/* Pen Code */
.mag-glass { width: 24px; height: 24px; display: block; position: relative; border-radius: 50%; border: 4px solid #fff;
}
.mag-glass:hover { cursor: pointer;
}
.mag-glass::before,
.mag-glass::after { content: ''; display: block; position: absolute; border-radius: 3px; background: #fff; -webkit-transition: all 0.15s cubic-bezier(1,0,0,1); -moz-transition: all 0.15s cubic-bezier(1,0,0,1); transition: all 0.15s cubic-bezier(1,0,0,1);
}
.mag-glass::before { width: 16px; height: 3px; -ms-transform: rotate(45deg); -webkit-transform: rotate(45deg); transform: rotate(45deg); top: 24px; left: 18px; opacity: 0;
}
.mag-glass.active::before { top: 11px; left: 4px; opacity: 0.5;
}
.mag-glass::after { width: 20px; height: 6px; -ms-transform: rotate(45deg); -webkit-transform: rotate(45deg); transform: rotate(45deg); top: 24px; left: 18px;
}
.mag-glass.active::after { width: 16px; height: 3px; -ms-transform: rotate(135deg); -webkit-transform: rotate(135deg); transform: rotate(135deg); top: 11px; left: 4px; opacity:0.5;
}
.mag-glass.active:hover::before,
.mag-glass.active:hover::after{ opacity:1;
}
Animated Search Icon - Script Codes JS Codes
$(document).ready(function() { $('.mag-glass').click(function() { $(this).toggleClass('active'); return false; });
});
Developer | Kevin Haag |
Username | khaag |
Uploaded | November 29, 2022 |
Rating | 3 |
Size | 2,092 Kb |
Views | 12,144 |
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!
Name | Size |
Scroll Icon | 1,988 Kb |
Modal Popup Window | 2,433 Kb |
Youtube Layout | 3,027 Kb |
A Pen by Kevin Haag | 4,352 Kb |
Hostwise Nav Bar | 3,207 Kb |
Hamburger Icon Toggle | 2,073 Kb |
SVG Fuel Gauge | 2,758 Kb |
Vertical Centering | 1,487 Kb |
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!
Name | Username | Size |
Bootstrap example | Ssaakkaa | 2,716 Kb |
Jochaho Skeleton | Dhanushbadge | 1,689 Kb |
Ball Physics | Getsetbro | 3,149 Kb |
Testimonial Fancy tabs responsive | Amit-webdesigner | 3,056 Kb |
Portfolio page | Bhavya_j | 2,804 Kb |
This in constructor context | _shree33 | 1,718 Kb |
Mesmerizing octopus | Jllodra | 3,549 Kb |
About Us | Francescaedits | 1,902 Kb |
Importable Clearfix | Corysimmons | 1,411 Kb |
Comparison of Roboto Draft vs Roboto | Jxnblk | 2,880 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!