界面按钮工具类
Verze ze dne
Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://updategf.qytechs.cn/scripts/460642/1326060/Jinxin%20Util%20Button.js
// ==UserScript==
// @name Jinxin Util Button
// @namespace https://gitee.com/jinxin11112/tampermonkey
// @version 0.1.0
// @description 界面按钮工具类
// @author jinxin
// @require https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/all.min.js
// @icon <$ICON$>
// @grant none
// @license MIT
// ==/UserScript==
function addDownloadButton(buttonFun) {
let button = document.createElement('i');
button.className = 'fa-solid fa-download'
button.innerHTML = '下载';
// noinspection JSValidateTypes
button.style = `
position: fixed;
bottom: 20px;
left: 20px;
display: flex;
flex-direction: column;
align-items: end;
z-index: 999;
cursor:pointer;
`;
button.addEventListener('click', buttonFun);
(document.body || document.documentElement).appendChild(button);
}