适合移动端、pc端
当前为
// ==UserScript==
// @name 自定义屏幕分辨率
// @namespace http://tampermonkey.net/
// @description 适合移动端、pc端
// @version 0.2
// @include *
// @grant none
// @license MIT
// @author abusizhishen
// ==/UserScript==
(function () {
'use strict';
function setResolution() {
let box = document.createElement('div')
box.style.position = 'fixed'
box.style.top = '10rem'
box.style.right = '10rem'
let label = document.createElement('label')
label.textContent = '设置分辨率'
let input = document.createElement('input')
input.style.width = '10rem'
input.style.height = '7rem'
input.style.fontSize = '4rem'
input.value = localStorage.getItem('fenbianlv') ?? '100'
box.appendChild(input)
document.body.appendChild(box)
document.body.style.zoom = `${input.value}%`;
input.addEventListener('change', () => {
document.body.style.zoom = `${input.value}%`;
localStorage.setItem('fenbianlv', input.value)
})
}
setResolution()
})();