JSFiddle - React, Tailwind, and code Playground

by Murat Kezli

HTML

<div id="sol">

</div>

<div id="sag">

</div>

CSS

#sol{
  
  height: 80px; 
   width: 120px;
  float:left;
  background-color:red;
  z-index:4;
  position:relative;
}

#sag {
   height: 0; 
   width: 80px;
   margin-left:-40px;
   border-bottom: 90px solid ;
   border-left: 40px solid transparent;
   border-right: 0px solid transparent;
  border-bottom-color:green;
   float:left;
   z-index:5;
   position:relative;
}

JavaScript

window.onresize = function(event) {
var w = window.innerWidth;
//alert (w);
$("#sol, #sag").css({'background-color':'','width':(w/2)-8+'px'})
}