Greasy Fork 支持简体中文。

按钮脚本模板

zdd6310

// ==UserScript==
// @name         按钮脚本模板
// @namespace    http://tampermonkey.net/
// @version      2024-02-21
// @description  zdd6310
// @author       zhao_daodao
// @match        https://www.luogu.com.cn/
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let pos=document.querySelector("#app > div.main-container > div.wrapper.wrapped.lfe-body.header-layout.tiny > div.container > div.link-container");
    let butt=document.createElement('button');
    butt.innerText='nboj';
    butt.id='free';
    butt.className = 'btn btn-primary';
    butt.style.padding = "10px 20px";
    butt.style.backgroundColor = "#ffffff";
    butt.style.color = "black";
    butt.style.border = "none";
    butt.style.borderRadius = "5px";
    butt.style.fontSize = "16px";
    butt.style.cursor = "pointer";
    butt.addEventListener('mouseover', function() {
        this.style.backgroundColor = "#ffffff";
    });
    butt.addEventListener('mouseout', function() {
        this.style.backgroundColor = "#ffffff";
    });
    butt.addEventListener('click',function(){
        // alert('fuck zwx');
        window.open('https://www.luogu.com.cn/chat', '_blank');
    });
    pos.appendChild(butt);
})();