I'm currently facing a challenge with the web project I am working on for my company. The code snippet I have looks like this:
//CSS
.home-panel{
z-index: 0;
width: 1800px;
height: 2100px;
background: gray;
transform: skew(0deg,-55deg) translateY(-1920px);
}
.ultimate-hero{
height:100vh;
overflow:hidden;
}
//HTML
<div class="ultimate-hero">
<div class="home-panel">
</div>
</div>
//JS
$(window).resize(function() {
//get dimensions
var height = $(window).height();
var width = $(window).width();
$('.home-panel').css({
'transform' : 'skew(0deg,-55deg) translateY(-'+width+'px)'
});
});
My goal is to move the .home-panel
when the browser is resized, but the current code seems to be doing the opposite of what I intended. How can I correct this?
Thank you.
I should mention that I am looking to achieve a layout similar to the .home-panel
on this website , or something close to it. If you have any suggestions on a better approach, please do share.