I created a dummy ReactJS
component: Frame
which renders fine on Chrome
but does NOT render fine on Edge
.
Here you have the Codesandbox.io
:
https://codesandbox.io/s/o4kw405n69
Here you have how it renders on both of them:
On Chrome (Good):
On Microsoft Edge (Bad):
You can try it here by yourself on both browsers:
https://0okjypwknl.codesandbox.io/
In order to create the frame, I use only one simple image:
Then, after some CSS
transformations I get the desired effect, including the corners.
Unfortunatelly, on Edge
I'm not getting the desired effect on othe corners. Do you have any idea on how to solve this for Edge
and of course, keep it working on Chrome
?
Please, fork my Codesandbox.io
above: https://codesandbox.io/s/o4kw405n69, apply your solution and paste the link here.
By the way, here you have the style that takes care of doing the required transformations to get the frame effect:
this.style = {
frame: {
position: 'absolute',
width: widthFrame + 'px',
height: heightFrame + 'px',
...((urlImageMat !== false) && {
backgroundImage: 'url("' + urlImageMat + '")',
}),
},
image: {
backgroundImage: 'url("' + urlImageMain + '")',
backgroundRepeat: 'no-repeat',
backgroundSize: widthImage + 'px ' + heightImage + 'px',
backgroundPosition: 'center',
width: '100%',
height: '100%',
},
trapezoidTop: {
width: widthFrame + 'px',
height: thickFrame + 'px',
clipPath: 'polygon(0 0, 100% 0, calc(100% - ' + thickFrame + 'px) 100%, ' + thickFrame + 'px 100%)',
transformOrigin: 'top left',
transform: 'rotate(0deg)',
},
trapezoidLeft: {
width: heightFrame + 'px',
height: thickFrame + 'px',
marginTop: - thickFrame + 'px',
clipPath: 'polygon(0 0, 100% 0, calc(100% - ' + thickFrame + 'px) 100%, ' + thickFrame + 'px 100%)',
transformOrigin: 'top left',
transform: 'rotate(90deg) scale(1, -1)',
},
trapezoidImage: {
backgroundImage: 'url("' + urlImageFrame + '")',
backgroundSize: 'contain',
},
edgeTLBR: {
position: 'absolute',
},
edgeBR: {
display: 'inline-block',
width: widthFrame + 'px',
height: heightFrame + 'px',
transform: 'rotate(180deg)',
},
};
(more details on the Codesandbox.io
)
Thanks!