<button class="cp_button13">button</button>
.cp_button13 {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 160px;
padding: 1em;
cursor: pointer;
color: #2e7d32;
background: #d4e157;
border: 0;
border-radius: 0;
transition: transform 0.3s;
z-index: 1;
}
.cp_button13:before {
position: absolute;
top: 100%;
left: 5%;
content: '';
width: 90%;
height: 10px;
transition:transform 0.3s,opacity 0.3s;
background: radial-gradient(ellipse at center, rgba(46,125,50, 0.35) 0%, rgba(46,125,50, 0) 80%);
opacity: 0;
z-index: -1;
}
.cp_button13:hover {
transform: translateY(-6px);
animation: button13 1.5s linear infinite alternate 0.3s;
color: #2e7d32;
}
.cp_button13:hover:before {
transform: translateY(6px);
animation: button13_shadow 1.5s linear infinite alternate 0.3s;
opacity: 0.4;
}
/*アニメーションの設定*/
@keyframes button13 {
50% { transform: translateY(-3px);}
100% { transform: translateY(-6px);}
}
@keyframes button13_shadow {
0% { transform: translateY(6px); opacity: 0.4;}
50% { transform: translateY(3px); opacity: 1;}
100% { transform: translateY(6px); opacity: 0.4;}
}