I have a unique vision for a website that defies the norm of responsiveness. When resizing the windows, I want everything to scale up or down while maintaining the same ratio. Even if the text becomes too small on smaller screens, my main goal is to prevent any elements from overlapping during resizing.
I've experimented with different approaches:
<meta id="meta" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
As well as this JavaScript code:
<script type="text/javascript">
$(document).ready(function () {
$(window).resize(function () {
calculateNewScale();
});
calculateNewScale(); // adjust for window size less than 1920px
function calculateNewScale() {
var percentageOn1 = $(window).width() / 1920);
$("body").css({
"-moz-transform": "scale(" + percentageOn1 + ")",
"-webkit-transform": "scale(" + percentageOn1 + ")",
"transform": "scale(" + percentageOn1 + ")"
});
}
});
And I've also dabbled with CSS:
body {
width:100vw;
height:100vh;
}
You can find the current version of the website here:
kotechweb.com/new_focus/page/about_us
However, an issue persists where the content overlaps when the window is resized. My quest continues to find a solution to this challenge.