JSFiddle - React, Tailwind, and code Playground
by Sergey Goryachev
HTML
<div class="navigate">
<a href="#">Первый пункт</a>
<a href="#">Второй пункт</a>
<a href="#">Третий пункт</a>
<a href="#">Четвертый пункт</a>
</div>
<div class="block block--red"></div>
<div class="block block--blue"></div>
<div class="block block--green"></div>
<div class="block block--purple"></div>
CSS
* { margin: 0; padding: 0; }
body {
font-family: Arial;
}
.navigate {
position: fixed;
left: 0;
width: 200px;
top: 50%;
transform: translateY(-50%);
background: black;
}
.navigate a {
display: block;
padding: 15px 25px;
color: #ffffff;
text-decoration: none;
text-align: right;
position: relative;
}
.navigate a:after {
content: '';
height: 2px;
background: #333333;
position: absolute;
bottom: 0;
right: 0;
width: 100%;
z-index: 1;
}
.navigate a:before {
content: '';
height: 2px;
background: #999999;
position: absolute;
bottom: 0;
right: 0;
width: 0;
z-index: 2;
transition: width 1s ease;
}
.navigate a:hover:before {
width: 100%;
}
.block {
height: 1000px;
}
.block--red {
background: red;
}
.block--blue {
background: blue;
}
.block--green {
background: green;
}
.block--purple {
background: purple;
}