跳至主要內容

按钮模版:btn-dark-1

望间模板按钮小于 1 分钟

<div class="container">
  <button class="btn-dark-1">
    <span></span> <span></span> <span></span> <span></span> View Room
  </button>
</div>
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  width: 100%;
  height: 200px;
}

@keyframes toTop {
  0% {
    bottom: -100%;
  }
  50%,
  100% {
    bottom: 100%;
  }
}
@keyframes toBottom {
  0% {
    top: -100%;
  }
  50%,
  100% {
    top: 100%;
  }
}
@keyframes toLeft {
  0% {
    right: -100%;
  }
  50%,
  100% {
    right: 100%;
  }
}
@keyframes toRight {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}
.btn-dark-1 {
  position: relative;
  padding: 16px 28px;
  color: #03e9f4;
  background: transparent;
  overflow: hidden;
  transition: 0.5s;
  border: none;
  cursor: pointer;
}
.btn-dark-1:hover {
  background: #03e9f4;
  color: #000;
  box-shadow: 0 0 5px #03e9f4, 0 0 25px #03e9f4, 0 0 50px #03e9f4, 0 0 200px
      #03e9f4;
}
.btn-dark-1 span {
  position: absolute;
  display: block;
}
.btn-dark-1 span:nth-child(1) {
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #03e9f4);
  animation: toRight 1s linear infinite;
}
.btn-dark-1 span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #03e9f4);
  animation: toBottom 1s linear infinite;
  animation-delay: 0.25s;
}
.btn-dark-1 span:nth-child(3) {
  bottom: 0;
  right: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #03e9f4);
  animation: toLeft 1s linear infinite;
  animation-delay: 0.5s;
}
.btn-dark-1 span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #03e9f4);
  animation: toTop 1s linear infinite;
  animation-delay: 0.75s;
}
上次编辑于:
贡献者: ViewRoom