I’m trying to add HTML wrappers around a block to create a clipping effect, something like the below code. It has been suggested this might be possible with the block save or block edit functions?
I have done a fair bit of experimenting with CSS clip-path and SVG clipPath and unfortunately they will not work for what I am trying to achieve as I need cross-browser support.
HTML:
<div class="transform-containter">
<div class="transform-right">
<div class="transform-left">
<div class="transform-content">
<div class="block-container">
BLOCK CONTENT HERE
</div>
</div>
</div>
</div>
</div>
CSS:
.transform-containter {
width: 100%;
height: auto;
margin-top: 0;
overflow-x: hidden;
overflow-y: hidden;
}
.transform-right {
position: relative;
width: 110%;
height: 100%;
top: 0;
left: -5%;
-webkit-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-ms-transform: rotate(2deg);
-o-transform: rotate(2deg);
transform: rotate(2deg);
overflow: hidden;
margin-top:2.5%;
}
.transform-left {
position: relative;
width: 110%;
height: 100%;
left: -5%;
-webkit-transform: rotate(-4deg);
-moz-transform: rotate(-4deg);
-ms-transform: rotate(-4deg);
-o-transform: rotate(-4deg);
transform: rotate(-4deg);
overflow: hidden;
margin-top: -4%;
margin-bottom: 3.5%;
}
.transform-content {
width: 100%;
height: 100%;
-webkit-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-ms-transform: rotate(2deg);
-o-transform: rotate(2deg);
transform: rotate(2deg);
background-color: #cccccc;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin: 2% 0 -2% 0;
padding: 2em 10%;
}
Here is a codepen of the effect in raw HTML/CSS https://codepen.io/bearandpear/pen/VObzQZ
So essentially just trying to add the extra HTML div elements either side of the block output code.
Any help would be greatly appreciated. I’m not a developer, I’m pretty good with HTML, CSS and a little PHP, but completely green when it comes to Javascript/React…