<!-- Up Arrow - Lines -->
<a class="scroll-up">
<span class="left-bar"></span>
<span class="right-bar"></span>
<svg width="40" height="40">
<line class="top" x1="0" y1="0" x2="120" y2="0"/>
<line class="left" x1="0" y1="40" x2="0" y2="-80"/>
<line class="bottom" x1="40" y1="40" x2="-80" y2="40"/>
<line class="right" x1="40" y1="0" x2="40" y2="1200"/>
</svg>
</a>
<!-- Up Arrow - Swipe -->
<a class="arrow-up">
<span class="left-arm"></span>
<span class="right-arm"></span>
<span class="arrow-slide"></span>
</a>
// Up Arrow Lines
.scroll-up {
height: 40px;
width: 40px;
display: block;
outline: 1px solid rgba(666,666,666,.08);
position: relative;
cursor: pointer;
transition: all 0.5s cubic-bezier(0.25, 1.7, 0.35, 1.5);
svg line {
stroke-width: 1;
stroke: #aaa;
fill: none;
stroke-dasharray: 20;
transition: all .4s ease;
transition: all .4s ease;
}
&:hover svg line {
&.top {
transform: translateX(-40px);
transform: translateX(-40px);
}
&.bottom {
transform: translateX(40px);
transform: translateX(40px);
}
&.left {
transform: translateY(40px);
transform: translateY(40px);
}
&.right {
transform: translateY(-40px);
transform: translateY(-40px);
}
}
}
.scroll-up {
.left-bar {
position: absolute;
z-index: 1;
background-color: transparent;
top: 19px;
left: 5px;
width: 18px;
display: block;
transform: rotate(-45deg);
&:after {
content: "";
background-color: #666;
width: 18px;
height: 1px;
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-bar {
position: absolute;
z-index: 1;
background-color: transparent;
top: 19px;
left: 17px;
width: 18px;
display: block;
transform: rotate(45deg);
border-radius: 2px;
&:after {
content: "";
background-color: #666;
width: 18px;
height: 1px;
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;
}
}
&:hover {
transition: all .1s;
.left-bar:after {
transform: rotate(-10deg);
}
.right-bar:after {
transform: rotate(10deg);
}
}
}
// /Up Arrow Lines
// Up Arrow Swipe
.arrow-up {
// background-color: #111;
height: 40px;
width: 40px;
display: block;
border: 1px solid #666;
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: #666;
position: absolute;
display: block;
z-index: 0;
}
.left-arm {
position: absolute;
z-index: 1;
background-color: transparent;
top: 19px;
left: 3px;
width: 20px;
display: block;
transform: rotate(-45deg);
&:after {
content: "";
background-color: #666;
width: 20px;
height: 1px;
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: 19px;
left: 17px;
width: 20px;
display: block;
transform: rotate(45deg);
border-radius: 2px;
&:after {
content: "";
background-color: #666;
width: 20px;
height: 1px;
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;
.left-arm:after {
transform: rotate(-10deg);
}
.right-arm:after {
transform: rotate(10deg);
}
.arrow-slide {
transition: all .4s ease-in-out;
transform: translateY(200%);
}
}
// /Up Arrow Swipe
// --------------- display stuff --------------------
a {
margin: 3em;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #111;
}
View Compiled
// Move along folks
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.