I am trying to highlight/make it clickable particular interlocking pieces (resembling a puzzle) upon hovering over the image. Is there a method to achieve this considering the irregular shapes of the pieces? I explored using an image map, but it seems limited to rectangular, polygonal, or circular shapes. Here’s the image I’m working with. My goal is to highlight the green, purple, and blue pieces when a user selects a specific piece, while dimming out the others.
4
Answers
You can position regular rectangular HTML elements and use a clip-path on them of the SVG path of the desired shape. You can use an SVG editor to create the shape and copy the path code into the clip-path.
give the specific shape for the buttons i think and give some angles direction
I agree with @MisterJojo’s comment:
The highlighting in the image created with SVG is very simple using CSS
:hover
. Alternatively, with the use of JavaScript, you can detect clicks and perform operations based on them.If you create a vector version of your image, you’ll also be able to highlight irregular elements.
you can work with 3 buttons that complement each other in the image