toast.js

coco-message TheWindRises-2 js toast

As of 2021-05-09. See the latest version.

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.greasyfork.org/scripts/426194/929424/toastjs.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Author
古海沉舟(Eazou)
Version
0.0.1.20210509142630
Created
2021-05-09
Updated
2021-05-09
Size
13.6 KB
License
N/A

js toast
https://github.com/TheWindRises-2/coco-message/blob/main/README.md
cocoMessage.config({
duration: 10000
})
function changeText(num) {
switch (num) {
case 0:
cocoMessage.info(1500, "这是一条消息", () => {
console.log("close");
});
break;
case 1:
let div1 = document.createElement('div');
div1.innerText = '这是一条成功的消息'
cocoMessage.success(div1);
break;
case 2:
cocoMessage.warning("需要手动关闭消息", 0);
break;
case 3:
cocoMessage.error("这是一条错误的消息", 3000);
break;
case 4:
let closeMsg = cocoMessage.loading(true);
setTimeout(() => {
closeMsg();
}, 4000);
break;
case 5:
cocoMessage.destroyAll();
break;
default:
break;
}
}