<div class="button">Button</div>
<p><a>Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia nostrum placeat consequatur deserunt velit ducimus possimus commodi temporibus debitis quam, molestiae laboriosam sit repellendus sed sapiente quidem quod accusantium vero.</a></p>
html,
body {
width: 100%;
height: 100%;
display: flex;
overflow: hidden;
}
.button {
width: 120px;
height: 64px;
line-height: 64px;
text-align: center;
border: 1px solid #eee;
cursor: pointer;
transition: .3s all;
&:hover {
background: #eee;
}
}
p {
margin: 50px auto;
width: 500px;
font-size: 24px;
line-height: 1.5;
color: #666;
}
a {
background:
linear-gradient(90deg, #999, #999),
linear-gradient(90deg, #fc0, #fc0);
// background: linear-gradient(90deg, #ff3c41, #fc0, #8500d8);
background-size: 100% 100%, 0 100px;
// background-size: 100% 100%;
background-repeat: no-repeat;
background-position: 100% 100%, 0 100%;
// background-position: 100% 100%;
cursor: pointer;
color: transparent;
background-clip: text;
// line-height: 3;
// opacity: 1;
}
// a::before {
// content: "";
// position: fixed;
// background: rgba(0, 0, 0, .8);
// top: 0;
// left: 0;
// right: 0;
// bottom: 0;
// z-index: -1;
// transition: .3s all linear;
// opacity: 0;
// }
.button:hover ~ p a {
transition: .8s all linear;
background-size: 0 100px, 100% 100%;
// background-position: 0 100%, 0 100%;
// background-size: 0 100px;
// color: transparent;
// line-height: 1;
}
// .button:hover ~ p a::before {
// opacity: 1;
// }
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.