Back
Button
1 2<button class="button">3 hover me4 <span></span><span></span><span></span><span></span>5</button>
1 2.button { 3 cursor: pointer; 4 --c: #0ea5e9; 5 padding: 12px 28px; 6 margin: 1em; 7 position: relative; 8 min-width: 12em; 9 background: transparent;10 font-size: 12px;11 font-weight: bold;12 color: var(--c);13 text-align: center;14 text-transform: uppercase;15 font-family: sans-serif;16 letter-spacing: 0.1em;17 border: 2px solid var(--c);18 border-radius: 8px;19 overflow: hidden;20 z-index: 1;21 transition: 0.5s;22}23 24.button span {25 position: absolute;26 width: 25%;27 height: 100%;28 background-color: var(--c);29 transform: translateY(150%);30 border-radius: 50%;31 left: calc((var(--n) - 1) * 25%);32 transition: 0.5s;33 transition-delay: calc((var(--n) - 1) * 0.1s);34 z-index: -1;35}36 37.button:hover {38 color: black;39}40 41.button:hover span {42 transform: translateY(0) scale(2);43}44 45.button span:nth-child(1) {46 --n: 1;47}48 49.button span:nth-child(2) {50 --n: 2;51}52 53.button span:nth-child(3) {54 --n: 3;55}56 57.button span:nth-child(4) {58 --n: 4;59}
MIT License