您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
17.02.2020, 10:33:05, Please do tell me if you know how to resize PhotoPea's canvas without wisible stretching!
// ==UserScript== // @name Wide-ish PhotoPea.com // @namespace Violentmonkey Scripts // @match https://www.photopea.com/ // @grant none // @version 1.0 // @author UniBreakfast // @description 17.02.2020, 10:33:05, Please do tell me if you know how to resize PhotoPea's canvas without wisible stretching! // ==/UserScript== const qSel = sel => document.querySelector(sel) const inter = setInterval(()=> { const canvas = qSel('canvas') if (!canvas) return clearInterval(inter) canvas.style.margin = 'auto' canvas.parentNode.addEventListener('mousemove', e => { qSel('.photopea').lastChild.style.display = 'none' const width = innerWidth - document.querySelector('.rightbar').clientWidth - document.querySelector('.sbar').clientWidth - 30 // canvas.height = width / canvas.width * canvas.height // canvas.width = width qSel('.panelhead').style.maxWidth = qSel('.pbody').parentNode.style.width = /*canvas.style.width =*/ width+'px' // canvas.style.height = canvas.height+'px' }) }, 500)