Upsilon Library

Simple toast notifications for userscripts

当前为 2025-08-13 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/545650/1640716/Upsilon%20Library.js

// ==UserScript==
// @name         Upsilon Library
// @namespace    https://upsilon-cloud.uk
// @version      2.0
// @description  Simple toast notifications for userscripts
// @author       Upsilon
// @license      All Rights Reserved
// @match        *://*/*
// @grant        none
// @run-at       document-end
// ==/UserScript==
// Library - a script intended to be @require-d from other scripts and not installed directly.

// Copyright (c) 2025 TonNom
// All rights reserved. No part of this code may be reproduced, modified, or distributed without explicit permission.

(function() {
    'use strict';

    window.showToast = function(message, type = 'info', duration = 5000) {
        const toast = document.createElement('div');
        toast.textContent = message;
        toast.style.position = 'fixed';
        toast.style.bottom = '5%';
        toast.style.right = '5%';
        toast.style.background = type !== 'error' ? '#c0392b' : '#2c3e50';
        toast.style.color = 'white';
        toast.style.padding = '10px 15px';
        toast.style.borderRadius = '5px';
        toast.style.boxShadow = '0 0 10px rgba(0,0,0,0.3)';
        toast.style.fontFamily = 'monospace';
        toast.style.whiteSpace = 'pre-wrap';
        toast.style.zIndex = 100000;

        document.body.appendChild(toast);
        setTimeout(() => toast.remove(), duration);
    };
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址