forxtu
6/28/2017 - 3:26 PM

Back to top arrow

Back to top arrow

<!-- Back to top Arrow -->
<a class="arrow-up">
  <span class="left-arm"></span>
	<span class="right-arm"></span>
	<span class="arrow-slide"></span>
</a>
/* Back to top arrow */
.arrow-up {
  height: 40px;
  width: 40px;
  display: block;
  border: 3px solid #456a61;
  position: relative;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 1.7, 0.35, 1.5);
  overflow: hidden;
}
.arrow-slide {
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: #456a61;
  position: absolute;
  display: block;
  z-index: 0;
}
.left-arm {
  position: absolute;
  z-index: 1;
  background-color: transparent;
  top: 17px;
  left: 4px;
  width: 13px;
  display: block;
  transform: rotate(-45deg);
}
.left-arm:after {
  content: "";
  background-color: #456a61;
  width: 17px;
  height: 3px;
  display: block;
  border-radius: 1px;
  transition: all 0.5s cubic-bezier(0.25, 1.7, 0.35, 1.5);
  transform-origin: right center;
  z-index: -1;
}
.right-arm {
  position: absolute;
  z-index: 1;
  background-color: transparent;
  top: 14px;
  left: 15px;
  width: 13px;
  display: block;
  transform: rotate(45deg);
  border-radius: 2px;
}
.right-arm:after {
  content: "";
  background-color: #456a61;
  width: 17px;
  height: 3px;
  display: block;
  border-radius: 1px;
  transition: all 0.5s cubic-bezier(0.25, 1.7, 0.35, 1.5);
  transform-origin: left center;
  z-index: -1;
}
.arrow-up:hover {
  transition: all .1s;
}
.arrow-up:hover .left-arm:after {
  transform: rotate(-10deg);
}
.arrow-up:hover .right-arm:after {
  transform: rotate(10deg);
}
.arrow-up:hover .arrow-slide {
  transition: all .4s ease-in-out;
  transform: translateY(200%);
}
.arrow-up{
  position: fixed;
  display: none;
  bottom: 45px;
  right: 45px;
}
/* ***END of Back to top Arrow */
$(document).ready(function(){
  $('.arrow-up').click(function(event) {
        event.preventDefault();
        
        $('html, body').animate({scrollTop: 0}, 300);
    })  
});