I am trying to create a menu that contains right triangles formed together to form a square. This is what I envision:

This is what I hope to achieve:
- Can be dynamically generated through javascript.
- Scales to parent
- Clip an image as background for each triangle (cannot be CSS)
- Link to a site for each triangle
- Update background and text color when hovering
- Support multiple browsers
I have tried several different approaches, but encountered several issues with each one:
- CSS Hack:
- Cannot set text to correct location
- Cannot set borders individually
- SVG
- Cannot update coloring when hovering. Closest I got was here: https://jsfiddle.net/71xp6r0s
<div class="menu-box">
<svg id="menu" style="border: black solid 1px" width="100" height="100" viewbox="0, 0, 100, 100">
<polygon class = "top" points='0,0 0,100 100,0' fill="none" stroke="red"/>
<text x="-18" y="68" fill="black" transform="rotate(-45)">Item</text>
<polygon points='100,0 100,100 0,100' fill="none" stroke="red" />
<text x="-18" y="84" fill="black" transform="rotate(-45)">Item</text>
</svg>
</div>
- Canvas
- Difficult dynamically adjust to parent
- Clip path:
- Not supported by most browsers.
I understand this is quite ambitious, but any help would be appreciated. I am also open to other ideas, but these were the ones I found online.
Edit: Switch to a better image