button效果
HTML部分
<button></button>
CSS部分
button {
z-index: 1;
position: relative;
font-size: inherit;
font-family: inherit;
color: white;
padding: 0.5em 1em;
outline: none;
border: none;
background-color: hsl(236, 32%, 26%);
overflow: hidden;
transition: color 0.4s ease-in-out;
}
button::before {
content: '';
z-index: -1;
position: absolute;
top: 100%;
right: 100%;
width: 1em;
height: 1em;
border-radius: 50%;
background-color: #3cefff;
transform-origin: center;
transform: translate3d(50%, -50%, 0) scale3d(0, 0, 0);
transition: transform 0.45s ease-in-out;
}
button:hover {
cursor: pointer;
color: #161616;
}
button:hover::before {
transform: translate3d(50%, -50%, 0) scale3d(15, 15, 15);
}
input的交互效果
HTML部分
<div>
<input type="text" placeholder="Input Outline">
<span class="bottom"></span>
<span class="right"></span>
<span class="top"></span>
<span class="left"></span>
</div>
CSS部分
div {
position: relative;
}
input {
width: 6.5em;
color: white;
font-size: inherit;
font-family: inherit;
background-color: hsl(236,