body
{
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #212121;
}
.line
{
    width: 300px;
    border-bottom: 4px solid white;
    position: relative;
    animation: animateline 2s linear infinite;
}

.hexagon
{
    position: absolute;
    left: 0;
    bottom: 14px;
    width: 50px;
    height: 30px;
    background-color: white;
    animation: animatehexagon 2s linear infinite;
}

.hexagon:before 
{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transform: rotate(60deg);

}
.hexagon:after
{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transform: rotate(-60deg);
    
}

@keyframes animatehexagon 
{
    0% {left: 0;}
    50% {left: calc(100% - 50px);
    transform: rotate(720deg);}
    100% {left: 0;}
}

@keyframes animateline 
{
    0% {transform: rotate(30deg);}
    25% {transform: rotate(0deg);}
    50% {transform: rotate(-30deg);}
    75% {transform: rotate(0deg);}
    100% {transform: rotate(30deg);}
}