Explaining the concept through visuals, I created mock-up images in MS Paint for reference. When the web page launches, it resembles this: https://i.sstatic.net/wzjDR.png
Upon hovering over the top left corner, the square expands while the other three shrink: https://i.sstatic.net/9l7dD.png
Similarly, when hovering over the bottom right:
https://i.sstatic.net/AhGoJ.png
Experimenting with both jQuery and CSS, I found that jQuery works to some extent but causes all divs to stack underneath each other during transition.
This is the HTML code snippet:
<body>
<div id="screenfiller">
<div id="1">
</div>
<div id="2">
</div>
<div id="3">
</div>
<div id="4">
</div>
</div>
CSS styling used:
body{
max-height: 100%;
max-width: 100%;
}
#screenfiller {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
max-height: 100%;
max-width: 100%;
}
#1{
width: 50%;
float: left;
position: static;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: flex;
}
#2{
width: 50%;
background-color: yellow;
float: left;
position: static;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: flex;
}
#3{
width: 50%;
background-color: red;
float: left;
position: static;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: flex;
}
#4{
width: 50%;
background-color: green;
float: left;
position: static;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: flex;
}
JQuery implementation:
$('#1').mouseenter(function(){
$('#tech').animate({ height: "55%", width: "55%"}, 500 );
$('#qual').animate({ height: "45%", width: "55%"}, 500 );
$('#work').animate({ height: "55%", width: "45%"}, 500 );
$('#pers').animate({ height: "45%", width: "45%"}, 500 );
});
$('#2').mouseenter(function(){
$('#work').animate({ height: "55%", width: "55%"}, 500 );
$('#pers').animate({ height: "45%", width: "55%"}, 500 );
$('#tech').animate({ height: "55%", width: "45%"}, 500 );
$('#qual').animate({ height: "45%", width: "45%"}, 500 );
});
$('#3').mouseenter(function(){
$('#qual').animate({ height: "55%", width: "55%"}, 500 );
$('#tech').animate({ height: "45%", width: "55%"}, 500 );
$('#pers').animate({ height: "55%", width: "45%"}, 500 );
$('#work').animate({ height: "45%", width: "45%"}, 500 );
});
$('#4').mouseenter(function(){
$('#pers').animate({ height: "55%", width: "55%"}, 500 );
$('#work').animate({ height: "45%", width: "55%"}, 500 );
$('#qual').animate({ height: "55%", width: "45%"}, 500 );
$('#tech').animate({ height: "45%", width: "45%"}, 500 );
});
UPDATE:
Here's how I envision the live version to look like:
Initial appearance of the webpage:
https://i.sstatic.net/AtEv5.png
Hover effect on the top left square:
https://i.sstatic.net/c0J5n.png
Triggering hover action on the bottom right square: