show_message

创建一个自定义透明提示框,并支持显示位置、自动关闭时间、透明度、是否显示关闭按钮、背景颜色和文字颜色

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/505159/1434644/show_message.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

लेखक
KangNian
आवृत्ती
0.1
बनवली
2024-08-25
अपडेट केली
2024-08-25
आकार
7.63 KB
License
नाही

创建一个自定义透明提示框,并支持显示位置、自动关闭时间、透明度、是否显示关闭按钮、背景颜色和文字颜色

// 示例调用

// 使用所有参数的调用方式
show_message({
message: '这是一个完全配置的提示框', // 提示框的内容
type: 'success', // 成功类型提示框
position: 'center', // 屏幕正中显示
opacity: 0.9, // 透明度为 0.9
autoClose: false, // 不自动关闭
});

// 自定义显示颜色
show_message({
message: "这是一个自定义样式的提示框",
type: {
backgroundColor: '#f0e68c', // 浅黄色背景
textColor: '#8b4513' // 深棕色文字
},
position: 'bottom-left', // 在屏幕左下角显示
opacity: 0.8, // 透明度为0.9
autoClose: 7 // 7秒后自动关闭
});

// 使用简单的字符串调用方式(默认配置)
show_message("这是一个信息提示框");

show_message({
message: "这是一条成功消息",
type: 'success',
position: 'bottom-right',
opacity: 0.8,
autoClose: 5 // 5秒后自动关闭
});

show_message({
message: "这是一个警告提示框",
type: 'warning',
position: 'top-left',
opacity: 0.8,
autoClose: 6
});

show_message({
message: "这是一条错误消息",
type: 'error',
position: 'top-right',
opacity: 0.8,
autoClose: 4 // 5秒后自动关闭
});