#0102001
タップでプレビュー
<button class="c-hovRipples">
<span>Hover</span>
</button>
.c-hovRipples {
display: block;
text-align: center;
width: 64px;
aspect-ratio: 1/1;
background-color: #fff;
border-radius: 50%;
position: relative;
transition: 0.3s;
}
.c-hovRipples::after {
content: "";
width: 100%;
height: 100%;
display: block;
border: #fff 1px solid;
border-radius: 50%;
position: absolute;
place-self: center;
inset: 0;
opacity: 0;
}
.c-hovRipples span {
color: #000;
}
.c-hovRipples:hover {
box-shadow: rgba(204, 204, 204, 0.8) 0 0 10px;
}
.c-hovRipples:hover::after {
animation: ripple-animation 3s ease-out infinite;
}
@keyframes ripple-animation {
0% {
transform: scale(1);
opacity: 1;
}
30% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(2);
opacity: 0;
}
}
.c {
&-hovRipples {
display: block;
text-align: center;
width: 64px;
aspect-ratio: 1/1;
background-color: #fff;
border-radius: 50%;
position: relative;
transition: 0.3s;
&::after {
content: "";
width: 100%;
height: 100%;
display: block;
border: #fff 1px solid;
border-radius: 50%;
position: absolute;
place-self: center;
inset: 0;
opacity: 0;
}
span {
color: #000;
}
&:hover {
box-shadow: rgba($color: #ccc, $alpha: 0.8) 0 0 10px;
&::after {
animation: ripple-animation 3s ease-out infinite;
}
}
}
}
@keyframes ripple-animation {
0% {
transform: scale(1);
opacity: 1;
}
30% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(2);
opacity: 0;
}
}