My animated arrows, implemented using pseudo elements, are experiencing an unusual behavior. When the link is hovered over, the arrows animate smoothly. However, upon leaving the link, a pseudo element briefly appears in the top left corner of the screen before disappearing. I'm puzzled as to why this is happening and which piece of code is causing it.
body {
background: black;
}
.animated-arrow {
color: #fff;
text-decoration: none;
}
.the-arrow {
width: 64px;
transition: all 0.2s;
}
.main .text {
padding: 0px 10px;
}
.left-arrow-float .the-arrow .shaft:before,
.left-arrow-float .the-arrow .shaft:after {
background-color: #fff;
content: '';
display: block;
height: 1px;
position: absolute;
top: 0;
left: 0;
transition: all 0.2s;
transition-delay: 0;
}
/**************************************************/
.left-arrow-float .the-arrow.-left .shaft {
width: 64px;
transition-delay: 0.1s;
background-color: #eaeaea;
height: 2px;
display: inline-block;
position: relative;
transition: all 0.2s;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-left .shaft {
width: 0px;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-left .shaft:before {
width: 0px;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-left .shaft:after {
width: 0px;
}
.left-arrow-float .the-arrow.-right .shaft {
width: 0px;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-right .shaft {
width: 64px;
transition-delay: 0.1s;
background-color: #eaeaea;
height: 2px;
display: inline-block;
position: relative;
transition: all 0.2s;
}
.left-arrow-float .the-arrow.-right .shaft:before {
width: 0px;
}
.left-arrow-float .the-arrow.-right .shaft:after {
width: 0px;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-right .shaft:before {
width: 8px;
}
.left-arrow-float .animated-arrow:hover .left-arrow .the-arrow.-right .shaft:after {
width: 8px;
}
.left-arrow-float .the-arrow .shaft:before {
-webkit-transform-origin: top left;
transform-origin: top left;
transform: rotate(45deg);
transition-delay: 0.3s;
}
.left-arrow-float .the-arrow .shaft:after {
-webkit-transform-origin: bottom left;
transform-origin: bottom left;
transform: rotate(-45deg);
transition-delay: 0.3s;
}
.left-arrow-float .the-arrow.-left .shaft:before,
.left-arrow-float .the-arrow.-left .shaft:after {
width: 8px;
}
<div class="left-arrow-float">
<a class="animated-arrow arrow-c-f" href="#">
<div class="left-arrow">
<span class="main">
<span class="the-arrow -left">
<span class="shaft"></span>
</span>
<span class="text">
Some Text
</span>
</span>
<span class="the-arrow -right">
<span class="shaft"></span>
</span>
</div>
</a>
</div>