I have successfully created a Timeline using HTML and CSS elements. The visual result is as follows:
My goal is to enable users to click on the second circle, triggering a color change in the line that connects the first and second circles. This color transition simulates a progress bar effect, enhancing the realism of the timeline.
The challenge lies in detecting clicks on these circles, which were generated using the pseudo-element ::before.
Here is the code snippet I am working with:
ul {
align-content: center;
align-items: center;
display: flex;
justify-content: space-around;
margin-top: 40px;
}
li {
background: #DBAC78;
color: white;
content: ' ';
display: flex;
flex-grow: 1;
height: .3em;
line-height: 1em;
margin: 0;
position: relative;
text-align: right;
z-index: -1;
cursor: pointer;
}
<div class="container" id="containerTimeLine">
<ul class="bigger highlight-active">
<li onclick="PlayAudios();"></li>
<li class="video"></li>
<li class="question"></li>
<li class="question"></li>
<li class="question"></li>
<li class="question"></li>
<li></li>
</ul>
</div>
Any suggestions on how I can detect user clicks on the circles and implement a JavaScript / jQuery function to alter the color of the connecting line gradually like a progress bar?