I have created the triangles in svg
<svg id="trie2" height="300" width="300"> <polygon fill="rgba(0, 255, 0, 0.5)" points="150,0 20,225 280,225"></polygon> <circle cx="150" cy="150" fill="transparent" r="150" stroke="black" stroke-dasharray="2, 2" stroke-width="1"></circle> </svg>
The circile is in order to later be able to rotate the triangles.
the background image is a separate image from the ones in the triangles which is blurred using
My Problem is that I dont know how a good way to get the image inside the triangles while allowing adding shadows around them as well as keeping the image relative to the viewport (i.e. making sure the image matches the background image in the same position).
I have tried the following:
- using a pattern as the background image - I couldnt figure out how to align the pattern relative to the viewport.
- using mask - It didnt work as I expected (i.e. like a Photoshop mask) - if you know how to use mask for this let me know.
- using clip-path - cant add the shadow around the triangles.
Some other things that would be nice about a solution:
- every triangle being its own object, because I plan on putting other elements inside them.
- being able to move and rotate them using transform (I think this wont be possible).
- using only one unblurred image for memory reasons.
- it should be possible to make it somewhat responsive, aka the images inside the triangles are in the right places regardless of the viewport size.
The solution doesnt have to work on old browsers or mobile devices.
I hope you can help me and thank you in advance :)