This approach allows a quick insight as to how you possibly could approach this task, although it is far from complete.
$('.start').click(function() {
$('.start, .added').removeClass("startActive").removeClass("addedActive");
$(this).toggleClass("startActive");
});
$('.added').click(function() {
$('.start, .added').removeClass("startActive").removeClass("addedActive");
$(this).toggleClass("addedActive");
});
div {
display: inline-block;
height: 100px;
width: 200px;
border-top: 5px solid gray;
border-bottom: 5px solid gray;
position: relative;
text-align: center;
margin-left: -4px;
}
.start {
margin-left: 45px;
}
.start:before,
.startActive:before {
content: "";
position: absolute;
height: 70px;
width: 70px;
top: 12px;
left: -38px;
border-bottom: 5px solid gray;
border-left: 5px solid gray;
transform: rotate(45deg);
}
.startActive,
.addedActive {
border-top: 5px solid red;
border-bottom: 5px solid red;
}
.startActive:before {
border-bottom: 5px solid red;
border-left: 5px solid red;
}
.added:before,
addedActive:before {
content: "";
position: absolute;
height: 70px;
width: 70px;
top: 12px;
left: -38px;
border-top: 5px solid gray;
border-right: 5px solid gray;
transform: rotate(45deg);
}
.start:after,
.added:after,
.addedActive:after,
.startActive:after {
content: "";
position: absolute;
height: 70px;
width: 70px;
top: 12px;
right: -38px;
border-top: 5px solid gray;
border-right: 5px solid gray;
transform: rotate(45deg);
}
.startActive:after {
border-top: 5px solid red;
border-right: 5px solid red;
z-index: 8;
}
.addedActive:before {
border-top: 5px solid red;
border-right: 5px solid red;
z-index: 8;
}
.addedActive:after {
border-top: 5px solid red;
border-right: 5px solid red;
z-index: 8;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="start">start</div>
<div class="added">middle</div>
<div class="added">end</div>
Note: i'm not the best at jquery, although I have added 'active' parts (click on elements to 'activate' it).