html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  background-color: #ddd;
}

.container {
  width: 650px;
  margin: auto;
}

.container h2 {
  text-align: center;
  margin-bottom: 60px;
}

.container button {
  outline: none;
  border: 1px solid #000;
  display: inline-block;
  width: 150px;
  background-color: transparent;
  box-sizing: border-box;
  position: relative;
  padding: 0;
  cursor: pointer;
  margin-right: 5px;
}

.container button span {
  display: block;
  padding: 10px;
  position: relative;
  z-index: 2;
  color: #fff;
}

.container button::before {
  content: '';
  position: absolute;
  transition: all .3s;
}

.container button::after {
  content: '';
  position: absolute;
  z-index: 1;
  transition: all .3s;
}

.container button.to-bottom::after {
  background-color: #000;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.container button.to-bottom:hover span {
  color: #000;
}

.container button.to-bottom:hover::after {
  height: 0;
}

.container button.to-top::after {
  background-color: #000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.container button.to-top:hover span {
  color: #000;
}

.container button.to-top:hover::after {
  height: 0;
}

.container button.to-left::after {
  background-color: #000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.container button.to-left:hover span {
  color: #000;
}

.container button.to-left:hover::after {
  width: 0;
}

.container button.to-right::after {
  background-color: #000;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

.container button.to-right:hover span {
  color: #000;
}

.container button.to-right:hover::after {
  width: 0;
}

.container .two {
  margin: 60px 0;
}

.container .two .line {
  padding: 5px;
  border: none;
}

.container .two .line span {
  background-color: #000;
}

.container .two .line.first::before {
  left: 0;
  top: 0;
  height: 10px;
  width: 10px;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.container .two .line.first::after {
  right: 0;
  bottom: 0;
  height: 10px;
  width: 10px;
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
}

.container .two .line.second::before {
  right: 0;
  top: 0;
  height: 0;
  width: 0;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  transition: width .2s .2s, height .2s;
}

.container .two .line.second::after {
  left: 0;
  bottom: 0;
  height: 0;
  width: 0;
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
  transition: width .2s .2s, height .2s;
}

.container .two .line.second:hover::before, .container .two .line.second:hover::after {
  transition: width .2s , height .2s .2s;
}

.container .two .line.third::before {
  right: 0;
  top: 0;
  height: 0;
  width: 0;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  transition: width .1s .3s, height .1s .2s;
}

.container .two .line.third::after {
  left: 0;
  bottom: 0;
  height: 0;
  width: 0;
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
  transition: width .1s .1s, height .1s;
}

.container .two .line.third:hover::before {
  transition: width .1s , height .1s .1s;
}

.container .two .line.third:hover::after {
  transition: width .1s .2s, height .1s .3s;
}

.container .two .line:hover::before, .container .two .line:hover::after {
  width: 99%;
  height: 99%;
}

.container .three .blodline {
  border: none;
  background-color: #f5f5f5;
}

.container .three .blodline span {
  color: #000;
}

.container .three .blodline::before, .container .three .blodline::after {
  content: '';
  height: 2px;
  background-color: #000;
  position: absolute;
}

.container .three .blodline.first::before {
  width: 15%;
  right: 50%;
  bottom: 0;
  transition: width .2s .4s;
}

.container .three .blodline.first::after {
  width: 15%;
  left: 50%;
  bottom: 0;
  transition: width .2s .4s;
}

.container .three .blodline.first:hover::before, .container .three .blodline.first:hover::after {
  width: 50%;
  transition: width .2s;
}

.container .three .blodline.first span::before, .container .three .blodline.first span::after {
  content: '';
  position: absolute;
  bottom: 0;
  opacity: 0;
  width: 0;
  height: 0;
  border-bottom: none;
  transition: width .2s, height .2s .2s, opacity .8s;
}

.container .three .blodline.first span::before {
  left: 0;
  border-left: 2px solid #000;
  border-top: 2px solid #000;
}

.container .three .blodline.first span::after {
  right: 0;
  border-right: 2px solid #000;
  border-top: 2px solid #000;
}

.container .three .blodline.first span:hover::before, .container .three .blodline.first span:hover::after {
  opacity: 1;
  width: 50%;
  height: 100%;
  transition: width .2s .4s, height .2s .2s, opacity .1s;
}

.container .three .blodline.second::before, .container .three .blodline.second::after {
  content: '';
  left: 0;
  width: 2px;
  background-color: #000;
  height: 30%;
  transition: height .2s .2s;
}

.container .three .blodline.second::after {
  bottom: 50%;
}

.container .three .blodline.second::before {
  top: 50%;
}

.container .three .blodline.second:hover::before, .container .three .blodline.second:hover::after {
  height: 50%;
  transition: height .2s;
}

.container .three .blodline.second span::before, .container .three .blodline.second span::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  left: 2px;
  opacity: 0;
  transition: width .2s .1s, height .1s, opacity .1s .2s;
}

.container .three .blodline.second span::before {
  top: 0;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
}

.container .three .blodline.second span::after {
  bottom: 0;
  border-bottom: 2px solid #000;
  border-right: 2px solid #000;
}

.container .three .blodline.second span:hover::before, .container .three .blodline.second span:hover::after {
  opacity: 1;
  width: calc(100% - 2px);
  height: 50%;
  transition: width .2s .2s, height .1s .4s, opacity .1s .2s;
}

.container .four {
  margin-top: 30px;
}

.container .four .opacity {
  background-color: #000;
  transition: all .8s;
}

.container .four .opacity span {
  color: #fff;
}

.container .four .opacity:hover {
  background-color: #fff;
}

.container .four .opacity:hover span {
  color: #000;
}
