コピペOK!

Webコーディング帳

きらんと光るボタン

Button

HTML

            
<div class="btn anime-kiran">
  <span>Button</span>
</div>             
        

CSS

            
.anime-kiran {
  position: relative;
  overflow: hidden;
}
.anime-kiran::before {
    position: absolute;
    content: '';
    display: inline-block;
    top: -180px;
    left: 0;
    width: 30px;
    height: 100%;
    background-color: #fbfbfb;
    animation: anime-kiran 2.5s ease-in-out infinite;
}
@keyframes anime-kiran {
    0% { -webkit-transform: scale(0) rotate(45deg); opacity: 0; }
    80% { -webkit-transform: scale(0) rotate(45deg); opacity: 0.5; }
    81% { -webkit-transform: scale(4) rotate(45deg); opacity: 1; }
    100% { -webkit-transform: scale(50) rotate(45deg); opacity: 0; }
}
// ボタンのスタイル
.btn {
  background-color: #eb6100;
  width: 240px;
  height: 54px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto;
  box-shadow: 0px 4px 4px rgba($color: #000000, $alpha: .16);
  cursor: pointer;
  color: #fff;
}