您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Customize the layout of Coze's sidesheet-container. Now with a toggle switch.
当前为
// ==UserScript== // @name Coze Custom Layout // @namespace Violentmonkey Scripts // @match *://*.coze.com/* // @license GPL-3.0-only // @grant none // @version 1.3 // @description Customize the layout of Coze's sidesheet-container. Now with a toggle switch. // ==/UserScript== let widescreenEnabled = false; // 创建一个按钮用来切换宽幅 let toggleButton = document.createElement('button'); toggleButton.innerHTML = '切换宽幅布局'; toggleButton.style.position = 'fixed'; toggleButton.style.top = '30px'; toggleButton.style.right = '200px'; toggleButton.style.zIndex = '9999'; // 设置 z-index 为 9999 使其在其它元素之上 toggleButton.onclick = function() { widescreenEnabled = !widescreenEnabled; // 立即更新布局 updateLayout(); }; // 添加按钮到页面中 document.body.appendChild(toggleButton); function updateLayout() { // 如果当前的宽幅被启用,则调整container的风格 if (widescreenEnabled) { document.getElementsByClassName('sidesheet-container')[0].style['grid-template-columns'] = '0fr 0fr 14fr'; } else { // 否则,清除我们设置的风格,恢复到默认 document.getElementsByClassName('sidesheet-container')[0].style.removeProperty('grid-template-columns'); } } window.onload = function() { var checkExist = setInterval(function() { if (document.getElementsByClassName('sidesheet-container').length) { updateLayout(); clearInterval(checkExist); } }, 100); }