2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

兼容之前的背景随机

This commit is contained in:
leiyilu 2022-07-03 16:00:37 +08:00
parent 140bec8837
commit 83c235d25a
6 changed files with 19 additions and 19 deletions

View File

@ -2,9 +2,11 @@
*兼容`体力模板2`可自定义css以及背景icon等 *兼容`体力模板2`可自定义css以及背景icon等
* 模板内容需要具体参考**/dailyNote/Template/temp** * 模板内容需要具体参考**/dailyNote/Template/temp**
* 推荐英文命名文件夹 * 推荐英文命名文件夹
* 其中css文件放在**/dailyNote/Template/你的模板/css/xiaoyao_Note.css**这块懒得做命名处理了统一这个命名 * 花里胡哨背景
* 进度条图片文件放在**/dailyNote/Template/你的模板/speed/** 文件命名0-100数字 无需% * 其中css文件放在**/dailyNote/Template/你的模板/css/xiaoyao_Note.css**这块懒得做命名处理了统一这个命名
* icon文件目录**/dailyNote/Template/你的模板/icon/**中需要包含背景、矩形、圆角矩形三个图片,命名也需要这个命名 * 进度条图片文件放在**/dailyNote/Template/你的模板/speed/** 文件命名0-100数字 无需%
* icon文件目录**/dailyNote/Template/你的模板/icon/**中需要包含矩形、圆角矩形三个图片,命名也需要这个命名
* 清新版本的背景请放置到**/dailyNote/Template/temp/icon/bg/**下面
*优化正则匹配不至于一直输出 *优化正则匹配不至于一直输出
*修复模板一无派遣的bug *修复模板一无派遣的bug
*优化部分别名 *优化部分别名

View File

@ -220,16 +220,7 @@ export async function Note(e, {
if (mb < 0) { if (mb < 0) {
mb = lodash.random(0, path_url.length - 1); mb = lodash.random(0, path_url.length - 1);
} }
if (mb == 1) { let img_path=`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`;
for (var i = 0; i < 5 - data.expeditions.length; i++) {
data.expeditions.push({
remained_time: 0,
remained_mb2: 0,
percentage: 0,
mb2_icon: ""
})
}
}
var urlFile = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/Template/`); var urlFile = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/Template/`);
var urlType = []; var urlType = [];
for (let val of urlFile) { for (let val of urlFile) {
@ -240,8 +231,18 @@ export async function Note(e, {
if (urlType.length > 0) { if (urlType.length > 0) {
urlType = urlType[lodash.random(0, urlType.length - 1)] urlType = urlType[lodash.random(0, urlType.length - 1)]
} }
// console.log(urlType) if (mb == 1) {
var image = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`); for (var i = 0; i < 5 - data.expeditions.length; i++) {
data.expeditions.push({
remained_time: 0,
remained_mb2: 0,
percentage: 0,
mb2_icon: ""
})
}
img_path=`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/Template/${urlType}${path_img[mb]}`;
}
var image = fs.readdirSync(img_path);
var list_img = []; var list_img = [];
for (let val of image) { for (let val of image) {
list_img.push(val) list_img.push(val)

View File

Before

Width:  |  Height:  |  Size: 626 KiB

After

Width:  |  Height:  |  Size: 626 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 KiB

View File

Before

Width:  |  Height:  |  Size: 628 KiB

After

Width:  |  Height:  |  Size: 628 KiB

View File

@ -4,12 +4,9 @@
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="shortcut icon" href="#" /> <link rel="shortcut icon" href="#" />
<link rel="stylesheet" type="text/css" href="{{_res_path}}dailyNote/Template/{{urlType}}/css/xiaoyao_Note.css?v=1.0" /> <link rel="stylesheet" type="text/css" href="{{_res_path}}dailyNote/Template/{{urlType}}/css/xiaoyao_Note.css?v=1.0" />
<style>
</style>
</head> </head>
<body> <body>
<div class="container" id="container" style=" background-image: url({{_res_path}}/dailyNote/Template/{{urlType}}/icon/背景.png);"> <div class="container" id="container" style=" background-image: url({{_res_path}}/dailyNote/Template/{{urlType}}/icon/bg/{{imgs}});">
<div class="left_model"> <div class="left_model">
<div class="list"> <div class="list">
<div class="div"> <div class="div">