<h3>Hover the box</h3>
<div class="box"></div>
.box {
  --b: 20px;
  
  width: 200px;
  aspect-ratio: 1;
  margin:auto;
  border: 1px solid;
  position: relative;
}
.box:before {
  content:"";
  position:absolute;
  width:200%;
  right:0;
  top:0;
  bottom:0;
  background: conic-gradient(at 50% var(--b),#0000 25%,rgb(0 0 255/50%) 0);
  outline: 1px dashed blue;
  transition: .5s;
}
.box:hover::before {
  transform: translate(25%);
}

h3 {
  text-align:center;
  margin:0;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.