效果演示

Code
<div class="navbar">
<input type="checkbox">
<span></span>
<span></span>
<ul>
<li><a href="#">点赞</a></li>
<li><a href="#">关注</a></li>
<li><a href="#">收藏</a></li>
<li><a href="#">评论</a></li>
<li><a href="#">分享</a></li>
</ul>
</div>
* {
margin: 0;
padding: 0;
}
body {
height: 100vh;
background: linear-gradient(200deg, #888, #888);
}
body,
.navbar,
.navbar ul {
display: flex;
justify-content: center;
align-items: center;
}
.navbar {
position: relative;
padding: 20px;
background-color: #fff;
border-radius: 50px;
}
.navbar input {
width: 40px;
height: 40px;
opacity: 0;
cursor: pointer;
}
.navbar ul {
width: 0;
overflow: hidden;
transition: all 0.5s;
white-space: nowrap;
}
.navbar ul li {
list-style: none;
margin: 0px 15px;
}
.navbar ul li a {
text-decoration: none;
font-size: 20px;
font-weight: 700;
color: #333;
}
.navbar ul li a:hover {
color: #fb7299;
}
.navbar span {
position: absolute;
left: 25px;
width: 30px;
height: 4px;
top: calc(50% - 10px);
border-radius: 15px;
background-color: #999;
pointer-events: none;
transition: transform 0.3s ease-in-out, top 0.3s ease-in-out 0.3s;
}
.navbar span:nth-child(3) {
top: calc(50% + 6px);
}
.navbar input:checked~ul {
width: 350px;
}
.navbar input:checked~span:nth-child(2) {
top: calc(50% - 2px);
transform: rotate(-45deg);
background-color: #fb7299;
transition: top 0.3s ease-in-out, transform 0.3s ease-in-out 0.3s;
}
.navbar input:checked~span:nth-child(3) {
top: calc(50% - 2px);
transform: rotate(45deg);
background-color: #fb7299;
transition: top 0.3s ease-in-out, transform 0.3s ease-in-out 0.3s;
}