I’m trying to make a custom triangle slider.
This is what I’m trying to achieve:
So far, I’m able to make this shape, but as I slide it, the blue fill covers the shape:
{/* track */}
<div className={"absolute h-48 top-[80%] translate-y-[-50%] w-full bg-background-white [clip-path:polygon(100%_0%,100%_100%,0_100%,_0%_50%)]"} />
{/* fill */}
<div
className={"absolute h-48 top-[80%] translate-y-[-50%] bg-toast-icon-tag-active"}
style={{ width: state.getThumbPercent(0) * 100 + "%" }}
/>
2
Answers
I just have to wrap the fill inside track so that the fill can follow the shape of the track.
Thanks to those that has try to help me, I really appreciate it.
Might be something like this ?