<div class="container">
  <button class="btn-31">
    <span class="text-container">
      <span class="text">Button</span>
    </span>
  <div class="diagonal"></div>
    <div class="dot-br"></div>
    <div class="dot-bl"></div>
    <div class="dot-tr"></div>
    <div class="dot-tl"></div>
  </button>
  
</div>
html {
  font-size: 50px;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  
  background: #0f172a;
}

.dot-br {
  position: absolute;
  top: var(--progress);
  left: var(--progress);
  
  width: .3rem;
  height: .3rem;
  
  background: red;
  border-radius: 50%;
  
  transform: translate(-50%, -50%);
  
  transition: top 5s, left 5s;
 }

.dot-bl {
  position: absolute;
  top: 100%;
  left: 0;
  
  width: .3rem;
  height: .3rem;
  
  background: red;
  border-radius: 50%;
  
  transform: translate(-50%, -50%);
  
  transition: top 5s, left 5s;
 }

.dot-tr {
  position: absolute;
  top: 0;
  left: 100%;
  
  width: .3rem;
  height: .3rem;
  
  background: red;
  border-radius: 50%;
  
  transform: translate(-50%, -50%);
  
  transition: top 5s, left 5s;
 }

.dot-tl {
  position: absolute;
  top: 0;
  left: 0;
  
  width: .3rem;
  height: .3rem;
  
  background: red;
  border-radius: 50%;
  
  transform: translate(-50%, -50%);
  
  transition: top 5s, left 5s;
 }

.diagonal {
  position: absolute;
  top: -6.5%;
  left: -6.5%;
  
  width: 120%;
  height: 0;
  
  border-top: .1rem dashed red;
  
  transform-origin: top left;
  transform: rotate(20.2deg);
}

.btn-31 {
  display: block;
  box-sizing: border-box;
  padding: 1.5rem 3.5rem;

  position: relative;
  
  background: none;
  color: white;

  text-transform: uppercase;
  border: 1px solid currentColor;
  
  --progress: 100%;
  
}

.btn-31:before {
  content: "";
  z-index: -1;

  position: absolute;
  inset: 0;


  background: white;
  clip-path: polygon(
    100% 0,
    var(--progress) var(--progress),
    0 100%,
    100% 100%
  );
  transition: clip-path 5s;
}
.btn-31:hover {
  --progress: 0%;
}

.btn-31 .text-container {
  display: block;
  position: relative;
  overflow: hidden;
}
.btn-31 .text {
  display: block;
  position: relative;
  font-size: 1rem;
  font-weight: 900;
  mix-blend-mode: difference;
}
.btn-31:hover .text {
  /* animation: move-up-alternate 0.3s forwards;
  will-change: transform; */
}

@keyframes move-up-alternate {
  from {
    transform: translateY(0%);
  }
  50% {
    transform: translateY(80%);
  }
  51% {
    transform: translateY(-80%);
  }
  100% {
    transform: translateY(0%);
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.