JSFiddle - React, Tailwind, and code Playground

by jstoudt

HTML

<div class="container">
    <div class="arrow up"></div>
</div>

CSS

.container {
    position: relative;
    width: 300px;
    height: 20px;
    margin: 100px 0 0 125px;
    border-bottom: 1px solid #000;
    border-left: 2px solid #000;
    border-right: 2px solid #000;
    background: -webkit-linear-gradient(left, rgba(0, 255, 0, 0.25) 0, rgba(255, 0, 0, 0.25) 100%);
}
.container:before,
.container:after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
}

.container:before {
    left: 50%;
    width: 0;
    height: 100%;
    border-left: 2px solid #000;
}
.container:after {
    left: 25%;
    width: 150px;
    height: 50%;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
}

.arrow {
    width: 0;
    height: 0;
    border: 20px solid transparent;
    margin-left: -21px;
    transition: 300ms ease-in;
    -webkit-transform: translateY(5px);
}

.up {
    border-bottom-color: #0f0;
}

.container:active {
    background-color: #fdd;
    transition: 4s linear;
}

.container:active .arrow {
    border-bottom-color: #f00;
    -webkit-transform: translateX(302px) translateY(5px);
    transition: 4s linear;
}