diff --git a/CHANGELOG.md b/CHANGELOG.md index a9827ad..da7da30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ *兼容`体力模板2`可自定义css以及背景icon等 * 模板内容需要具体参考**/dailyNote/Template/temp** * 推荐英文命名文件夹 - * 其中css文件放在**/dailyNote/Template/你的模板/css/xiaoyao_Note.css**这块懒得做命名处理了统一这个命名 - * 进度条图片文件放在**/dailyNote/Template/你的模板/speed/** 文件命名0-100数字 无需% - * icon文件目录**/dailyNote/Template/你的模板/icon/**中需要包含背景、矩形、圆角矩形三个图片,命名也需要这个命名 + * 花里胡哨背景 + * 其中css文件放在**/dailyNote/Template/你的模板/css/xiaoyao_Note.css**这块懒得做命名处理了统一这个命名 + * 进度条图片文件放在**/dailyNote/Template/你的模板/speed/** 文件命名0-100数字 无需% + * icon文件目录**/dailyNote/Template/你的模板/icon/**中需要包含矩形、圆角矩形三个图片,命名也需要这个命名 + * 清新版本的背景请放置到**/dailyNote/Template/temp/icon/bg/**下面 *优化正则匹配不至于一直输出 *修复模板一无派遣的bug *优化部分别名 diff --git a/apps/Note.js b/apps/Note.js index 9d99684..68b5fee 100644 --- a/apps/Note.js +++ b/apps/Note.js @@ -220,16 +220,7 @@ export async function Note(e, { if (mb < 0) { mb = lodash.random(0, path_url.length - 1); } - if (mb == 1) { - for (var i = 0; i < 5 - data.expeditions.length; i++) { - data.expeditions.push({ - remained_time: 0, - remained_mb2: 0, - percentage: 0, - mb2_icon: "" - }) - } - } + let img_path=`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`; var urlFile = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/Template/`); var urlType = []; for (let val of urlFile) { @@ -240,8 +231,18 @@ export async function Note(e, { if (urlType.length > 0) { urlType = urlType[lodash.random(0, urlType.length - 1)] } - // console.log(urlType) - var image = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`); + if (mb == 1) { + 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 = []; for (let val of image) { list_img.push(val) diff --git a/resources/dailyNote/Template/Keqing/icon/背景.png b/resources/dailyNote/Template/Keqing/icon/bg/背景.png similarity index 100% rename from resources/dailyNote/Template/Keqing/icon/背景.png rename to resources/dailyNote/Template/Keqing/icon/bg/背景.png diff --git a/resources/dailyNote/Template/temp/icon/bg/bg_.png b/resources/dailyNote/Template/temp/icon/bg/bg_.png new file mode 100644 index 0000000..a11aacd Binary files /dev/null and b/resources/dailyNote/Template/temp/icon/bg/bg_.png differ diff --git a/resources/dailyNote/Template/temp/icon/背景.png b/resources/dailyNote/Template/temp/icon/bg/背景.png similarity index 100% rename from resources/dailyNote/Template/temp/icon/背景.png rename to resources/dailyNote/Template/temp/icon/bg/背景.png diff --git a/resources/dailyNote/xiaoyao_Note.html b/resources/dailyNote/xiaoyao_Note.html index b24656b..b57a671 100644 --- a/resources/dailyNote/xiaoyao_Note.html +++ b/resources/dailyNote/xiaoyao_Note.html @@ -4,12 +4,9 @@ - -
+