JSFiddle - React, Tailwind, and code Playground

HTML

<div id="click">Hover over me!!</div>
<div id="main"></div>

CSS

#main {
    position: absolute;
    height: 100%;
    width: 100%;

    background-color: red;
    
}
#newclass {
    position: absolute;
    height: 50px;
    width: 100px;
    margin-top:25%;
    background-color: green;
    
}
#click:hover + #main {
    width: 100px;
    height: 50px;
    margin-top:25%;
    background-color: green;
    transition-property:width,height,margin;
    transition: 0.5s ease;
}


#click {
    width: 100px;
    height: 50px;
    background-color: cornflowerblue;
    color: white;
    font-weight: bold;
    text-align: center;
}

#click:hover + #newclass {
    margin-top:0px;
    transition: all 0.5s ease;
}

JavaScript

$("#click").hover(
  function() {
    setTimeout( '$("#main").delay(500).attr("id","newclass");' ,500 );
});