<h2>cubic-bezier(.8,-.5,.2,1.4)</h2>
<div id="wrapper">
  <input type="checkbox" id="chk" />
  <label for= "chk">Play/Reset</label>
  <div id="box"></div>
  <div id="pointA" class="point"><br /><br />A</div>
  <div id="lineAB"></div>
  <div id="pointB" class="point"><br /><br />B</div>
</div>
#wrapper {
  width: 600px;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

h2 {
  text-align: center;
  font-size: 21pt;
  font-family: courier new;
  margin-bottom: 0;
  color: #4D4D4D;
  letter-spacing: 2px;
}

.point {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #999;
  font-size: 15pt;
  font-family: monospace;
}

#lineAB {
  width: 318px;
  margin-top: 1px;
  border-top: 2px dashed #999;
}

input[type="checkbox"] {
  margin-bottom: 200px;
  opacity: 0;
}

label {
  position: relative;
  left: 100px;
  margin-bottom: 130px;
  margin-left: -150px;
  cursor: pointer;
  font-family: 'georgia';
  padding: 10px;
  background-color: #999;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 1px;
}

#chk:checked+label,
label:hover {
  background-color: #449FCA;
}

#box {
  width: 50px;
  height: 50px;
  background-color: rgba(230, 76, 66, .8);
  position: relative;
  left: 30px;
  border-radius: 4px;
}

#chk:checked ~ #box {
  transform: translateX(330px);
  transition: transform 6s cubic-bezier(.8,-.5,.2,1.4);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.