Animated Website Navigation Bar is a commonly seen element within contemporary designs of website layouts. It also improves the usability of the website while also giving the cluttered space a more active and engaging feel. Using the right methods here, it is possible to design a good animated navbar HTML CSS that serves its purpose well. In this article, we’ll look into 3 of the most effective ways. How to develop an impressive animated navbar, particularly the hover effects a neat transition, and a splashy Colour effect navbar.
Introduction to Animated Website Navigation Bar
A Navigation Bar in an Animated Website is not just an ordinary line item on the list of components to be incorporated in a webpage—it is actually one of the most significant graphic design properties of a significant graphic design asset that defines the user experience. Regardless of whether it is a simple blog Menu navbar, an online store, or a portfolio, the navbar is the key to unlocking the rest of the remainder of the site’s content.
In this article, you will discover the 3 best practices for creating an eye-catching and highly efficient animated navigation bar. Such optimizations will enhance the recognizable footage of your Animated navbar HTML CSS as soon as you implement smooth animations, exquisite hover effects, and spectacular solutions concerning color transition as well.
Technique 1: Smooth Hover Effects for Enhanced Interactivity
Indeed one of the objectives of introducing an Animated Website Navigation Bar is to make the bar interactive. Any movement that occurs when users pass their cursor over any of the menu items should be swift, appealing, and easy to understand. Hover effects are very useful as quick feedback to the user. That the menu item is clickable and generally as a way to increase interactivity of your website.
Creating Engaging Hover Animations
CSS hover effects let the element move in varied forms like scaling, sliding, or even totally changing colors. A color effect navbar is quite a good example of what you can achieve when designing hover effects. Another minor effect can be that the color of a menu item changes. When a user hovers over the item making the transition look really good.
The trick in this case is to make sure that the coded animated navbar HTML CSS is as efficient as it can be. Many animations decrease the page load time as some animations require more complex processes on the users’ devices. Opt for simple hover effects that do not overburden the page because using too many of them will slow down. The performance besides enhancing the professional appeal of your navbar.
Implementing Hover Animation with a Subtle Shift
Using a Colour effect navbar is also another great way to grab attention without much struggle. For simplicity’s sake let’s consider a hover effect where the background color of the navbar item shifts upon hovering. This simple but powerful animation can greatly impact the overall look of your website.
Moreover, the effect in between hover states can shoot up the level of professionalism of the animated navbar HTML CSS. Most of the time when designing involves changes in color, scaling effects, or sliding transition, you can use transition properties in CSS to make the transition smooth.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap"); *, *:after, *:before { box-sizing: border-box; } body { font-family: "Inter", sans-serif; line-height: 1.5; min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: #000000; } .menu { padding: 2rem; background-color: #fff; position: relative; width: calc(130px + 4 * 70px + 4rem); display: flex; justify-content: center; border-radius: 20px 20px; box-shadow: 0 10px 25px 0 rgba(0, 0, 0, 0.075); } .link { display: inline-flex; justify-content: center; align-items: center; width: 70px; height: 50px; border-radius: 99em; position: relative; z-index: 1; overflow: hidden; transform-origin: center left; transition: width 0.2s ease-in; text-decoration: none; color: inherit; } .link:before { position: absolute; z-index: -1; content: ""; display: block; border-radius: 99em; width: 100%; height: 100%; top: 0; transform: translateX(100%); transition: transform 0.2s ease-in; transform-origin: center right; background-color: #eee; } .link:hover, .link:focus { outline: 0; width: 130px; } .link:hover:before, .link:hover .link-title, .link:focus:before, .link:focus .link-title { transform: translateX(0); opacity: 1; } .link-icon { width: 28px; height: 28px; display: block; flex-shrink: 0; left: 18px; position: absolute; } .link-icon svg { width: 28px; height: 28px; } .link-title { transform: translateX(100%); transition: transform 0.2s ease-in; transform-origin: center right; display: block; text-align: center; text-indent: 28px; width: 100%; } </style> </head> <body> <div class="menu"> <a href="#" class="link"> <span class="link-icon"> <!-- icon --> <svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="currentColor" viewBox="0 0 256 256"> <rect width="256" height="256" fill="none"></rect> <path d="M213.3815,109.61945,133.376,36.88436a8,8,0,0,0-10.76339.00036l-79.9945,72.73477A8,8,0,0,0,40,115.53855V208a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V115.53887A8,8,0,0,0,213.3815,109.61945Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path> </svg> <!-- /icon --> </span> <span class="link-title">Home</span> </a> <a href="#" class="link"> <span class="link-icon"> <!-- icon --> <svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="currentColor" viewBox="0 0 256 256"> <rect width="256" height="256" fill="none"></rect> <polyline points="76.201 132.201 152.201 40.201 216 40 215.799 103.799 123.799 179.799" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline> <line x1="100" y1="156" x2="160" y2="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line> <path d="M82.14214,197.45584,52.201,227.397a8,8,0,0,1-11.31371,0L28.603,215.11268a8,8,0,0,1,0-11.31371l29.94113-29.94112a8,8,0,0,0,0-11.31371L37.65685,141.65685a8,8,0,0,1,0-11.3137l12.6863-12.6863a8,8,0,0,1,11.3137,0l76.6863,76.6863a8,8,0,0,1,0,11.3137l-12.6863,12.6863a8,8,0,0,1-11.3137,0L93.45584,197.45584A8,8,0,0,0,82.14214,197.45584Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path> </svg> <!-- /icon --> </span> <span class="link-title">Games</span> </a> <a href="#" class="link"> <span class="link-icon"> <!-- icon --> <svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="currentColor" viewBox="0 0 256 256"> <rect width="256" height="256" fill="none"></rect> <path d="M45.42853,176.99811A95.95978,95.95978,0,1,1,79.00228,210.5717l.00023-.001L45.84594,220.044a8,8,0,0,1-9.89-9.89l9.47331-33.15657Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path> <line x1="96" y1="112" x2="160" y2="112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line> <line x1="96" y1="144" x2="160" y2="144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line> </svg> <!-- /icon --> </span> <span class="link-title">Chat</span> </a> <a href="#" class="link"> <span class="link-icon"> <!-- icon --> <svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="currentColor" viewBox="0 0 256 256"> <rect width="256" height="256" fill="none"></rect> <circle cx="116" cy="116" r="84" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></circle> <line x1="175.39356" y1="175.40039" x2="223.99414" y2="224.00098" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line> </svg> <!-- /icon --> </span> <span class="link-title">Search</span> </a> <a href="#" class="link"> <span class="link-icon"> <!-- icon --> <svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="currentColor" viewBox="0 0 256 256"> <rect width="256" height="256" fill="none"></rect> <circle cx="128" cy="96" r="64" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="16"></circle> <path d="M30.989,215.99064a112.03731,112.03731,0,0,1,194.02311.002" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path> </svg> <!-- /icon --> </span> <span class="link-title">Profile</span> </a> </div> </body> </html>
Technique 2: Incorporating Fluid Transitions for Seamless Navigation
All Animated Website Navigation Bar relies on transitions as the focal point. Applying the transition effect in a proper way can turn a simple navigation bar into an extraordinary one. For any type of navbar Colour effect navbar or a more complex movement. The transition is crucial to give your navbar an aesthetic feel besides bothering the users.
Leveraging CSS Transitions for Fluid Navigation
The transitions in designs are used in an animated navbar HTML CSS to ensure that transitions from one state to the other is smooth. For example, when a user activates a menu item, the navbar can slide in or change color, or it can bend in any way you prefer. Ideally, this smoothness enables the delivery of a smooth and enjoyable user experience to the end users.
Another easy-to-implement transition is the background color switch on a navbar item hover. However, this effect can be boosted by the addition of some easing transitions that can make the effect a more natural look or feeling. This is better than having a sudden switch between colors leading to a more appealing appearance of the device.
Dynamic Transitions for Complex Navigation Bars
In the case of the menu navbar is designed with multiple levels or depths. Where submenus have drop-down effects, then the use of transition enables users to follow along with the design. For example, sliding menus, fading effects,s or expanding dropdown effects are some of the usual ways the page’s navigation is animated. These types of transitions help to maintain interaction with the user while at the same time preserving the practicality of the navigation.
In doing this, the research identifies that shifting between fluid elements improves the usability and experience of the product by the users. The shifts should be done in a proper way so that it does not create confusion. It is necessary to avoid the transitions being created too fast or too slow because this could be recreating difficulty in the navigation.
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Animated Icon Nav</title> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=DM+Sans&display=swap'> <style> * { border: 0; box-sizing: border-box; margin: 0; padding: 0; } :root { --fg: #17181c; --primary: #0f0f0f; --primary-hover: #d80000; --secondary: #000000; --trans-dur: 0.3s; --trans-timing: cubic-bezier(0.7,0,0.3,1); font-size: calc(16px + (20 - 16) * (100vw - 320px) / (1280 - 320)); } body, nav a { color: var(--fg); transition: background-color var(--trans-dur), color var(--trans-dur); } body { background-image: linear-gradient(45deg, var(--primary), var(--secondary)); font: 1em/1.5 "DM Sans", sans-serif; height: 100vh; min-height: 24em; } .app, .card, .nav { padding: 0.75em; transition: background-color var(--trans-dur), box-shadow var(--trans-dur); width: 100%; } .app, .card { background-color: rgba(255, 255, 255, 0.1); } .app { border-radius: 0 0 1.75em 1.75em; box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; justify-content: flex-end; margin: auto; max-width: 20em; height: 22em; perspective: 20em; position: relative; top: -2em; } .cards { padding: 0 0.5em; } .card { border-radius: 1.25em; min-height: 6em; margin-bottom: 0.75em; opacity: 0; } .card--fly-out { animation: fadeInFlyOut 1s var(--trans-timing) forwards; } .card--fly-out:nth-child(1) { animation-delay: 0s; } .card--fly-out:nth-child(2) { animation-delay: 0.05s; } .icon1-1 { transform-origin: 12px 6px; } .icon3-1 { transform-origin: 12px 1px; } .icon4-3 { transform-origin: 12px 10px; } .icon5-1 { transform-origin: 12px 20px; } .nav { background-color: #e3e4e8; border-radius: 1em; box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.3); transform-origin: 50% 133%; } .nav--tilt1 { animation: tilt1 0.6s ease-in-out; } .nav--tilt2 { animation: tilt2 0.6s ease-in-out; } .nav--tilt3 { animation: tilt3 0.6s ease-in-out; } .nav--tilt4 { animation: tilt4 0.6s ease-in-out; } .nav--tilt5 { animation: tilt5 0.6s ease-in-out; } .nav__items { display: flex; justify-content: space-between; list-style: none; } .nav__item-btn { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; width: 3em; height: 3em; text-decoration: none; } .nav__item-btn:focus, .nav__item-btn:hover, .nav__item-btn[aria-describedby=current] { color: var(--primary-hover); } .nav__item-btn:focus { outline: transparent; } .nav__item-icon { display: block; margin: 0 auto; overflow: visible; width: 1.5em; height: 1.5em; transition: transform var(--trans-dur) var(--trans-timing); } .nav__item-icon g, .nav__item-icon path, .nav__item-icon rect { animation-duration: calc(var(--trans-dur) * 3); animation-timing-function: var(--trans-timing); } .nav__item-text { display: block; font-size: 0.6em; line-height: 1.25; opacity: 0; text-align: center; transition: opacity var(--trans-dur) var(--trans-timing); } .nav__item-btn:focus .nav__item-icon, .nav__item-btn:hover .nav__item-icon { transform: translateY(-0.5em); } .nav__item-btn:focus .nav__item-text, .nav__item-btn:hover .nav__item-text { animation: fadeFlyIn calc(var(--trans-dur) * 1.5) var(--trans-timing); opacity: 1; } .nav__item-btn:focus .icon1-1, .nav__item-btn:hover .icon1-1 { animation-name: icon1-1; } .nav__item-btn:focus .icon2-1, .nav__item-btn:hover .icon2-1 { animation-name: icon2-1; } .nav__item-btn:focus .icon2-2, .nav__item-btn:hover .icon2-2 { animation-name: icon2-2; } .nav__item-btn:focus .icon2-3, .nav__item-btn:hover .icon2-3 { animation-name: icon2-3; } .nav__item-btn:focus .icon2-4, .nav__item-btn:hover .icon2-4 { animation-name: icon2-4; } .nav__item-btn:focus .icon3-1, .nav__item-btn:hover .icon3-1 { animation-name: icon3-1; } .nav__item-btn:focus .icon4-1, .nav__item-btn:hover .icon4-1 { animation-name: icon4-1; } .nav__item-btn:focus .icon4-2, .nav__item-btn:hover .icon4-2 { animation-name: icon4-2; } .nav__item-btn:focus .icon4-3, .nav__item-btn:hover .icon4-3 { animation-name: icon4-3; } .nav__item-btn:focus .icon5-1, .nav__item-btn:hover .icon5-1 { animation-name: icon5-1; } /* `:focus-visible` support */ @supports selector(:focus-visible) { .nav__item-btn:focus { color: currentColor; } .nav__item-btn:focus-visible, .nav__item-btn:hover, .nav__item-btn[aria-describedby=current] { color: var(--primary-hover); } .nav__item-btn:focus .nav__item-icon { transform: translateY(0); } .nav__item-btn:focus .nav__item-text { opacity: 0; } .nav__item-btn:focus-visible .nav__item-icon, .nav__item-btn:hover .nav__item-icon { transform: translateY(-0.5em); } .nav__item-btn:focus-visible .nav__item-text, .nav__item-btn:hover .nav__item-text { opacity: 1; } } /* Dark theme */ @media (prefers-color-scheme: dark) { :root { --fg: #e3e4e8; --primary-hover: #5583f6; } .app, .card { background-color: rgba(0, 0, 0, 0.2); } .app { box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.5); } .nav { background-color: #17181c; } } /* Animations */ @keyframes fadeFlyIn { from, 33.3% { opacity: 0; transform: translateY(0.5em); } to { opacity: 1; transform: translateY(0); } } @keyframes fadeInFlyOut { from { opacity: 0; transform: translateY(0) scale(0.9); } 35% { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 1; transform: translateY(-250%) scale(1); } } @keyframes icon1-1 { from, to { transform: rotate(0); } 33% { transform: rotate(30deg); } 67% { transform: rotate(-30deg); } } @keyframes icon2-1 { from { transform: translate(0, 0); } to { transform: translate(13px, 0); } } @keyframes icon2-2 { from { transform: translate(0, 0); } to { transform: translate(0, 13px); } } @keyframes icon2-3 { from { transform: translate(0, 0); } to { transform: translate(0, -13px); } } @keyframes icon2-4 { from { transform: translate(0, 0); } to { transform: translate(-13px, 0); } } @keyframes icon3-1 { from, to { transform: rotateX(0); } 50% { transform: rotateX(-135deg); } } @keyframes icon4-1 { from, to { height: 0; transform: translateY(0); } 50% { height: 5px; transform: translateY(-2px); } } @keyframes icon4-2 { from, to { height: 16px; transform: translateY(0); } 50% { height: 15px; transform: translateY(-2px); } } @keyframes icon4-3 { from, to { transform: rotateX(0); } 50% { transform: rotateX(-130deg); } } @keyframes icon5-1 { from, to { transform: rotate(0); } 50% { transform: rotate(-30deg); } } @keyframes tilt1 { from, to { transform: rotateY(0); } 50% { transform: rotateY(-4deg); } } @keyframes tilt2 { from, to { transform: rotateX(0) rotateY(0); } 50% { transform: rotateX(-3deg) rotateY(-3deg); } } @keyframes tilt3 { from, to { transform: rotateX(0); } 50% { transform: rotateX(8deg); } } @keyframes tilt4 { from, to { transform: rotateX(0) rotateY(0); } 50% { transform: rotateX(-3deg) rotateY(3deg); } } @keyframes tilt5 { from, to { transform: rotateY(0); } 50% { transform: rotateY(4deg); } } </style> </head> <body> <!-- partial:index.partial.html --> <div class="app"> <div class="cards"> <div class="card" data-card></div> <div class="card" data-card></div> </div> <nav class="nav" data-nav> <ul class="nav__items"> <li class="nav__item"> <a href="#" class="nav__item-btn" data-nav-item="1" aria-describedby="current"> <svg class="nav__item-icon" width="24px" height="24px" viewBox="0 0 24 24"> <g class="icon1-1"> <path fill="currentColor" d="M23.1,20.4H0.8c-0.4,0-0.7-0.2-0.8-0.6s0-0.8,0.3-1l11.5-8.1c0.3-0.2,0.7-0.2,1,0l10.8,8.1 c0.3,0.2,0.4,0.6,0.3,1C23.8,20.1,23.5,20.4,23.1,20.4z M4.8,18.6h14.4c0.7,0,0.8-0.3,0.3-0.8l-6.2-4.6c-0.6-0.4-1.5-0.4-2.1,0 l-6.6,4.7C4,18.3,4.1,18.6,4.8,18.6z"/> <path d="M9.5,6c0.1-3.3,4.9-3.3,5,0C14.4,9.3,9.6,9.3,9.5,6L9.5,6z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-dasharray="11 4.7"/> </g> </svg> <span class="nav__item-text">Shop</span> </a> </li> <li class="nav__item"> <a href="#" class="nav__item-btn" data-nav-item="2"> <svg class="nav__item-icon" width="24px" height="24px" viewBox="0 0 24 24"> <g fill="none" stroke="currentColor" stroke-width="2"> <rect class="icon2-1" x="1" y="1" rx="3" ry="3" width="9" height="9" /> <rect class="icon2-2" x="14" y="1" rx="3" ry="3" width="9" height="9" /> <rect class="icon2-3" x="1" y="14" rx="3" ry="3" width="9" height="9" /> <rect class="icon2-4" x="14" y="14" rx="3" ry="3" width="9" height="9" /> </g> </svg> <span class="nav__item-text">Discover</span> </a> </li> <li class="nav__item"> <a href="#" class="nav__item-btn" data-nav-item="3"> <svg class="nav__item-icon" width="24px" height="24px" viewBox="0 0 24 24"> <g class="icon3-1" fill="currentColor"> <path d="M19.3,0H4.7C4.1,0,3.6,0.5,3.6,1.1v21.8c0,0.4,0.2,0.8,0.6,1c0.4,0.2,0.8,0.1,1.2-0.1l6.6-5.3l6.6,5.3c0.2,0.2,0.4,0.2,0.7,0.2c0.2,0,0.3,0,0.5-0.1c0.4-0.2,0.6-0.6,0.6-1V1.1C20.4,0.5,19.9,0,19.3,0z M18.2,20.6l-5.5-4.4C12.5,16.1,12.2,16,12,16s-0.5,0.1-0.7,0.2l-5.5,4.4V2.2h12.4V20.6z"/> </g> </svg> <span class="nav__item-text">Bookmark</span> </a> </li> <li class="nav__item"> <a href="#" class="nav__item-btn" data-nav-item="4"> <svg class="nav__item-icon" width="24px" height="24px" viewBox="0 0 24 24"> <g fill="none" stroke="currentColor" stroke-width="2"> <rect class="icon4-1" fill="currentColor" stroke-width="0" x="2.75" y="7.5" width="18.5" height="0"/> <rect class="icon4-2" x="2.5" y="7" rx="3" ry="3" width="19" height="16" /> <path d="M7.5,10V5.5C7.5,3,9.5,1,12,1h0c2.5,0,4.5,2,4.5,4.5V10" stroke-linecap="round"/> <path class="icon4-3" d="M7.5,10V5.5C7.5,3,9.5,1,12,1h0c2.5,0,4.5,2,4.5,4.5V10" stroke-linecap="round"/> </g> </svg> <span class="nav__item-text">Cart</span> </a> </li> <li class="nav__item"> <a href="#" class="nav__item-btn" data-nav-item="5"> <svg class="nav__item-icon" width="24px" height="24px" viewBox="0 0 24 24"> <g fill="none" stroke="currentColor" stroke-width="2"> <g class="icon5-1"> <circle cx="12" cy="6.5" r="5.5"/> </g> <path d="M3,23c0-3.4,4-6,9-6s9,2.6,9,6" stroke-linecap="round"/> </g> </svg> <span class="nav__item-text">Profile</span> </a> </li> </ul> <div id="current" hidden>Current page</div> </nav> </div> <!-- partial --> <script src="./script.js"></script> </body> </html>
Technique 3: Using Color and Visual Effects to Add Personality
The fourth and last approach in Creating a Splendid Animated Website Navigation Bar is Color and Visual Effect. A color effect navbar is not simply about selecting a color for the navbar but also is about knowing how color works with the design and how it impacts the user.
Crafting an Effective Color Effect Navbar
Colour effect navbar makes use of color or background of the navigation bar as an eye catchy point institution based on interaction. To implement this, CSS animations and JavaScript need to be used in order to create and showcase a dynamic appearance. To get the best out of a color scheme it is preferable to select one that will be compatible with other colors that are used in the creation of the website.
If a user gets in touch with your Animated navbar HTML CSS then the change of color must look meaningful. For example, a change in the shade of color while passing the cursor over the menu item makes a menu more engaging without overburdening the design.
Adding Depth with Visual Effects
To enhance the appearance of your menu navbar, it is important to use shadow effects, gradient effects, and other forms of illusions of depth that use slight variations of color. For instance, when a user moves the cursor on a menu an indication may be in the form of a soft drop shadow beneath. The highlighted item or a change in the hue of the background to a darker or lighter shade. Such types of visual effects help in enhancing the appearance of the Animated navbar HTML CSS in general.
It is aimed at the fact that the navbar cannot overshadow the content but can enrich it. Knowledge of color and effects allows you to create an attractive, but expressive navbar. Which will effectively attract the user’s attention without overloading the screen.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>LayakCoder</title> <style> html { box-sizing: border-box; --bgColorMenu : #1d1d27; --duration: .7s; } html *, html *::before, html *::after { box-sizing: inherit; } body{ margin: 0; display: flex; height: 100vh; overflow: hidden; align-items: center; justify-content: center; background-color: #ffb457; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration); } .menu{ margin: 0; display: flex; /* Works well with 100% width */ width: 32.05em; font-size: 1.5em; padding: 0 2.85em; position: relative; align-items: center; justify-content: center; background-color: var(--bgColorMenu); } .menu__item{ all: unset; flex-grow: 1; z-index: 100; display: flex; cursor: pointer; position: relative; border-radius: 50%; align-items: center; will-change: transform; justify-content: center; padding: 0.55em 0 0.85em; transition: transform var(--timeOut , var(--duration)); } .menu__item::before{ content: ""; z-index: -1; width: 4.2em; height: 4.2em; border-radius: 50%; position: absolute; transform: scale(0); transition: background-color var(--duration), transform var(--duration); } .menu__item.active { transform: translate3d(0, -.8em , 0); } .menu__item.active::before{ transform: scale(1); background-color: var(--bgColorItem); } .icon{ width: 2.6em; height: 2.6em; stroke: white; fill: transparent; stroke-width: 1pt; stroke-miterlimit: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; } .menu__item.active .icon { animation: strok 1.5s reverse; } @keyframes strok { 100% { stroke-dashoffset: 400; } } .menu__border{ left: 0; bottom: 99%; width: 10.9em; height: 2.4em; position: absolute; clip-path: url(#menu); will-change: transform; background-color: var(--bgColorMenu); transition: transform var(--timeOut , var(--duration)); } .svg-container { width: 0; height: 0; } @media screen and (max-width: 50em) { .menu{ font-size: .8em; } } </style> </head> <body> <menu class="menu"> <button class="menu__item active" style="--bgColorItem: #ff8c00;"> <svg class="icon" viewBox="0 0 24 24"> <path d="M3.8,6.6h16.4" /> <path d="M20.2,12.1H3.8" /> <path d="M3.8,17.5h16.4" /> </svg> </button> <button class="menu__item" style="--bgColorItem: #f54888;"> <svg class="icon" viewBox="0 0 24 24"> <path d="M6.7,4.8h10.7c0.3,0,0.6,0.2,0.7,0.5l2.8,7.3c0,0.1,0,0.2,0,0.3v5.6c0,0.4-0.4,0.8-0.8,0.8H3.8 C3.4,19.3,3,19,3,18.5v-5.6c0-0.1,0-0.2,0.1-0.3L6,5.3C6.1,5,6.4,4.8,6.7,4.8z" /> <path d="M3.4,12.9H8l1.6,2.8h4.9l1.5-2.8h4.6" /> </svg> </button> <button class="menu__item" style="--bgColorItem: #4343f5;"> <svg class="icon" viewBox="0 0 24 24"> <path d="M3.4,11.9l8.8,4.4l8.4-4.4" /> <path d="M3.4,16.2l8.8,4.5l8.4-4.5" /> <path d="M3.7,7.8l8.6-4.5l8,4.5l-8,4.3L3.7,7.8z" /> </button> <button class="menu__item" style="--bgColorItem: #e0b115;"> <svg class="icon" viewBox="0 0 24 24"> <path d="M5.1,3.9h13.9c0.6,0,1.2,0.5,1.2,1.2v13.9c0,0.6-0.5,1.2-1.2,1.2H5.1c-0.6,0-1.2-0.5-1.2-1.2V5.1 C3.9,4.4,4.4,3.9,5.1,3.9z" /> <path d="M4.2,9.3h15.6" /> <path d="M9.1,9.5v10.3" /> </button> <button class="menu__item" style="--bgColorItem:#65ddb7;"> <svg class="icon" viewBox="0 0 24 24"> <path d="M5.1,3.9h13.9c0.6,0,1.2,0.5,1.2,1.2v13.9c0,0.6-0.5,1.2-1.2,1.2H5.1c-0.6,0-1.2-0.5-1.2-1.2V5.1 C3.9,4.4,4.4,3.9,5.1,3.9z" /> <path d="M5.5,20l9.9-9.9l4.7,4.7" /> <path d="M10.4,8.8c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6C7.3,8,8,7.3,8.9,7.3C9.7,7.3,10.4,8,10.4,8.8z" /> </svg> </button> <div class="menu__border"></div> </menu> <div class="svg-container"> <svg viewBox="0 0 202.9 45.5"> <clipPath id="menu" clipPathUnits="objectBoundingBox" transform="scale(0.0049285362247413 0.021978021978022)"> <path d="M6.7,45.5c5.7,0.1,14.1-0.4,23.3-4c5.7-2.3,9.9-5,18.1-10.5c10.7-7.1,11.8-9.2,20.6-14.3c5-2.9,9.2-5.2,15.2-7 c7.1-2.1,13.3-2.3,17.6-2.1c4.2-0.2,10.5,0.1,17.6,2.1c6.1,1.8,10.2,4.1,15.2,7c8.8,5,9.9,7.1,20.6,14.3c8.3,5.5,12.4,8.2,18.1,10.5 c9.2,3.6,17.6,4.2,23.3,4H6.7z" /> </clipPath> </svg> </div> </body> </html>
Conclusion
In order to create this work, one has to pay attention to a large number of points. With smooth hover effects, fluid transition, and chromatically enhanced visual effects. It can be possible to design an eye-popping but highly usable navigation bar. Read: animate navbar HTML CSS or design a Color effect navbar. All these techniques would be useful for creating an impressive and worthy interactive session.
Bear in mind that for the menu navbar to be effective it should be as simple as can be. Do not use too many animations in your design or too frequent color switching between two states. This should be replaced by simplicity and improved transitions that create impressive elements. That would complement the user experience, rather than draw attention to themselves. This way, after following these top 3 techniques, you will create an organic yet beautiful. Animated Website Navigation Bar for your site to look more creative and professional.
To this end, in this article, we have looked at how hover and transition effects, color visualizations, and animations can give the HTML CSS animated navbar design a real feel. Please do not forget that all these techniques should be applied as an art. It is all about finding a balance between attractive and usable design. A good example of an example of Animated Website Navigation Bar is one that not only provides. The perfect aesthetic appeal but also one that is easy to use.
For more explanation, click on the link given below to watch the video.