Upsilon Library

Simple toast notifications for userscripts

2025/08/13のページです。最新版はこちら

このスクリプトは単体で利用できません。右のようなメタデータを含むスクリプトから、ライブラリとして読み込まれます: // @require https://update.greasyfork.org/scripts/545650/1640716/Upsilon%20Library.js

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
    };
})();