code optimization, new log system, appp optimizawion

This commit is contained in:
2023-07-03 00:05:13 +05:00
parent af8e44d1ce
commit 3583e5e588
19 changed files with 681 additions and 542 deletions

View File

@ -1,3 +1,11 @@
<div class="scale_block">
<div>
oh no html breaking! <br>
please don't use custom scale for this window
</div>
</div>
</body>
</html>
<script>
if(document.title == "login"){
console.log(document.title);
@ -7,5 +15,34 @@
console.log("check");
}
</script>
</body>
</html>
<script>
px_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
// console.log(px_ratio);
isZooming();
$(window).resize(function(){isZooming();});
function isZooming(){
var newPx_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
if(newPx_ratio != px_ratio){
px_ratio = newPx_ratio;
// console.log(px_ratio);
if (px_ratio != 1){
// console.log("zooming");
document.getElementsByClassName("scale_block")[0].style.display = "block";
}
else{
document.getElementsByClassName("scale_block")[0].style.display = "none";
}
return true;
}else{
// console.log("just resizing");
if (px_ratio != 1){
document.getElementsByClassName("scale_block")[0].style.display = "block";
}
else{
document.getElementsByClassName("scale_block")[0].style.display = "none";
}
return false;
}
}
</script>