Tue Sep 13 2022
Vertical Menu with Filling Effect
CSS3088 views
File Name: index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vertical Menu with Filling Effect</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
font-family: 'Montserrat', sans-serif;
}
body {
background-color: #383838;
}
:root {
--blue: #4185f3;
--yellow: #f1b504;
--red: #e44134;
--green: #32a250;
--purple: #8F3FAF;
--gray: #2b2b2b;
--white: #fff;
--transWhite: rgba(255,255,255, 0.1);
}
section#mainArea {
width: 100%;
height: 100vh;
display: flex;
justify-content: space-between;
gap: 5px;
}
section#mainArea nav {
width: 250px;
}
ul#menuList {
list-style: none;
}
ul#menuList li {
margin: 8px 0;
position: relative;
background-color: var(--gray);
border-radius: 2px;
overflow: hidden;
}
ul#menuList li::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 5px;
transition: 0.3s all ease-in-out;
}
ul#menuList li:nth-child(-n+5)::before {
left: 0;
}
ul#menuList li:nth-child(n+6)::before {
right: 0;
}
ul#menuList li:nth-child(1)::before,
ul#menuList li:nth-child(6)::before {
background-color: var(--blue);
}
ul#menuList li:nth-child(2)::before,
ul#menuList li:nth-child(7)::before {
background-color: var(--yellow);
}
ul#menuList li:nth-child(3)::before,
ul#menuList li:nth-child(8)::before {
background-color: var(--red);
}
ul#menuList li:nth-child(4)::before,
ul#menuList li:nth-child(9)::before {
background-color: var(--green);
}
ul#menuList li:nth-child(5)::before,
ul#menuList li:nth-child(10)::before {
background-color: var(--purple);
}
ul#menuList li:hover:nth-child(-n+5)::before {
border-radius: 0 50px 50px 0;
width: 110%;
}
ul#menuList li:hover:nth-child(n+6)::before {
border-radius: 50px 0 0 50px;
width: 110%;
}
ul#menuList li a {
display: block;
padding: 12px 20px;
color: var(--white);
text-decoration: none;
font-size: 16px;
font-weight: 500;
position: relative;
z-index: 1;
}
section#contentArea {
background-color: var(--transWhite);
width: calc(100% - 250px);
}
</style>
</head>
<body>
<section id="mainArea">
<nav>
<ul id="menuList">
<li><a href="">Dashboard</a></li>
<li><a href="">Product</a></li>
<li><a href="">Order List</a></li>
<li><a href="">Analytics</a></li>
<li><a href="">Stock</a></li>
<li><a href="">Total Order</a></li>
<li><a href="">Team</a></li>
<li><a href="">Messages</a></li>
<li><a href="">Favorites</a></li>
<li><a href="">Settings</a></li>
</ul>
</nav>
<section id="contentArea">
</section>
</section>
</body>
</html>
Result Screenshot(s)
Reference:
Author:Geekboots