From 2c1dadab445eadb661c08738fc471789d4a4d2af Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期五, 18 四月 2025 15:25:27 +0800 Subject: [PATCH] fix:修改判断条件 --- index.html | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/index.html b/index.html index c814f0d..5ebb133 100644 --- a/index.html +++ b/index.html @@ -214,4 +214,19 @@ <script type="module" src="/src/main.js"></script> </body> +<script> + // 屏幕适配 + const t = window.devicePixelRatio // 获取下载的缩放 125% -> 1.25 150% -> 1.5 + // var heigth_screen = window.screen.height; // 获取整个屏幕的分辨率 + const width_screen = window.screen.width; + let zoom = 1 + if (t !== 1) { + zoom = (1 / t) * zoom; // 就去修改页面的缩放比例 + } + if (width_screen < 1366) { + zoom = (width_screen / 1366) * zoom; // 就去修改页面的缩放比例 + } + document.body.style.zoom = zoom; // 就去修改页面的缩放比例 +</script> + </html> \ No newline at end of file -- Gitblit v1.9.3