diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ca3aa2a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +# 1.0.0 +* 椰奶插件v1.0 \ No newline at end of file diff --git a/apps/help.js b/apps/help.js index 674c594..7b7c013 100644 --- a/apps/help.js +++ b/apps/help.js @@ -1,73 +1,76 @@ import plugin from '../../../lib/plugins/plugin.js' +import fs from 'fs' +import lodash from 'lodash' +import { segment } from "oicq"; +import puppeteer from '../../../lib/puppeteer/puppeteer.js' +import cfg from '../../../lib/config/config.js' +import { Cfg, Common, Data, Version, Plugin_Name, Plugin_Path } from '../components/index.js' +import Theme from './help/theme.js' -export class Help extends plugin { - constructor() { - super({ - name: '帮助', - dsc: '通知帮助', - event: 'message', - priority: 5000, - rule: [ - { - reg: '^#?通知帮助$', - fnc: 'help' - }, - { - reg: '^#?助手帮助$', - fnc: 'helps' - }, - ] - }) +export class yenai_help extends plugin { + constructor() { + super({ + /** 功能名称 */ + name: '椰奶插件_帮助', + /** 功能描述 */ + dsc: '', + /** https://oicqjs.github.io/oicq/#events */ + event: 'message', + /** 优先级,数字越小等级越高 */ + priority: 2000, + rule: [ + { + /** 命令正则匹配 */ + reg: '^#?椰奶(插件)?帮助$', + /** 执行方法 */ + fnc: 'message' + } + ] + }); + } + + async message() { + return await help(this.e); + } + +} + +async function help(e) { + let custom = {} + let help = {} + + let { diyCfg, sysCfg } = await Data.importCfg('help') + + custom = help + + let helpConfig = lodash.defaults(diyCfg.helpCfg || {}, custom.helpCfg, sysCfg.helpCfg) + let helpList = diyCfg.helpList || custom.helpList || sysCfg.helpList + let helpGroup = [] + + lodash.forEach(helpList, (group) => { + if (group.auth && group.auth === 'master' && !e.isMaster) { + return true } + lodash.forEach(group.list, (help) => { + let icon = help.icon * 1 + if (!icon) { + help.css = 'display:none' + } else { + let x = (icon - 1) % 10 + let y = (icon - x - 1) / 10 + help.css = `background-position:-${x * 50}px -${y * 50}px` + } + }) - // 帮助 - async help() { - let msg = [ - '#闪照通知 (开启|关闭)\n', - '#禁言通知 (开启|关闭)\n', - '#群撤回通知 (开启|关闭)\n', - '#群消息通知 (开启|关闭)\n', - '#群邀请通知 (开启|关闭)\n', - '#好友撤回通知 (开启|关闭)\n', - '#好友消息通知 (开启|关闭)\n', - '#好友申请通知 (开启|关闭)\n', - '#全部管理通知 (开启|关闭)\n', - '#群临时消息通知 (开启|关闭)\n', - '#群管理变动通知 (开启|关闭)\n', - '#群成员变动通知 (开启|关闭)\n', - '#好友列表变动通知 (开启|关闭)\n', - '#群聊列表变动通知 (开启|关闭)\n', - '#设置删除缓存时间 <时间>(s)\n', - '#通知设置', - ] - this.e.reply(msg) - } - async helps(e) { - let msg = [ - "#发群聊 <群号> <内容> \n", - "#发好友 <内容> \n", - "#改头像 <图片> \n", - "#改状态 <状态> \n", - "#改昵称 <昵称> \n", - "#改签名 <签名> \n", - "#改性别 <性别> \n", - "#改群名片 <名片> \n", - "#改群昵称 <昵称> \n", - "#改群头像 <图片> \n", - "#删好友 \n", - "#退群 <群号> \n", - "#获取群列表\n", - "#获取好友列表\n", - "#取说说列表 <页数> \n", - "#发说说 <内容> \n", - "#删说说 <序号>\n", - "#清空说说\n", - "#清空留言\n", - "#取直链 <图片>\n", - "#取face ", - ] - e.reply(msg); - } + helpGroup.push(group) + }) + let themeData = await Theme.getThemeData(diyCfg.helpCfg || {}, sysCfg.helpCfg || {}) + return await Common.render('help/index', { + helpCfg: helpConfig, + helpGroup, + ...themeData, + element: 'default' + }, { e, scale: 1.2 }) } \ No newline at end of file diff --git a/apps/help/theme.js b/apps/help/theme.js new file mode 100644 index 0000000..197372f --- /dev/null +++ b/apps/help/theme.js @@ -0,0 +1,67 @@ +import lodash from 'lodash' +import fs from 'fs' +import { Data , Plugin_Name} from '../../components/index.js' +let Theme = { + async getThemeCfg (theme, exclude) { + let dirPath = `./plugins/${Plugin_Name}/resources/help/theme/` + let ret = [] + let names = [] + let dirs = fs.readdirSync(dirPath) + lodash.forEach(dirs, (dir) => { + if (fs.existsSync(`${dirPath}${dir}/main.png`)) { + names.push(dir) + } + }) + if (lodash.isArray(theme)) { + ret = lodash.intersection(theme, names) + } else if (theme === 'all') { + ret = names + } + if (exclude && lodash.isArray(exclude)) { + ret = lodash.difference(ret, exclude) + } + if (ret.length === 0) { + ret = ['default'] + } + let name = lodash.sample(ret) + let resPath = '{{_res_path}}/help/theme/' + return { + main: `${resPath}${name}/main.png`, + bg: fs.existsSync(`${dirPath}${name}/bg.jpg`) ? `${resPath}${name}/bg.jpg` : `${resPath}default/bg.jpg`, + style: (await Data.importModule(`resources/help/theme/${name}/config.js`)).style || {} + } + }, + async getThemeData (diyStyle, sysStyle) { + let helpConfig = lodash.extend({}, sysStyle, diyStyle) + let colCount = Math.min(5, Math.max(parseInt(helpConfig?.colCount) || 3, 2)) + let colWidth = Math.min(500, Math.max(100, parseInt(helpConfig?.colWidth) || 265)) + let width = Math.min(2500, Math.max(800, colCount * colWidth + 30)) + let theme = await Theme.getThemeCfg(helpConfig.theme, diyStyle.themeExclude || sysStyle.themeExclude) + let themeStyle = theme.style || {} + let ret = [` + body{background-image:url(${theme.bg});width:${width}px;} + .container{background-image:url(${theme.main});width:${width}px;} + .help-table .td,.help-table .th{width:${100 / colCount}%} + `] + let css = function (sel, css, key, def, fn) { + let val = Data.def(themeStyle[key], diyStyle[key], sysStyle[key], def) + if (fn) { + val = fn(val) + } + ret.push(`${sel}{${css}:${val}}`) + } + css('.help-title,.help-group', 'color', 'fontColor', '#ceb78b') + css('.help-title,.help-group', 'text-shadow', 'fontShadow', 'none') + css('.help-desc', 'color', 'descColor', '#eee') + css('.cont-box', 'background', 'contBgColor', 'rgba(43, 52, 61, 0.8)') + css('.cont-box', 'backdrop-filter', 'contBgBlur', 3, (n) => diyStyle.bgBlur === false ? 'none' : `blur(${n}px)`) + css('.help-group', 'background', 'headerBgColor', 'rgba(34, 41, 51, .4)') + css('.help-table .tr:nth-child(odd)', 'background', 'rowBgColor1', 'rgba(34, 41, 51, .2)') + css('.help-table .tr:nth-child(even)', 'background', 'rowBgColor2', 'rgba(34, 41, 51, .4)') + return { + style: ``, + colCount + } + } +} +export default Theme diff --git a/components/Cfg.js b/components/Cfg.js new file mode 100644 index 0000000..4b2e50e --- /dev/null +++ b/components/Cfg.js @@ -0,0 +1,45 @@ +import fs from 'fs' +import lodash from 'lodash' + +const _path = process.cwd() +const _cfgPath = `${_path}/plugins/yenai-plugin/components/` +let cfg = {} + +try { + if (fs.existsSync(_cfgPath + 'cfg.json')) { + cfg = JSON.parse(fs.readFileSync(_cfgPath + 'cfg.json', 'utf8')) || {} + } +} catch (e) { + // do nth +} + +let Cfg = { + get(rote, def = '') { + return lodash.get(cfg, rote, def) + }, + set(rote, val) { + lodash.set(cfg, rote, val) + fs.writeFileSync(_cfgPath + 'cfg.json', JSON.stringify(cfg, null, '\t')) + }, + del(rote) { + lodash.set(cfg, rote, undefined) + fs.writeFileSync(_cfgPath + 'cfg.json', JSON.stringify(cfg, null, '\t')) + }, + scale(pct = 1) { + let scale = Cfg.get('sys.scale', 100) + scale = Math.min(2, Math.max(0.5, scale / 100)) + pct = pct * scale + return `style=transform:scale(${pct})` + }, + isDisable(e, rote) { + if (Cfg.get(rote, true)) { + return false + } + if (/^#*小飞/.test(e.msg || '')) { + return false + } + return true + } +} + +export default Cfg diff --git a/components/Common.js b/components/Common.js new file mode 100644 index 0000000..23ce2b0 --- /dev/null +++ b/components/Common.js @@ -0,0 +1,13 @@ +import Cfg from './Cfg.js' +import render from './common-lib/render.js' + +function sleep (ms) { + return new Promise((resolve) => setTimeout(resolve, ms)) +} + +export default { + render, + cfg: Cfg.get, + isDisable: Cfg.isDisable, + sleep +} diff --git a/components/Config.js b/components/Config.js new file mode 100644 index 0000000..2242f2e --- /dev/null +++ b/components/Config.js @@ -0,0 +1,107 @@ +import YAML from 'yaml' +import chokidar from 'chokidar' +import fs from 'node:fs' + +const Path = process.cwd(); +const Plugin_Name = 'yenai-plugin' +const Plugin_Path = `${Path}/plugins/${Plugin_Name}`; +class Config { + constructor() { + this.config = {} + + /** 监听文件 */ + this.watcher = {} + + this.ignore = [] + } + + /** + * @param app 功能 + * @param name 配置文件名称 + */ + getdefSet(app, name) { + return this.getYaml(app, name, 'defSet') + } + + /** 用户配置 */ + getConfig(app, name) { + return this.getYaml(app, name, 'config') + } + + /** + * 获取配置yaml + * @param app 功能 + * @param name 名称 + * @param type 默认跑配置-defSet,用户配置-config + */ + getYaml(app, name, type) { + let file = this.getFilePath(app, name, type) + let key = `${app}.${name}` + + if (this.config[type][key]) return this.config[type][key] + + try { + this.config[type][key] = YAML.parse( + fs.readFileSync(file, 'utf8') + ) + } catch (error) { + logger.error(`[${app}][${name}] 格式错误 ${error}`) + return false + } + + this.watch(file, app, name, type) + + return this[type][key] + } + + getFilePath(app, name, type) { + if (!this.config[type]) { + this.config[type] = {}; + } + + if (!this.watcher[type]) { + this.watcher[type] = {}; + } + + let config_path = `${Plugin_Path}/${type}/`; + let file = `${config_path}${app}.${name}.yaml`; + try { + if (!fs.existsSync(file)) { + let default_file = `${config_path}default/${app}.${name}.yaml`; + fs.copyFileSync(default_file, file); + } + } catch (err) { } + return file; + } + + /** 监听配置文件 */ + watch(file, app, name, type = 'defSet') { + let key = `${app}.${name}` + + if (this.watcher[type][key]) return + + const watcher = chokidar.watch(file) + watcher.on('change', path => { + delete this[type][key] + logger.mark(`[修改配置文件][${type}][${app}][${name}]`) + if (this[`change_${app}${name}`]) { + this[`change_${app}${name}`]() + } + }) + + this.watcher[type][key] = watcher + } + + + save(app, name, type) { + let file = this.getFilePath(app, name, type) + if (lodash.isEmpty(data)) { + fs.existsSync(file) && fs.unlinkSync(file) + } else { + let yaml = YAML.stringify(data) + fs.writeFileSync(file, yaml, 'utf8') + } + } + +} +export default new Config() \ No newline at end of file diff --git a/components/Data.js b/components/Data.js new file mode 100644 index 0000000..405496b --- /dev/null +++ b/components/Data.js @@ -0,0 +1,224 @@ +import lodash from 'lodash' +import fs from 'fs' + +const _path = process.cwd() +const plugin = 'yenai-plugin' +const getRoot = (root = '') => { + if (root === 'root' || root === 'yunzai') { + root = `${_path}/` + } else if (!root) { + root = `${_path}/plugins/${plugin}/` + } + return root +} + +let Data = { + + /* + * 根据指定的path依次检查与创建目录 + * */ + createDir(path = '', root = '', includeFile = false) { + root = getRoot(root) + let pathList = path.split('/') + let nowPath = root + pathList.forEach((name, idx) => { + name = name.trim() + if (!includeFile && idx <= pathList.length - 1) { + nowPath += name + '/' + if (name) { + if (!fs.existsSync(nowPath)) { + fs.mkdirSync(nowPath) + } + } + } + }) + }, + + /* + * 读取json + * */ + readJSON(file = '', root = '') { + root = getRoot(root) + if (fs.existsSync(`${root}/${file}`)) { + try { + return JSON.parse(fs.readFileSync(`${root}/${file}`, 'utf8')) + } catch (e) { + console.log(e) + } + } + return {} + }, + + /* + * 写JSON + * */ + writeJSON(file, data, space = '\t', root = '') { + // 检查并创建目录 + Data.createDir(file, root, true) + root = getRoot(root) + delete data._res + return fs.writeFileSync(`${root}/${file}`, JSON.stringify(data, null, space)) + }, + + async getCacheJSON(key) { + try { + let txt = await redis.get(key) + if (txt) { + return JSON.parse(txt) + } + } catch (e) { + console.log(e) + } + return {} + }, + + async setCacheJSON(key, data, EX = 3600 * 24 * 90) { + await redis.set(key, JSON.stringify(data), { EX }) + }, + + async importModule(file, root = '') { + root = getRoot(root) + if (!/\.js$/.test(file)) { + file = file + '.js' + } + if (fs.existsSync(`${root}/${file}`)) { + try { + let data = await import(`file://${root}/${file}?t=${new Date() * 1}`) + return data || {} + } catch (e) { + console.log(e) + } + } + return {} + }, + + async importDefault(file, root) { + let ret = await Data.importModule(file, root) + return ret.default || {} + }, + + async import(name) { + return await Data.importModule(`components/optional-lib/${name}.js`) + }, + + async importCfg(key) { + let sysCfg = await Data.importModule(`config/system/${key}_system.js`) + let diyCfg = await Data.importModule(`config/${key}.js`) + if (diyCfg.isSys) { + console.error(`miao-plugin: config/${key}.js无效,已忽略`) + console.error(`如需配置请复制config/${key}_default.js为config/${key}.js,请勿复制config/system下的系统文件`) + diyCfg = {} + } + return { + sysCfg, + diyCfg + } + }, + + /* + * 返回一个从 target 中选中的属性的对象 + * + * keyList : 获取字段列表,逗号分割字符串 + * key1, key2, toKey1:fromKey1, toKey2:fromObj.key + * + * defaultData: 当某个字段为空时会选取defaultData的对应内容 + * toKeyPrefix:返回数据的字段前缀,默认为空。defaultData中的键值无需包含toKeyPrefix + * + * */ + + getData(target, keyList = '', cfg = {}) { + target = target || {} + let defaultData = cfg.defaultData || {} + let ret = {} + // 分割逗号 + if (typeof (keyList) === 'string') { + keyList = keyList.split(',') + } + + lodash.forEach(keyList, (keyCfg) => { + // 处理通过:指定 toKey & fromKey + let _keyCfg = keyCfg.split(':') + let keyTo = _keyCfg[0].trim() + let keyFrom = (_keyCfg[1] || _keyCfg[0]).trim() + let keyRet = keyTo + if (cfg.lowerFirstKey) { + keyRet = lodash.lowerFirst(keyRet) + } + if (cfg.keyPrefix) { + keyRet = cfg.keyPrefix + keyRet + } + // 通过Data.getVal获取数据 + ret[keyRet] = Data.getVal(target, keyFrom, defaultData[keyTo], cfg) + }) + return ret + }, + + getVal(target, keyFrom, defaultValue) { + return lodash.get(target, keyFrom, defaultValue) + }, + + // 异步池,聚合请求 + async asyncPool(poolLimit, array, iteratorFn) { + const ret = [] // 存储所有的异步任务 + const executing = [] // 存储正在执行的异步任务 + for (const item of array) { + // 调用iteratorFn函数创建异步任务 + const p = Promise.resolve().then(() => iteratorFn(item, array)) + // 保存新的异步任务 + ret.push(p) + + // 当poolLimit值小于或等于总任务个数时,进行并发控制 + if (poolLimit <= array.length) { + // 当任务完成后,从正在执行的任务数组中移除已完成的任务 + const e = p.then(() => executing.splice(executing.indexOf(e), 1)) + executing.push(e) // 保存正在执行的异步任务 + if (executing.length >= poolLimit) { + // 等待较快的任务执行完成 + await Promise.race(executing) + } + } + } + return Promise.all(ret) + }, + + // sleep + sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)) + }, + + // 获取默认值 + def() { + for (let idx in arguments) { + if (!lodash.isUndefined(arguments[idx])) { + return arguments[idx] + } + } + }, + + // 循环字符串回调 + eachStr: (arr, fn) => { + if (lodash.isString(arr)) { + arr = arr.replace(/\s*(;|;|、|,)\s*/, ',') + arr = arr.split(',') + } else if (lodash.isNumber(arr)) { + arr = [arr.toString()] + } + lodash.forEach(arr, (str, idx) => { + if (!lodash.isUndefined(str)) { + fn(str.trim ? str.trim() : str, idx) + } + }) + }, + + regRet(reg, txt, idx) { + if (reg && txt) { + let ret = reg.exec(txt) + if (ret && ret[idx]) { + return ret[idx] + } + } + return false + } +} + +export default Data diff --git a/components/Version.js b/components/Version.js new file mode 100644 index 0000000..6959ebd --- /dev/null +++ b/components/Version.js @@ -0,0 +1,100 @@ +import fs from 'fs' +import lodash from 'lodash' +import cfg from '../../../lib/config/config.js' +const Plugin_Path = `${process.cwd()}/plugins/yenai-plugin`; +const README_path = `${Plugin_Path}/README.md` +const CHANGELOG_path = `${Plugin_Path}/CHANGELOG.md` +const yunzai_ver = `v${cfg.package.version}`; + +let logs = {} +let changelogs = [] +let currentVersion +let versionCount = 6 + +const getLine = function (line) { + line = line.replace(/(^\s*\*|\r)/g, '') + line = line.replace(/\s*`([^`]+`)/g, '$1') + line = line.replace(/`\s*/g, '') + line = line.replace(/\s*\*\*([^\*]+\*\*)/g, '$1') + line = line.replace(/\*\*\s*/g, '') + line = line.replace(/ⁿᵉʷ/g, '') + return line +} + +try { + if (fs.existsSync(CHANGELOG_path)) { + logs = fs.readFileSync(CHANGELOG_path, 'utf8') || '' + logs = logs.replace(/\t/g,' ').split('\n') + let temp = {}; + let lastLine = {} + lodash.forEach(logs, (line) => { + if (versionCount <= -1) { + return false + } + let versionRet = /^#\s*([0-9a-zA-Z\\.~\s]+?)\s*$/.exec(line.trim()) + if (versionRet && versionRet[1]) { + let v = versionRet[1].trim() + if (!currentVersion) { + currentVersion = v + } else { + changelogs.push(temp) + if (/0\s*$/.test(v) && versionCount > 0) { + //versionCount = 0 + versionCount-- + } else { + versionCount-- + } + } + temp = { + version: v, + logs: [] + } + } else { + if (!line.trim()) { + return + } + if (/^\*/.test(line)) { + lastLine = { + title: getLine(line), + logs: [] + } + if(!temp.logs){ + temp = { + version: line, + logs: [] + } + } + temp.logs.push(lastLine) + } else if (/^\s{2,}\*/.test(line)) { + lastLine.logs.push(getLine(line)) + } + } + }) + } +} catch (e) { + logger.error(e); + // do nth +} + +try{ + if(fs.existsSync(README_path)){ + let README = fs.readFileSync(README_path, 'utf8') || '' + let reg = /版本:(.*)/.exec(README) + if(reg){ + currentVersion = reg[1] + } + } +}catch(err){} + +let Version = { + get ver () { + return currentVersion; + }, + get yunzai(){ + return yunzai_ver; + }, + get logs(){ + return changelogs; + } +} +export default Version \ No newline at end of file diff --git a/components/cfg.json b/components/cfg.json new file mode 100644 index 0000000..e9aae3e --- /dev/null +++ b/components/cfg.json @@ -0,0 +1,15 @@ +{ + "sys": { + "help": true, + "scale": 100 + }, + "char": { + "wife": false, + "char": true + }, + "wiki": { + "abyss": true, + "wiki": false, + "stat": true + } +} \ No newline at end of file diff --git a/components/common-lib/render.js b/components/common-lib/render.js new file mode 100644 index 0000000..479a55f --- /dev/null +++ b/components/common-lib/render.js @@ -0,0 +1,53 @@ +import { Data, Version, Plugin_Name } from '../index.js' +import Cfg from '../Cfg.js' +import fs from 'fs' +import puppeteer from '../../../../lib/puppeteer/puppeteer.js' + +const _path = process.cwd() + +export default async function (path, params, cfg) { + let [app, tpl] = path.split('/') + let { e } = cfg + let layoutPath = process.cwd() + `/plugins/${Plugin_Name}/resources/common/layout/` + let resPath = `../../../../../plugins/${Plugin_Name}/resources/` + Data.createDir(`data/html/${Plugin_Name}/${app}/${tpl}`, 'root') + let data = { + ...params, + _plugin: Plugin_Name, + saveId: params.saveId || params.save_id || tpl, + tplFile: `./plugins/${Plugin_Name}/resources/${app}/${tpl}.html`, + pluResPath: resPath, + _res_path: resPath, + _layout_path: layoutPath, + _tpl_path: process.cwd() + `/plugins/${Plugin_Name}/resources/common/tpl/`, + defaultLayout: layoutPath + 'default.html', + elemLayout: layoutPath + 'elem.html', + pageGotoParams: { + waitUntil: 'networkidle0' + }, + sys: { + scale: Cfg.scale(cfg.scale || 1), + copyright: `Created By Yunzai-Bot${Version.yunzai} & yenai-PluginV1.0.0` + }, + quality: 100 + } + + + if (process.argv.includes('web-debug')) { + // debug下保存当前页面的渲染数据,方便模板编写与调试 + // 由于只用于调试,开发者只关注自己当时开发的文件即可,暂不考虑app及plugin的命名冲突 + let saveDir = _path + '/data/ViewData/' + if (!fs.existsSync(saveDir)) { + fs.mkdirSync(saveDir) + } + let file = saveDir + tpl + '.json' + data._app = app + fs.writeFileSync(file, JSON.stringify(data)) + } + let base64 = await puppeteer.screenshot(`${Plugin_Name}/${app}/${tpl}`, data) + let ret = true + if (base64) { + ret = await e.reply(base64) + } + return cfg.retMsgId ? ret : true +} diff --git a/components/index.js b/components/index.js new file mode 100644 index 0000000..7a797f1 --- /dev/null +++ b/components/index.js @@ -0,0 +1,10 @@ +const Path = process.cwd(); +const Plugin_Name = 'yenai-plugin' +const Plugin_Path = `${Path}/plugins/${Plugin_Name}`; +import Version from './Version.js' +import Data from './Data.js' +import Cfg from './Cfg.js' +import Common from './Common.js' +import Config from './Config.js' + +export { Cfg, Common, Config, Data, Version, Path, Plugin_Name, Plugin_Path } \ No newline at end of file diff --git a/config/system/help_system.js b/config/system/help_system.js new file mode 100644 index 0000000..da7bf6b --- /dev/null +++ b/config/system/help_system.js @@ -0,0 +1,83 @@ +/* +* 此配置文件为系统使用,请勿修改,否则可能无法正常使用 +* +* 如需自定义配置请复制修改上一级help_default.js +* +* */ + +export const helpCfg = { + title: '椰奶帮助', + subTitle: 'Yunzai-Bot & Yenai-Plugin', + columnCount: 3, + colWidth: 265, + theme: 'all', + themeExclude: ['default'], + style: { + fontColor: '#ceb78b', + descColor: '#eee', + contBgColor: 'rgba(6, 21, 31, .5)', + contBgBlur: 3, + headerBgColor: 'rgba(6, 21, 31, .4)', + rowBgColor1: 'rgba(6, 21, 31, .2)', + rowBgColor2: 'rgba(6, 21, 31, .35)' + } +} + +export const helpList = [{ + "group": "助手", + "list": [{ + "icon": 61, + "title": "#发好友 <消息>", "desc": "给好友发送一条涩涩的消息" + }, + { + "icon": 64, + "title": "#发群聊 <群号> <消息>", + "desc": "给群聊发送一条涩涩的消息" + }, + { + "icon": 66, + "title": "#改头像 <图片>", + "desc": "顾名思义" + }, + { "icon": 62, "title": "#改状态 <状态> ", "desc": "顾名思义" }, + { "icon": 58, "title": "#改昵称 <昵称> ", "desc": "顾名思义" }, + { "icon": 59, "title": "#改签名 <签名> ", "desc": "查看老婆、老公" }, + { "title": "#改性别 <性别> ", "desc": "顾名思义", "icon": 71 }, + { "title": "#改群名片 <名片> ", "desc": "群里Bot自己的名片", "icon": 29 }, + { "title": "#改群昵称 <昵称>", "desc": "改群的昵称", "icon": 57 }, + { "title": "#改群头像 <图片>", "desc": "顾名思义", "icon": 46 }, + { "title": "#删好友 ", "desc": "删掉涩涩的好友", "icon": 71 }, + { "title": "#退群 <群号> ", "desc": "退掉涩涩的群", "icon": 32 }, + { "title": "#获取群列表", "desc": "获取Bot的所有群", "icon": 30 }, + { "title": "#获取好友列表", "desc": "获取Bot的所有好友", "icon": 54 }, + { "title": "#取说说列表 <页数> ", "desc": "获取Bot的说说列表", "icon": 29 }, + { "title": "#发说说 <内容> ", "desc": "发送一条涩涩的说说", "icon": 71 }, + { "title": "#删说说 <序号>", "desc": "用取说说列表获取序号", "icon": 54 }, + { "title": "#清空说说", "desc": "一键清空", "icon": 48 }, + { "title": "#清空留言", "desc": "一键清空留言", "icon": 57 }] +}, +{ + "group": "通知", + "desc": "需要绑定cookie", + "list": [{ + "icon": 15, + "title": "#通知设置", + "desc": "各种通知" + }] +}, +{ + "group": "管理命令,仅管理员可用", + "auth": "master", + "list": [{ + "icon": 32, + "title": "#椰奶设置", + "desc": "正在施工中" + }, + { + "icon": 35, + "title": "#椰奶(强制)更新", + "desc": "更新椰奶" + }] +}] + +export const isSys = true diff --git a/config/system/请勿修改此目录下的文件.txt b/config/system/请勿修改此目录下的文件.txt new file mode 100644 index 0000000..e67fd6e --- /dev/null +++ b/config/system/请勿修改此目录下的文件.txt @@ -0,0 +1,3 @@ +此目录为系统配置目录 +请勿修改此目录下的文件,否则可能导致工作不正常 +如需配置,可配置上级目录,复制对应_default.js 文件进行配置 \ No newline at end of file diff --git a/resources/common/base.css b/resources/common/base.css new file mode 100644 index 0000000..9916185 --- /dev/null +++ b/resources/common/base.css @@ -0,0 +1,7 @@ +.font-ys { + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +.font-nzbz { + font-family: Number, "印品南征北战NZBZ体", NZBZ, PingFangSC-Medium, "PingFang SC", sans-serif; +} +/*# sourceMappingURL=base.css.map */ \ No newline at end of file diff --git a/resources/common/base.less b/resources/common/base.less new file mode 100644 index 0000000..e065b8b --- /dev/null +++ b/resources/common/base.less @@ -0,0 +1,7 @@ +.font-YS { + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} + +.font-NZBZ { + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} \ No newline at end of file diff --git a/resources/common/bg/bg-anemo.jpg b/resources/common/bg/bg-anemo.jpg new file mode 100644 index 0000000..985a7d4 Binary files /dev/null and b/resources/common/bg/bg-anemo.jpg differ diff --git a/resources/common/bg/bg-cryo.jpg b/resources/common/bg/bg-cryo.jpg new file mode 100644 index 0000000..cf4bd1d Binary files /dev/null and b/resources/common/bg/bg-cryo.jpg differ diff --git a/resources/common/bg/bg-dendro.jpg b/resources/common/bg/bg-dendro.jpg new file mode 100644 index 0000000..b900d28 Binary files /dev/null and b/resources/common/bg/bg-dendro.jpg differ diff --git a/resources/common/bg/bg-electro.jpg b/resources/common/bg/bg-electro.jpg new file mode 100644 index 0000000..5dec746 Binary files /dev/null and b/resources/common/bg/bg-electro.jpg differ diff --git a/resources/common/bg/bg-geo.jpg b/resources/common/bg/bg-geo.jpg new file mode 100644 index 0000000..d68405f Binary files /dev/null and b/resources/common/bg/bg-geo.jpg differ diff --git a/resources/common/bg/bg-hydro.jpg b/resources/common/bg/bg-hydro.jpg new file mode 100644 index 0000000..cc262f7 Binary files /dev/null and b/resources/common/bg/bg-hydro.jpg differ diff --git a/resources/common/bg/bg-pyro.jpg b/resources/common/bg/bg-pyro.jpg new file mode 100644 index 0000000..302d612 Binary files /dev/null and b/resources/common/bg/bg-pyro.jpg differ diff --git a/resources/common/bg/talent-anemo.png b/resources/common/bg/talent-anemo.png new file mode 100644 index 0000000..e9926f2 Binary files /dev/null and b/resources/common/bg/talent-anemo.png differ diff --git a/resources/common/bg/talent-cryo.png b/resources/common/bg/talent-cryo.png new file mode 100644 index 0000000..2defb36 Binary files /dev/null and b/resources/common/bg/talent-cryo.png differ diff --git a/resources/common/bg/talent-dendro.png b/resources/common/bg/talent-dendro.png new file mode 100644 index 0000000..2359d71 Binary files /dev/null and b/resources/common/bg/talent-dendro.png differ diff --git a/resources/common/bg/talent-electro.png b/resources/common/bg/talent-electro.png new file mode 100644 index 0000000..8e3c59d Binary files /dev/null and b/resources/common/bg/talent-electro.png differ diff --git a/resources/common/bg/talent-geo.png b/resources/common/bg/talent-geo.png new file mode 100644 index 0000000..87d7d0d Binary files /dev/null and b/resources/common/bg/talent-geo.png differ diff --git a/resources/common/bg/talent-hydro.png b/resources/common/bg/talent-hydro.png new file mode 100644 index 0000000..9408117 Binary files /dev/null and b/resources/common/bg/talent-hydro.png differ diff --git a/resources/common/bg/talent-pyro.png b/resources/common/bg/talent-pyro.png new file mode 100644 index 0000000..3349fde Binary files /dev/null and b/resources/common/bg/talent-pyro.png differ diff --git a/resources/common/common.css b/resources/common/common.css new file mode 100644 index 0000000..c3a191a --- /dev/null +++ b/resources/common/common.css @@ -0,0 +1,455 @@ +@font-face { + font-family: 'Number'; + src: url("./font/tttgbnumber.woff") format('woff'), url("./font/tttgbnumber.ttf") format('truetype'); +} +@font-face { + font-family: 'NZBZ'; + src: url("./font/NZBZ.woff") format('woff'), url("./font/NZBZ.ttf") format('truetype'); +} +@font-face { + font-family: 'YS'; + src: url("./font/HYWH-65W.woff") format('woff'), url("./font/HYWH-65W.ttf") format('truetype'); +} +.font-YS { + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +.font-NZBZ { + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; +} +* { + margin: 0; + padding: 0; + box-sizing: border-box; + -webkit-user-select: none; + user-select: none; +} +body { + font-size: 18px; + color: #1e1f20; + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; + transform: scale(1.4); + transform-origin: 0 0; + width: 600px; +} +.container { + width: 600px; + padding: 20px 15px 10px 15px; + background-size: contain; +} +.head-box { + border-radius: 15px; + padding: 10px 20px; + position: relative; + color: #fff; + margin-top: 30px; +} +.head-box .title { + font-family: Number, "印品南征北战NZBZ体", NZBZ, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; + font-size: 36px; + text-shadow: 0 0 1px #000, 1px 1px 3px rgba(0, 0, 0, 0.9); +} +.head-box .title .label { + display: inline-block; + margin-left: 10px; +} +.head-box .genshin_logo { + position: absolute; + top: 1px; + right: 15px; + width: 97px; +} +.head-box .label { + font-size: 16px; + text-shadow: 0 0 1px #000, 1px 1px 3px rgba(0, 0, 0, 0.9); +} +.head-box .label span { + color: #d3bc8e; + padding: 0 2px; +} +.notice { + color: #888; + font-size: 12px; + text-align: right; + padding: 12px 5px 5px; +} +.notice-center { + color: #fff; + text-align: center; + margin-bottom: 10px; + text-shadow: 1px 1px 1px #333; +} +.copyright { + font-size: 14px; + text-align: center; + color: #fff; + position: relative; + padding-left: 10px; + text-shadow: 1px 1px 1px #000; + margin: 10px 0; +} +.copyright .version { + color: #d3bc8e; + display: inline-block; + padding: 0 3px; +} +/* */ +.cons { + display: inline-block; + vertical-align: middle; + padding: 0 5px; + border-radius: 4px; +} +.cons-0 { + background: #666; + color: #fff; +} +.cons-n0 { + background: #404949; + color: #fff; +} +.cons-1 { + background: #5cbac2; + color: #fff; +} +.cons-2 { + background: #339d61; + color: #fff; +} +.cons-3 { + background: #3e95b9; + color: #fff; +} +.cons-4 { + background: #3955b7; + color: #fff; +} +.cons-5 { + background: #531ba9cf; + color: #fff; +} +.cons-6 { + background: #ff5722; + color: #fff; +} +.cons2-0 { + border-radius: 4px; + background: #666; + color: #fff; +} +.cons2-1 { + border-radius: 4px; + background: #71b1b7; + color: #fff; +} +.cons2-2 { + border-radius: 4px; + background: #369961; + color: #fff; +} +.cons2-3 { + border-radius: 4px; + background: #4596b9; + color: #fff; +} +.cons2-4 { + border-radius: 4px; + background: #4560b9; + color: #fff; +} +.cons2-5 { + border-radius: 4px; + background: #531ba9cf; + color: #fff; +} +.cons2-6 { + border-radius: 4px; + background: #ff5722; + color: #fff; +} +/******** Fetter ********/ +.fetter { + width: 50px; + height: 50px; + display: inline-block; + background: url('./item/fetter.png'); + background-size: auto 100%; +} +.fetter.fetter1 { + background-position: 0% 0; +} +.fetter.fetter2 { + background-position: 11.11111111% 0; +} +.fetter.fetter3 { + background-position: 22.22222222% 0; +} +.fetter.fetter4 { + background-position: 33.33333333% 0; +} +.fetter.fetter5 { + background-position: 44.44444444% 0; +} +.fetter.fetter6 { + background-position: 55.55555556% 0; +} +.fetter.fetter7 { + background-position: 66.66666667% 0; +} +.fetter.fetter8 { + background-position: 77.77777778% 0; +} +.fetter.fetter9 { + background-position: 88.88888889% 0; +} +.fetter.fetter10 { + background-position: 100% 0; +} +/******** ELEM ********/ +.elem-hydro .talent-icon { + background-image: url("./bg/talent-hydro.png"); +} +.elem-hydro .elem-bg, +.hydro-bg { + background-image: url("./bg/bg-hydro.jpg"); +} +.elem-anemo .talent-icon { + background-image: url("./bg/talent-anemo.png"); +} +.elem-anemo .elem-bg, +.anemo-bg { + background-image: url("./bg/bg-anemo.jpg"); +} +.elem-cryo .talent-icon { + background-image: url("./bg/talent-cryo.png"); +} +.elem-cryo .elem-bg, +.cryo-bg { + background-image: url("./bg/bg-cryo.jpg"); +} +.elem-electro .talent-icon { + background-image: url("./bg/talent-electro.png"); +} +.elem-electro .elem-bg, +.electro-bg { + background-image: url("./bg/bg-electro.jpg"); +} +.elem-geo .talent-icon { + background-image: url("./bg/talent-geo.png"); +} +.elem-geo .elem-bg, +.geo-bg { + background-image: url("./bg/bg-geo.jpg"); +} +.elem-pyro .talent-icon { + background-image: url("./bg/talent-pyro.png"); +} +.elem-pyro .elem-bg, +.pyro-bg { + background-image: url("./bg/bg-pyro.jpg"); +} +.elem-dendro .talent-icon { + background-image: url("./bg/talent-dendro.png"); +} +.elem-dendro .elem-bg, +.dendro-bg { + background-image: url("./bg/bg-dendro.jpg"); +} +/* cont */ +.cont { + border-radius: 10px; + background: url("../common/cont/card-bg.png") top left repeat-x; + background-size: auto 100%; + margin: 5px 15px 5px 10px; + position: relative; + box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, 0.8); + overflow: hidden; + color: #fff; + font-size: 16px; +} +.cont-title { + background: rgba(0, 0, 0, 0.4); + box-shadow: 0 0 1px 0 #fff; + color: #d3bc8e; + padding: 10px 20px; + text-align: left; + border-radius: 10px 10px 0 0; +} +.cont-title span { + font-size: 12px; + color: #aaa; + margin-left: 10px; + font-weight: normal; +} +.cont-title.border-less { + background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + box-shadow: none; + padding-bottom: 5px; +} +.cont-body { + padding: 10px 15px; + font-size: 12px; + background: rgba(0, 0, 0, 0.5); + box-shadow: 0 0 1px 0 #fff; + font-weight: normal; +} +.cont-footer { + padding: 10px 15px; + font-size: 12px; + background: rgba(0, 0, 0, 0.5); + font-weight: normal; +} +.cont > ul.cont-msg { + display: block; + padding: 5px 10px; + background: rgba(0, 0, 0, 0.5); +} +ul.cont-msg, +.cont-footer ul { + padding-left: 15px; +} +ul.cont-msg li, +.cont-footer ul li { + margin: 5px 0; + margin-left: 15px; +} +ul.cont-msg li strong, +.cont-footer ul li strong { + font-weight: normal; + margin: 0 2px; + color: #d3bc8e; +} +.cont-table { + display: table; + width: 100%; +} +.cont-table .tr { + display: table-row; +} +.cont-table .tr:nth-child(even) { + background: rgba(0, 0, 0, 0.4); +} +.cont-table .tr:nth-child(odd) { + background: rgba(50, 50, 50, 0.4); +} +.cont-table .tr > div, +.cont-table .tr > td { + display: table-cell; + box-shadow: 0 0 1px 0 #fff; +} +.cont-table .tr > div.value-full { + display: table; + width: 200%; +} +.cont-table .tr > div.value-none { + box-shadow: none; +} +.cont-table .thead { + text-align: center; +} +.cont-table .thead > div, +.cont-table .thead > td { + color: #d3bc8e; + background: rgba(0, 0, 0, 0.4); + line-height: 40px; + height: 40px; +} +.cont-table .title, +.cont-table .th { + color: #d3bc8e; + padding-right: 15px; + text-align: right; + background: rgba(0, 0, 0, 0.4); + min-width: 100px; + vertical-align: middle; +} +.logo { + font-size: 18px; + text-align: center; + color: #fff; + margin: 20px 0 10px 0; +} +/* item-icon */ +.item-icon { + width: 100%; + height: 100%; + border-radius: 4px; + position: relative; + overflow: hidden; +} +.item-icon .img { + width: 100%; + height: 100%; + display: block; + background-size: contain; + background-position: center; + background-repeat: no-repeat; +} +.item-icon.artis .img { + width: 84%; + height: 84%; + margin: 8%; +} +.item-icon.star1 { + background-image: url("../common/item/bg1.png"); +} +.item-icon.opacity-bg.star1 { + background-image: url("../common/item/bg1-o.png"); +} +.item-icon.star2 { + background-image: url("../common/item/bg2.png"); +} +.item-icon.opacity-bg.star2 { + background-image: url("../common/item/bg2-o.png"); +} +.item-icon.star3 { + background-image: url("../common/item/bg3.png"); +} +.item-icon.opacity-bg.star3 { + background-image: url("../common/item/bg3-o.png"); +} +.item-icon.star4 { + background-image: url("../common/item/bg4.png"); +} +.item-icon.opacity-bg.star4 { + background-image: url("../common/item/bg4-o.png"); +} +.item-icon.star5 { + background-image: url("../common/item/bg5.png"); +} +.item-icon.opacity-bg.star5 { + background-image: url("../common/item/bg5-o.png"); +} +.item-list { + display: flex; +} +.item-list .item-card { + width: 70px; + background: #e7e5d9; +} +.item-list .item-icon { + border-bottom-left-radius: 0; + border-bottom-right-radius: 12px; +} +.item-list .item-title { + color: #222; + font-size: 13px; + text-align: center; + padding: 2px; + white-space: nowrap; + overflow: hidden; +} +.item-list .item-icon { + height: initial; +} +.item-list .item-badge { + position: absolute; + display: block; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.6); + font-size: 12px; + color: #fff; + padding: 4px 5px 3px; + border-radius: 0 0 6px 0; +} +/*# sourceMappingURL=common.css.map */ \ No newline at end of file diff --git a/resources/common/common.less b/resources/common/common.less new file mode 100644 index 0000000..85fad95 --- /dev/null +++ b/resources/common/common.less @@ -0,0 +1,390 @@ +.font(@name, @file) { + @font-face { + font-family: @name; + src: url("./font/@{file}.woff") format('woff'), url("./font/@{file}.ttf") format('truetype'); + } +} + +.font('Number', 'tttgbnumber'); +.font('NZBZ', 'NZBZ'); +.font('YS', 'HYWH-65W'); + +@import "base.less"; + +* { + margin: 0; + padding: 0; + box-sizing: border-box; + -webkit-user-select: none; + user-select: none; +} + +body { + font-size: 18px; + color: #1e1f20; + font-family: Number, "汉仪文黑-65W", YS, PingFangSC-Medium, "PingFang SC", sans-serif; + transform: scale(1.4); + transform-origin: 0 0; + width: 600px; +} + +.container { + width: 600px; + padding: 20px 15px 10px 15px; + background-size: contain; +} + + +.head-box { + border-radius: 15px; + padding: 10px 20px; + position: relative; + color: #fff; + margin-top: 30px; + + .title { + .font-NZBZ; + font-size: 36px; + text-shadow: 0 0 1px #000, 1px 1px 3px rgba(0, 0, 0, .9); + + .label { + display: inline-block; + margin-left: 10px; + } + } + + .genshin_logo { + position: absolute; + top: 1px; + right: 15px; + width: 97px; + } + + .label { + font-size: 16px; + text-shadow: 0 0 1px #000, 1px 1px 3px rgba(0, 0, 0, .9); + + span { + color: #d3bc8e; + padding: 0 2px; + } + } +} + + +.notice { + color: #888; + font-size: 12px; + text-align: right; + padding: 12px 5px 5px; +} + +.notice-center { + color: #fff; + text-align: center; + margin-bottom: 10px; + text-shadow: 1px 1px 1px #333; +} + +.copyright { + font-size: 14px; + text-align: center; + color: #fff; + position: relative; + padding-left: 10px; + text-shadow: 1px 1px 1px #000; + margin: 10px 0; + + .version { + color: #d3bc8e; + display: inline-block; + padding: 0 3px; + } +} + + +/* */ + +.cons { + display: inline-block; + vertical-align: middle; + padding: 0 5px; + border-radius: 4px; +} + + +.cons(@idx, @bg, @color:#fff) { + .cons-@{idx} { + background: @bg; + color: @color; + } +} + +.cons(0, #666); +.cons(n0, #404949); +.cons(1, #5cbac2); +.cons(2, #339d61); +.cons(3, #3e95b9); +.cons(4, #3955b7); +.cons(5, #531ba9cf); +.cons(6, #ff5722); + +.cons2(@idx, @bg, @color:#fff) { + .cons2-@{idx} { + border-radius: 4px; + background: @bg; + color: @color; + } +} + +.cons2(0, #666); +.cons2(1, #71b1b7); +.cons2(2, #369961); +.cons2(3, #4596b9); +.cons2(4, #4560b9); +.cons2(5, #531ba9cf); +.cons2(6, #ff5722); + +/******** Fetter ********/ + +.fetter { + width: 50px; + height: 50px; + display: inline-block; + background: url('./item/fetter.png'); + background-size: auto 100%; + @fetters: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; + each(@fetters, { + &.fetter@{value} { + background-position: (-100%/9)+(100%/9)*@value 0; + } + }) +} + +/******** ELEM ********/ + +@elems: hydro, anemo, cryo, electro, geo, pyro, dendro; + +each(@elems, { + .elem-@{value} .talent-icon { + background-image: url("./bg/talent-@{value}.png"); + } + + .elem-@{value} .elem-bg, + .@{value}-bg { + background-image: url("./bg/bg-@{value}.jpg"); + } +}) + + +/* cont */ + +.cont { + border-radius: 10px; + background: url("../common/cont/card-bg.png") top left repeat-x; + background-size: auto 100%; + // backdrop-filter: blur(3px); + margin: 5px 15px 5px 10px; + position: relative; + box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, .8); + overflow: hidden; + color: #fff; + font-size: 16px; +} + + +.cont-title { + background: rgba(0, 0, 0, .4); + box-shadow: 0 0 1px 0 #fff; + color: #d3bc8e; + padding: 10px 20px; + text-align: left; + border-radius: 10px 10px 0 0; + + span { + font-size: 12px; + color: #aaa; + margin-left: 10px; + font-weight: normal; + } + + &.border-less { + background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); + box-shadow: none; + padding-bottom: 5px; + } +} + +.cont-body { + padding: 10px 15px; + font-size: 12px; + background: rgba(0, 0, 0, 0.5); + box-shadow: 0 0 1px 0 #fff; + font-weight: normal; +} + + +.cont-footer { + padding: 10px 15px; + font-size: 12px; + background: rgba(0, 0, 0, 0.5); + font-weight: normal; +} + +.cont > ul.cont-msg { + display: block; + padding: 5px 10px; + background: rgba(0, 0, 0, 0.5); +} + +ul.cont-msg, .cont-footer ul { + padding-left: 15px; + + li { + margin: 5px 0; + margin-left: 15px; + + strong { + font-weight: normal; + margin: 0 2px; + color: #d3bc8e; + } + } +} + +.cont-table { + display: table; + width: 100%; +} + +.cont-table .tr { + display: table-row; +} + +.cont-table .tr:nth-child(even) { + background: rgba(0, 0, 0, .4); +} + +.cont-table .tr:nth-child(odd) { + background: rgba(50, 50, 50, .4); +} + +.cont-table .tr > div, +.cont-table .tr > td { + display: table-cell; + box-shadow: 0 0 1px 0 #fff; +} + +.cont-table .tr > div.value-full { + display: table; + width: 200%; +} + +.cont-table .tr > div.value-none { + box-shadow: none; +} + +.cont-table .thead { + text-align: center; +} + +.cont-table .thead > div, +.cont-table .thead > td { + color: #d3bc8e; + background: rgba(0, 0, 0, .4); + line-height: 40px; + height: 40px; +} + + +.cont-table .title, +.cont-table .th { + color: #d3bc8e; + padding-right: 15px; + text-align: right; + background: rgba(0, 0, 0, .4); + min-width: 100px; + vertical-align: middle; +} + +.logo { + font-size: 18px; + text-align: center; + color: #fff; + margin: 20px 0 10px 0; +} + +/* item-icon */ +.item-icon { + width: 100%; + height: 100%; + border-radius: 4px; + position: relative; + overflow: hidden; + + .img { + width: 100%; + height: 100%; + display: block; + background-size: contain; + background-position: center; + background-repeat: no-repeat; + } + + &.artis { + .img { + width: 84%; + height: 84%; + margin: 8%; + } + } + + @stars: 1, 2, 3, 4, 5; + each(@stars, { + &.star@{value} { + background-image: url("../common/item/bg@{value}.png"); + } + &.opacity-bg.star@{value} { + background-image: url("../common/item/bg@{value}-o.png"); + } + }) +} + +.item-list { + display: flex; + + .item-card { + width: 70px; + background: #e7e5d9; + } + + .item-icon { + border-bottom-left-radius: 0; + border-bottom-right-radius: 12px; + } + + .item-title { + color: #222; + font-size: 13px; + text-align: center; + padding: 2px; + white-space: nowrap; + overflow: hidden; + } + + .item-icon { + height: initial; + } + + .item-badge { + position: absolute; + display: block; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.6); + font-size: 12px; + color: #fff; + padding: 4px 5px 3px; + border-radius: 0 0 6px 0; + } +} \ No newline at end of file diff --git a/resources/common/cont/card-bg.png b/resources/common/cont/card-bg.png new file mode 100644 index 0000000..036d416 Binary files /dev/null and b/resources/common/cont/card-bg.png differ diff --git a/resources/common/cont/logo.png b/resources/common/cont/logo.png new file mode 100644 index 0000000..a8cb922 Binary files /dev/null and b/resources/common/cont/logo.png differ diff --git a/resources/common/face/what.jpg b/resources/common/face/what.jpg new file mode 100644 index 0000000..e9a57f3 Binary files /dev/null and b/resources/common/face/what.jpg differ diff --git a/resources/common/font/HYWH-65W.ttf b/resources/common/font/HYWH-65W.ttf new file mode 100644 index 0000000..e3cfe72 Binary files /dev/null and b/resources/common/font/HYWH-65W.ttf differ diff --git a/resources/common/font/HYWH-65W.woff b/resources/common/font/HYWH-65W.woff new file mode 100644 index 0000000..7cf8a82 Binary files /dev/null and b/resources/common/font/HYWH-65W.woff differ diff --git a/resources/common/font/NZBZ.ttf b/resources/common/font/NZBZ.ttf new file mode 100644 index 0000000..a10dd11 Binary files /dev/null and b/resources/common/font/NZBZ.ttf differ diff --git a/resources/common/font/NZBZ.woff b/resources/common/font/NZBZ.woff new file mode 100644 index 0000000..edf38df Binary files /dev/null and b/resources/common/font/NZBZ.woff differ diff --git a/resources/common/font/tttgbnumber.ttf b/resources/common/font/tttgbnumber.ttf new file mode 100644 index 0000000..89a392f Binary files /dev/null and b/resources/common/font/tttgbnumber.ttf differ diff --git a/resources/common/font/tttgbnumber.woff b/resources/common/font/tttgbnumber.woff new file mode 100644 index 0000000..b35ab09 Binary files /dev/null and b/resources/common/font/tttgbnumber.woff differ diff --git a/resources/common/font/华文中宋.TTF b/resources/common/font/华文中宋.TTF new file mode 100644 index 0000000..2ddb8b2 Binary files /dev/null and b/resources/common/font/华文中宋.TTF differ diff --git a/resources/common/item/artifact-icon.webp b/resources/common/item/artifact-icon.webp new file mode 100644 index 0000000..4fb39d9 Binary files /dev/null and b/resources/common/item/artifact-icon.webp differ diff --git a/resources/common/item/bg1-o.png b/resources/common/item/bg1-o.png new file mode 100644 index 0000000..937aca4 Binary files /dev/null and b/resources/common/item/bg1-o.png differ diff --git a/resources/common/item/bg1.png b/resources/common/item/bg1.png new file mode 100644 index 0000000..5811598 Binary files /dev/null and b/resources/common/item/bg1.png differ diff --git a/resources/common/item/bg2-o.png b/resources/common/item/bg2-o.png new file mode 100644 index 0000000..84b9d88 Binary files /dev/null and b/resources/common/item/bg2-o.png differ diff --git a/resources/common/item/bg2.png b/resources/common/item/bg2.png new file mode 100644 index 0000000..cf8e63c Binary files /dev/null and b/resources/common/item/bg2.png differ diff --git a/resources/common/item/bg3-o.png b/resources/common/item/bg3-o.png new file mode 100644 index 0000000..cd2191f Binary files /dev/null and b/resources/common/item/bg3-o.png differ diff --git a/resources/common/item/bg3.png b/resources/common/item/bg3.png new file mode 100644 index 0000000..c7d4578 Binary files /dev/null and b/resources/common/item/bg3.png differ diff --git a/resources/common/item/bg4-o.png b/resources/common/item/bg4-o.png new file mode 100644 index 0000000..eddbe8a Binary files /dev/null and b/resources/common/item/bg4-o.png differ diff --git a/resources/common/item/bg4.png b/resources/common/item/bg4.png new file mode 100644 index 0000000..8079547 Binary files /dev/null and b/resources/common/item/bg4.png differ diff --git a/resources/common/item/bg5-o.png b/resources/common/item/bg5-o.png new file mode 100644 index 0000000..23bf9fe Binary files /dev/null and b/resources/common/item/bg5-o.png differ diff --git a/resources/common/item/bg5.png b/resources/common/item/bg5.png new file mode 100644 index 0000000..2630db5 Binary files /dev/null and b/resources/common/item/bg5.png differ diff --git a/resources/common/item/bg5.psd b/resources/common/item/bg5.psd new file mode 100644 index 0000000..588f141 Binary files /dev/null and b/resources/common/item/bg5.psd differ diff --git a/resources/common/item/cons0.webp b/resources/common/item/cons0.webp new file mode 100644 index 0000000..31c2102 Binary files /dev/null and b/resources/common/item/cons0.webp differ diff --git a/resources/common/item/crown-o.png b/resources/common/item/crown-o.png new file mode 100644 index 0000000..177c58e Binary files /dev/null and b/resources/common/item/crown-o.png differ diff --git a/resources/common/item/fetter.png b/resources/common/item/fetter.png new file mode 100644 index 0000000..1ccdcf0 Binary files /dev/null and b/resources/common/item/fetter.png differ diff --git a/resources/common/item/star-ltr.png b/resources/common/item/star-ltr.png new file mode 100644 index 0000000..f0895d6 Binary files /dev/null and b/resources/common/item/star-ltr.png differ diff --git a/resources/common/item/star.png b/resources/common/item/star.png new file mode 100644 index 0000000..80d1888 Binary files /dev/null and b/resources/common/item/star.png differ diff --git a/resources/common/layout/default.html b/resources/common/layout/default.html new file mode 100644 index 0000000..a78af10 --- /dev/null +++ b/resources/common/layout/default.html @@ -0,0 +1,21 @@ + + + + + + + + + + + miao-plugin + {{block 'css'}} + {{/block}} + + +
+ {{block 'main'}}{{/block}} + +
+ + \ No newline at end of file diff --git a/resources/common/layout/elem.html b/resources/common/layout/elem.html new file mode 100644 index 0000000..388a8e7 --- /dev/null +++ b/resources/common/layout/elem.html @@ -0,0 +1,21 @@ + + + + + + + + + + + miao-plugin + {{block 'css'}} + {{/block}} + + +
+ {{block 'main'}}{{/block}} + +
+ + \ No newline at end of file diff --git a/resources/common/theme/bg-01.jpg b/resources/common/theme/bg-01.jpg new file mode 100644 index 0000000..6726b9a Binary files /dev/null and b/resources/common/theme/bg-01.jpg differ diff --git a/resources/common/theme/main-01.png b/resources/common/theme/main-01.png new file mode 100644 index 0000000..a3e8918 Binary files /dev/null and b/resources/common/theme/main-01.png differ diff --git a/resources/common/tpl.css b/resources/common/tpl.css new file mode 100644 index 0000000..c63d73e --- /dev/null +++ b/resources/common/tpl.css @@ -0,0 +1,332 @@ +.item-card { + width: 66px; + margin: 4px; + position: relative; + border-radius: 5px; +} +.item-card .badge { + overflow: hidden; + border-radius: 50%; + display: block; + width: 26px; + height: 26px; + position: absolute; + right: -4px; + top: -4px; + background: #e9e5dc; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.8), 2px 2px 2px rgba(50, 50, 50, 0.5); + z-index: 10; +} +.item-card .badge img { + width: 140%; + left: -27%; + top: -45%; + overflow: hidden; + background-size: 100%; + background-repeat: no-repeat; + position: absolute; +} +.item-card .item-bg { + width: 100%; + padding: 100% 0 0; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + margin: 0; +} +.item-card .bg1 { + background-image: url("./item/bg1.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg-1 { + background-image: url("./item/bg1.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg2 { + background-image: url("./item/bg2.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg-2 { + background-image: url("./item/bg2.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg3 { + background-image: url("./item/bg3.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg-3 { + background-image: url("./item/bg3.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg4 { + background-image: url("./item/bg4.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg-4 { + background-image: url("./item/bg4.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg5 { + background-image: url("./item/bg5.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .bg-5 { + background-image: url("./item/bg5.png"); + border-radius: 5px 5px 15px 0; +} +.item-card .box { + border-radius: 5px; + overflow: hidden; + background: #e9e5dc; +} +.item-card .box .item-desc { + display: block; + font-weight: 500; + text-align: center; + bottom: 0; + background: #e9e5dc; + width: 100%; + font-size: 12px; + line-height: 16px; + white-space: nowrap; + overflow: hidden; + padding: 0 3px; +} +.item-card .box .item-desc:last-child { + padding-bottom: 2px; +} +.item-card .box .name { + overflow: hidden; + white-space: nowrap; + margin-top: 5px; + font-weight: 500; + text-align: center; + font-size: 14px; +} +.item-card .box .item-img { + width: 100%; + overflow: hidden; + background-size: 100%; + background-repeat: no-repeat; + position: absolute; + top: 0; +} +.item-card .item-life { + position: absolute; + top: 0; + left: 0; + z-index: 9; + font-size: 13px; + text-align: center; + color: #fff; + padding: 1px 4px; + border-radius: 3px; +} +.item-card .life1 { + background-color: #62a8ea; +} +.item-card .life2 { + background-color: #62a8ea; +} +.item-card .life3 { + background-color: #62a8ea; +} +.item-card .life4 { + background-color: #ff5722; +} +.item-card .life5 { + background-color: #ff5722; +} +.avatar-card { + margin: 3px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.8); + font-size: 13px; +} +.avatar-card .card { + border-radius: 7px; + box-shadow: 0 2px 6px 0 rgba(132, 93, 90, 0.3); + position: relative; + overflow: hidden; + background: #e7e5d9; + width: 70px; +} +.avatar-card .avatar-face { + width: 70px; + height: 70px; + border-radius: 7px 7px 15px 0; + background-size: 100% 100%; + background-repeat: no-repeat; + position: relative; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5); +} +.avatar-card .avatar-face .img { + background-position: center bottom; +} +.avatar-card .avatar-face .avatar-level { + position: absolute; + bottom: 0; + background: rgba(0, 0, 0, 0.6); + left: 0; + padding: 2px 5px 2px 3px; + border-radius: 0 4px 0 0; + color: #fff; +} +.avatar-card .cons { + border-radius: 0 0 0 5px; + padding: 2px 5px; + position: absolute; + right: 0; + top: 0; +} +.avatar-card .avatar-talent { + height: 21px; + padding: 3px 5px 2px; + font-size: 12px; + width: 100%; + color: #222; + text-align: center; + display: flex; +} +.avatar-card .avatar-talent .talent-item { + width: 20px; + height: 16px; + line-height: 17px; + margin: 0 2px; + text-align: center; + display: block; + background-size: contain; + opacity: 0.8; + position: relative; + border-radius: 3px; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); +} +.avatar-card .avatar-talent .talent-item.talent-plus { + font-weight: bold; + color: #0284b9; +} +.avatar-card .avatar-talent .talent-item.talent-crown { + background: #d3bc8e; + color: #3a2702; + box-shadow: 0 0 2px 0 #000; +} +.avatar-card .avatar-talent.no-talent { + font-size: 12px; + color: rgba(100, 100, 100, 0.5); + text-align: center; + padding: 3px 0 2px; +} +.avatar-card .avatar-talent.no-talent span { + transform: scale(0.75); + white-space: nowrap; + margin-left: -1px; +} +.avatar-card.card-mini .wide, +.avatar-card.card-mini .line { + display: none; +} +.avatar-card .avatar-name { + padding: 8px 0 0 5px; + color: #333; +} +.avatar-card .avatar-name strong { + font-size: 14px; + display: block; + height: 23px; + line-height: 20px; +} +.avatar-card .avatar-name .cons { + position: initial; + border-radius: 4px; + padding: 1px 3px; + vertical-align: baseline; +} +.avatar-card.card-wide .mini { + display: none; +} +.avatar-card.card-wide .card { + width: 146px; + display: flex; +} +.avatar-card.card-wide .avatar-face { + height: 126px; + width: 76px; + border-radius: 7px 0 0 7px; +} +.avatar-card.card-wide .img { + background-size: 100% auto; + background-position: 0 10%; + height: 135px; + margin-top: -9px; +} +.avatar-card.card-wide .avatar-info { + width: 70px; +} +.avatar-card.card-wide .line { + display: block; + height: 1px; + width: 100%; + margin: 5px 0; + background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(100, 100, 100, 0.5) 20%, rgba(100, 100, 100, 0.5) 80%, rgba(0, 0, 0, 0)); + transform: scale(0.8); +} +.avatar-card.wide2 .card { + width: 298px; +} +.avatar-card.wide2 .avatar-face { + width: 146px; +} +.avatar-card.wide2 .avatar-face .img { + margin-top: -50px; + height: 176px; +} +.avatar-card.wide2 .avatar-info { + width: 146px; + padding-left: 5px; +} +.avatar-detail { + display: flex; + padding: 0 1px 2px; +} +.avatar-detail .item { + width: 31px; + height: 31px; + border-radius: 4px; + margin: 1px; +} +.avatar-weapon .icon { + border-radius: 4px; +} +.avatar-weapon .cons { + top: initial; + bottom: 0; + padding: 1px 3px; + border-radius: 3px 0 0 0; +} +.avatar-artis { + position: relative; +} +.avatar-artis .artis { + background: rgba(0, 0, 0, 0.5); +} +.avatar-artis.artis2 .img { + position: absolute; + transform: scale(0.7); + width: 92%; + height: 92%; + margin: 4%; +} +.avatar-artis.artis2 .img:first-child { + transform-origin: left top; +} +.avatar-artis.artis2 .img:last-child { + transform-origin: right bottom; +} +.item-list { + display: flex; + flex-wrap: wrap; + transform-origin: 0 0; +} +.item-list .item { + width: 65px; +} +/*# sourceMappingURL=tpl.css.map */ \ No newline at end of file diff --git a/resources/common/tpl.less b/resources/common/tpl.less new file mode 100644 index 0000000..ac47da8 --- /dev/null +++ b/resources/common/tpl.less @@ -0,0 +1,12 @@ +@import url('tpl/item-card'); +@import url('tpl/avatar-card'); + +.item-list { + display: flex; + flex-wrap: wrap; + transform-origin: 0 0; +} + +.item-list .item { + width: 65px; +} \ No newline at end of file diff --git a/resources/common/tpl/artis-detail.css b/resources/common/tpl/artis-detail.css new file mode 100644 index 0000000..06ce5f2 --- /dev/null +++ b/resources/common/tpl/artis-detail.css @@ -0,0 +1,116 @@ +.arti-detail { + width: 185px; + border-radius: 10px; + background: url("../cont/card-bg.png") top left repeat-x; + background-size: auto 100%; + margin: 5px; + position: relative; + box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, 0.8); + height: 205px; + overflow: hidden; +} +.arti-detail .arti-icon { + width: 60px; + height: 60px; + position: absolute; + left: 2px; + top: 3px; +} +.arti-detail .arti-icon span { + position: absolute; + right: 2px; + bottom: 0; + margin-left: 5px; + background: rgba(0, 0, 0, 0.5); + border-radius: 5px; + height: 18px; + line-height: 18px; + padding: 0 3px; + color: #fff; + font-size: 12px; + display: block; +} +.arti-detail .arti-icon img { + width: 60px; + height: 60px; +} +.arti-detail .head { + color: #fff; + padding: 12px 0 8px 68px; +} +.arti-detail .head strong { + font-size: 15px; + display: block; + white-space: nowrap; + overflow: hidden; + font-font: YS; +} +.arti-detail .head span { + font-size: 14px; +} +.arti-detail .head .mark { + font-family: Number, YS; +} +.arti-detail ul.detail { + width: 100%; + padding: 0; + position: initial; + font-family: YS; +} +.arti-detail ul.detail li { + padding: 0 3px; + font-size: 14px; + position: initial; + width: 100%; + display: table; + line-height: 26px; + height: 26px; +} +.arti-detail ul.detail li.nouse span { + color: #888; +} +.arti-detail ul.detail li.arti-main { + font-size: 16px; + padding: 3px 3px; + font-weight: bold; +} +.arti-detail ul.detail li span { + position: initial; + display: table-cell; + color: #fff; + font-family: YS; +} +.arti-detail ul.detail li.title { + text-align: left; + padding-left: 10px; +} +.arti-detail ul.detail li.val { + text-align: right; + padding-right: 10px; + font-family: Number; +} +.arti-detail ul.detail:nth-child(even) { + background: rgba(0, 0, 0, 0.4); +} +.arti-detail ul.detail:nth-child(odd) { + background: rgba(50, 50, 50, 0.4); +} +.arti-detail .avatar { + position: absolute; + left: 32px; + top: 26px; + width: 38px; + height: 38px; + border-radius: 50%; + overflow: hidden; + z-index: 3; +} +.arti-detail .avatar img { + max-width: 100%; + max-height: 100%; +} +.arti-detail .arti-icon img { + width: 52px; + height: 52px; +} +/*# sourceMappingURL=artis-detail.less.map */ \ No newline at end of file diff --git a/resources/common/tpl/avatar-card.css b/resources/common/tpl/avatar-card.css new file mode 100644 index 0000000..379e768 --- /dev/null +++ b/resources/common/tpl/avatar-card.css @@ -0,0 +1,57 @@ +.avatar-card { + margin: 0 0 10px 10px; + border-radius: 7px; + box-shadow: 0 2px 6px 0 rgba(132, 93, 90, 0.3); + height: 88px; + position: relative; + overflow: hidden; + background: #e7e5d9; +} +.avatar-card img { + width: 70px; + height: 70px; + border-radius: 7px 7px 20px 0; +} +.avatar-card.star5 img { + background-image: url(../common/item/bg5.png); + width: 100%; + height: 70px; + /*filter: brightness(1.1);*/ + background-size: 100%; + background-repeat: no-repeat; +} +.avatar-card.star4 img { + width: 100%; + height: 70px; + background-image: url(../common/item/bg4.png); + background-size: 100%; + background-repeat: no-repeat; +} +.avatar-card .num { + position: absolute; + top: 0; + right: 0; + z-index: 9; + font-size: 18px; + text-align: center; + color: #fff; + padding: 1px 5px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.5); +} +.avatar-card .name, +.avatar-card .num_name { + position: absolute; + top: 70px; + left: 0; + z-index: 9; + font-size: 12px; + text-align: center; + width: 100%; + height: 16px; + line-height: 18px; +} +.avatar-card .num_name { + font-size: 16px; +} +/*# sourceMappingURL=avatar-card.css.map */ \ No newline at end of file diff --git a/resources/common/tpl/avatar-card.html b/resources/common/tpl/avatar-card.html new file mode 100644 index 0000000..e5e3c65 --- /dev/null +++ b/resources/common/tpl/avatar-card.html @@ -0,0 +1,53 @@ +{{set avatar = $data[0] || false }} +{{set {_res_path, cardType} = $data[1]}} +{{set weapon = avatar.weapon || {} }} +{{set talentMap = ['a','e','q'] }} + +
+
+ {{if avatar}} +
+
+
+ {{avatar.cons}} +
Lv{{avatar.level}}
+
+
+ {{set talent = avatar.talent || {} }} + {{if talent.a && talent.a.level }} +
+ {{avatar.abbr}} + {{avatar.cons}} + Lv{{avatar.level}} +
+
+
+ {{each talentMap k}} + {{set t = talent[k] || {} }} {{t.level}} + {{/each}} +
+ {{else}} +
暂无天赋数据
+ {{/if}} +
+
+
+
+ + {{weapon.affix}} +
+
+
+
+ {{each avatar.artisSet?.imgs img}} +
+ {{/each}} +
+
+
+
+ {{/if}} +
+
+
\ No newline at end of file diff --git a/resources/common/tpl/avatar-card.less b/resources/common/tpl/avatar-card.less new file mode 100644 index 0000000..f3ce5f9 --- /dev/null +++ b/resources/common/tpl/avatar-card.less @@ -0,0 +1,237 @@ +.avatar-card { + margin: 3px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.8); + font-size: 13px; + + + .card { + border-radius: 7px; + box-shadow: 0 2px 6px 0 rgb(132 93 90 / 30%); + position: relative; + overflow: hidden; + background: #e7e5d9; + width: 70px; + } + + .avatar-face { + width: 70px; + height: 70px; + border-radius: 7px 7px 15px 0; + background-size: 100% 100%; + background-repeat: no-repeat; + position: relative; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, .5); + + .img { + background-position: center bottom; + } + + + .avatar-level { + position: absolute; + bottom: 0; + background: rgba(0, 0, 0, 0.6); + left: 0; + padding: 2px 5px 2px 3px; + border-radius: 0 4px 0 0; + color: #fff; + } + + + } + + + .cons { + border-radius: 0 0 0 5px; + padding: 2px 5px; + position: absolute; + right: 0; + top: 0; + } + + .avatar-talent { + height: 21px; + padding: 3px 5px 2px; + font-size: 12px; + width: 100%; + color: #222; + text-align: center; + display: flex; + + .talent-item { + width: 20px; + height: 16px; + line-height: 17px; + margin: 0 2px; + text-align: center; + display: block; + background-size: contain; + opacity: 0.8; + position: relative; + border-radius: 3px; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); + + &.talent-plus { + font-weight: bold; + color: #0284b9; + } + + &.talent-crown { + background: #d3bc8e; + color: #3a2702; + box-shadow: 0 0 2px 0 #000; + } + } + + &.no-talent { + font-size: 12px; + color: rgba(100, 100, 100, .5); + text-align: center; + padding: 3px 0 2px; + + span { + transform: scale(.75); + white-space: nowrap; + margin-left: -1px; + } + } + } + + &.card-mini { + .wide, .line { + display: none; + } + } + + .avatar-name { + padding: 8px 0 0 5px; + color: #333; + + strong { + font-size: 14px; + display: block; + height: 23px; + line-height: 20px; + } + + .cons { + position: initial; + border-radius: 4px; + padding: 1px 3px; + vertical-align: baseline; + } + } + + &.card-wide { + .mini { + display: none; + } + + .card { + width: 146px; + display: flex; + } + + .avatar-face { + height: 126px; + width: 76px; + border-radius: 7px 0 0 7px; + } + + .img { + background-size: 100% auto; + background-position: 0 10%; + height: 135px; + margin-top: -9px; + } + + .avatar-info { + width: 70px; + } + + .line { + display: block; + height: 1px; + width: 100%; + margin: 5px 0; + background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(100, 100, 100, .5) 20%, rgba(100, 100, 100, .5) 80%, rgba(0, 0, 0, 0)); + transform: scale(.8) + } + } + + &.wide2 { + .card { + width: 298px; + } + + .avatar-face { + width: 146px; + + .img { + margin-top: -50px; + height: 176px; + } + } + + .avatar-info { + width: 146px; + padding-left: 5px; + } + + + } + +} + +.avatar-detail { + display: flex; + padding: 0 1px 2px; + + .item { + width: 31px; + height: 31px; + border-radius: 4px; + margin: 1px; + } +} + +.avatar-weapon { + .icon { + border-radius: 4px; + } + + .cons { + top: initial; + bottom: 0; + padding: 1px 3px; + border-radius: 3px 0 0 0; + } +} + +.avatar-artis { + position: relative; + + .artis { + background: rgba(0, 0, 0, 0.5) + } + + &.artis2 { + .img { + position: absolute; + transform: scale(.7); + width: 92%; + height: 92%; + margin: 4%; + + &:first-child { + transform-origin: left top; + } + + &:last-child { + transform-origin: right bottom; + } + } + } + + +} \ No newline at end of file diff --git a/resources/common/tpl/avatar-profile.css b/resources/common/tpl/avatar-profile.css new file mode 100644 index 0000000..edf1125 --- /dev/null +++ b/resources/common/tpl/avatar-profile.css @@ -0,0 +1,204 @@ +.profile { + position: relative; + margin-bottom: 10px; +} +.profile:after { + content: ""; + display: block; + position: absolute; + left: 8px; + top: 115px; + bottom: 0; + right: 8px; + box-shadow: 0 0 2px 0 #fff; + border-radius: 5px; + z-index: 1; +} +.profile .main-pic { + width: 800px; + height: 500px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + margin-left: -260px; + position: relative; + z-index: 2; +} +.profile .detail { + position: absolute; + right: 20px; + top: 20px; + color: #fff; + z-index: 3; +} +.profile .char-name { + font-size: 50px; + font-family: NZBZ; + text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, 0.7); + text-align: right; +} +.profile .char-lv { + font-family: Number; + margin-bottom: 20px; + text-shadow: 0 0 3px #000, 2px 2px 4px rgba(0, 0, 0, 0.7); + text-align: right; +} +.profile .attr { + border-radius: 4px; + overflow: hidden; +} +.profile .detail li { + width: 300px; + font-size: 17px; + list-style: none; + padding: 0 100px 0 35px; + position: relative; + font-family: YS; + height: 32px; + line-height: 32px; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); +} +.profile .attr li i { + display: inline-block; + height: 20px; + width: 20px; + background-image: url("../../character/icon.png"); + background-size: auto 20px; + position: absolute; + left: 10px; + top: 8px; + opacity: 0.9; + transform: scale(0.9); +} +.profile .i-hp { + background-position: -20px 0; +} +.profile .i-atk { + background-position: -40px 0; +} +.profile .i-def { + background-position: -60px 0; +} +.profile .i-mastery { + background-position: -80px 0; +} +.profile .i-cr { + background-position: -100px 0; +} +.profile .i-cd { + background-position: -140px 0; +} +.profile .i-re { + background-position: -120px 0; +} +.profile .i-dmg { + background-position: -160px 0; +} +.profile .detail li:nth-child(even) { + background: rgba(0, 0, 0, 0.4); +} +.profile .detail li:nth-child(odd) { + background: rgba(50, 50, 50, 0.4); +} +.profile .detail li strong { + display: inline-block; + position: absolute; + right: 85px; + text-align: right; + font-family: Number, sans-serif; + font-weight: normal; +} +.profile .detail li span { + position: absolute; + right: 0; + text-align: left; + width: 75px; + display: inline-block; + font-family: Number, sans-serif; + color: #90e800; + font-size: 15px; +} +.profile .talent-icon { + width: 100px; + height: 100px; + padding: 5px; + display: table; + border-radius: 50%; + position: relative; + background-size: contain; + background-repeat: no-repeat; + background-position: center center; + z-index: 90; +} +.profile .talent-icon img, +.profile .talent-icon .profile .talent-icon-img { + width: 46%; + height: 46%; + position: absolute; + top: 50%; + left: 50%; + margin: -22% 0 0 -23%; + background-size: contain; + background-repeat: no-repeat; + background-position: center; +} +.profile .talent-icon span { + background: #fff; + width: 34px; + height: 26px; + line-height: 26px; + font-size: 17px; + text-align: center; + border-radius: 5px; + position: absolute; + bottom: 2px; + left: 50%; + margin-left: -15px; + color: #000; + box-shadow: 0 0 5px 0 #000; + font-family: Number; +} +.profile .talent-icon.talent-plus span { + background: #2e353e; + color: #ffdfa0; + font-weight: bold; + box-shadow: 0 0 1px 0 #d3bc8e, 1px 1px 2px 0 rgba(0, 0, 0, 0.5); +} +.profile .talent-icon.talent-crown:after { + content: ""; + display: block; + width: 28px; + height: 28px; + background: url("../character/imgs/crown.png") no-repeat; + background-size: contain; + position: absolute; + left: 50%; + top: 0; + margin-left: -14px; +} +.profile .char-talents { + display: flex; + width: 300px; + margin-bottom: 10px; +} +.profile .char-cons .talent-item, +.profile .char-talents .talent-item { + flex: 1; +} +.profile .char-cons { + display: flex; + width: 250px; + position: absolute; + bottom: 5px; + left: 20px; +} +.profile .char-cons .talent-icon { + width: 50px; + height: 50px; + margin: 0 -5px; +} +.profile .char-cons .talent-icon.off { + filter: grayscale(100%); + opacity: 0.4; +} +/*# sourceMappingURL=avatar-profile-source.css.map */ \ No newline at end of file diff --git a/resources/common/tpl/item-card.css b/resources/common/tpl/item-card.css new file mode 100644 index 0000000..d5bfc61 --- /dev/null +++ b/resources/common/tpl/item-card.css @@ -0,0 +1,113 @@ +.item-card { + width: 52px; + margin: 0px 0 5px 7px; + position: relative; +} +.item-card .badge { + overflow: hidden; + border-radius: 5px; + position: relative; + background: #e9e5dc; + box-shadow: 0 2px 6px 0 rgba(132, 93, 90, 0.3); +} +.item-card .badge img { + width: 100%; + overflow: hidden; + background-size: 100%; + background-repeat: no-repeat; + position: absolute; + top: 0; + /*filter: contrast(95%);*/ +} +.item-card .bg1 { + background-image: url("imgs/bg1.png"); + width: 100%; + height: 70px; + background-size: 100%; + background-repeat: no-repeat; +} +.item-card .bg2 { + background-image: url("imgs/bg2.png"); + width: 100%; + height: 70px; + background-size: 100%; + background-repeat: no-repeat; +} +.item-card .bg3 { + background-image: url("imgs/bg3.png"); + width: 100%; + height: 70px; + background-size: 100%; + background-repeat: no-repeat; +} +.item-card .bg4 { + background-image: url("imgs/bg4.png"); + width: 100%; + height: 70px; + background-size: 100%; + background-repeat: no-repeat; +} +.item-card .bg5 { + background-image: url("imgs/bg5.png"); + width: 100%; + height: 70px; + background-size: 100%; + background-repeat: no-repeat; +} +.item-card .box:after { + content: ""; + display: block; + position: absolute; + width: 15px; + right: 0; + bottom: 15px; +} +.item-card .box .desc { + font-weight: 500; + text-align: center; + position: absolute; + bottom: 0; + background: #e9e5dc; + width: 100%; + height: 16px; + font-size: 12px; + line-height: 16px; + font-family: Number; +} +.item-card .box .name { + overflow: hidden; + white-space: nowrap; + margin-top: 5px; + font-weight: 500; + text-align: center; + font-size: 14px; +} +.item-card .life { + position: absolute; + top: 0px; + left: 0px; + z-index: 9; + font-size: 13px; + text-align: center; + color: #fff; + border-radius: 2px; + padding: 1px 4px; + border-radius: 3px; + font-family: "tttgbnumber"; +} +.item-card .life1 { + background-color: #62a8ea; +} +.item-card .life2 { + background-color: #62a8ea; +} +.item-card .life3 { + background-color: #62a8ea; +} +.item-card .life4 { + background-color: #ff5722; +} +.item-card .life5 { + background-color: #ff5722; +} +/*# sourceMappingURL=item-card.less.map */ \ No newline at end of file diff --git a/resources/common/tpl/item-card.less b/resources/common/tpl/item-card.less new file mode 100644 index 0000000..74eb0b9 --- /dev/null +++ b/resources/common/tpl/item-card.less @@ -0,0 +1,120 @@ + +.item-card { + width: 66px; + margin: 4px; + position: relative; + border-radius: 5px; + + + .badge { + overflow: hidden; + border-radius: 50%; + display: block; + width: 26px; + height: 26px; + position: absolute; + right: -4px; + top: -4px; + background: #e9e5dc; + box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.8), 2px 2px 2px rgba(50, 50, 50, .5); + z-index: 10; + + + img { + width: 140%; + left: -27%; + top: -45%; + overflow: hidden; + background-size: 100%; + background-repeat: no-repeat; + position: absolute; + } + } + + .item-bg { + width: 100%; + padding: 100% 0 0; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + margin: 0; + } + + each(range(5), { + .bg@{value} { + background-image: url("./item/bg@{value}.png"); + border-radius: 5px 5px 15px 0; + } + .bg-@{value} { + background-image: url("./item/bg@{value}.png"); + border-radius: 5px 5px 15px 0; + } + }) + + .box { + border-radius: 5px; + overflow: hidden; + background: #e9e5dc; + + .item-desc { + display: block; + font-weight: 500; + text-align: center; + bottom: 0; + background: #e9e5dc; + width: 100%; + font-size: 12px; + line-height: 16px; + white-space: nowrap; + overflow: hidden; + padding: 0 3px; + + &:last-child { + padding-bottom: 2px; + } + } + + .name { + overflow: hidden; + white-space: nowrap; + margin-top: 5px; + font-weight: 500; + text-align: center; + font-size: 14px; + } + + .item-img { + width: 100%; + overflow: hidden; + background-size: 100%; + background-repeat: no-repeat; + position: absolute; + top: 0; + } + } + + .item-life { + position: absolute; + top: 0; + left: 0; + z-index: 9; + font-size: 13px; + text-align: center; + color: #fff; + padding: 1px 4px; + border-radius: 3px; + } + + .life(@idx, @color) { + .life@{idx} { + background-color: @color; + } + } + + .life(1, #62a8ea); + .life(2, #62a8ea); + .life(3, #62a8ea); + .life(4, #ff5722); + .life(5, #ff5722); +} + diff --git a/resources/common/tpl/talent-detail.html b/resources/common/tpl/talent-detail.html new file mode 100644 index 0000000..77d2e75 --- /dev/null +++ b/resources/common/tpl/talent-detail.html @@ -0,0 +1,61 @@ +{{set ds = $data[0] || false }} +{{set {_res_path, icon,lvs,type} = $data[1]}} + +
+
+ +
+
+
{{ds.name}}
+
+ {{each ds.desc d}} + {{ if d[0] === "<" }} + {{@d}} + {{else if d!=""}} +

{{d}}

+ {{/if}} + {{/each}} +
+
+ + {{if ds.tables && ds.tables.length > 0}} +
+ {{each ds.tables tr}} + {{if tr.isSame}} +
+ {{tr.name}}{{if tr.unit}}({{tr.unit}}){{/if}} + {{tr.values[0]}} +
+ {{/if}} + {{/each}} +
+ + + + {{each lvs lv idx}} + {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} + + {{/if}} + {{/each}} + + {{each ds.tables tr}} + {{if !tr.isSame}} + + + + {{each tr.values v idx}} + {{if (type=="a" && idx>4 && idx<11) || (type!="a" && idx>4 && idx < 13)}} + + {{/if}} + {{/each}} + {{/if}} + + {{/each}} +
{{lv}}
+ {{tr.name}} + {{if tr.unit}} + ({{tr.unit}}) + {{/if}} + {{v}}
+ {{/if}} +
diff --git a/resources/help/index.css b/resources/help/index.css index b0db1f8..857d6c2 100644 --- a/resources/help/index.css +++ b/resources/help/index.css @@ -3,18 +3,22 @@ body { width: 830px; background: url("../common/theme/bg-01.jpg"); } + .container { - background: url(../common/theme/main-01.png) top left no-repeat; - background-size: 100% auto; + background: url(../common/theme/main-01.png) top center no-repeat; + background-size: cover; width: 830px; } + .head-box { margin: 60px 0 0 0; padding-bottom: 0; } + .head-box .title { font-size: 50px; } + .cont-box { border-radius: 15px; margin-top: 20px; @@ -23,11 +27,13 @@ body { box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.15); position: relative; } + .help-group { font-size: 18px; font-weight: bold; padding: 15px 15px 10px 20px; } + .help-table { text-align: center; border-collapse: collapse; @@ -38,9 +44,11 @@ body { width: 100%; color: #fff; } + .help-table .tr { display: table-row; } + .help-table .td, .help-table .th { font-size: 14px; @@ -51,12 +59,15 @@ body { position: relative; text-align: left; } + .help-table .tr:last-child .td { padding-bottom: 12px; } + .help-table .th { background: rgba(34, 41, 51, 0.5); } + .help-icon { width: 40px; height: 40px; @@ -69,15 +80,18 @@ body { top: 12px; transform: scale(0.85); } + .help-title { display: block; color: #d3bc8e; font-size: 16px; line-height: 24px; } + .help-desc { display: block; font-size: 13px; line-height: 18px; } + /*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/resources/help/theme/default/config.js b/resources/help/theme/default/config.js index fe2ba52..5af9b8f 100644 --- a/resources/help/theme/default/config.js +++ b/resources/help/theme/default/config.js @@ -13,7 +13,7 @@ export const style = { contBgColor: 'rgba(6, 21, 31, .5)', // 面板底图毛玻璃效果,数字越大越模糊,0-10 ,可为小数 - contBgBlur: 3, + contBgBlur: 0, // 板块标题栏底色 headerBgColor: 'rgba(6, 21, 31, .4)', diff --git a/resources/help/theme/default/main.png b/resources/help/theme/default/main.png index a3e8918..42c18f8 100644 Binary files a/resources/help/theme/default/main.png and b/resources/help/theme/default/main.png differ diff --git a/resources/html/admin/index.html b/resources/html/admin/index.html deleted file mode 100644 index b04af4f..0000000 --- a/resources/html/admin/index.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - Document - - - - -
-
-
#椰奶设置
-
椰奶管理面板
-
-
-
-
消息相关
-
    -
  • -
    - 图鉴匹配查询 - #图鉴设置匹配 + 开启/关闭 - {{@Atlas}} -
    -
    图鉴匹配规则需要 开启:图鉴结尾 关闭:原魔、圣遗物、食物无需图鉴结尾
    -
  • -
  • -
    - 图鉴目录开关 - #图鉴设置目录 + 开启/关闭 - {{@Atlasall}} -
    -
    图鉴目录 为兼容之前用js版本插件用户可以用指令关闭功能
    -
  • -
  • -
    - 戳一戳卡片 - #图鉴设置戳一戳 + 开启/关闭 - {{@poke}} -
    -
  • - -
-
-
-
角色资料与信息查询
-
    -
  • -
    - 角色图片扩展包 - #图鉴更新 - {{if imgPlus}} -
    已安装
    - {{else}} -
    未安装
    - {{/if}} -
    -
    角色图片的扩展包,包含更多的角色图片
    -
  • -
-
-
-
系统设置
-
    -
  • -
    - 图鉴作为默认帮助 - #图鉴设置帮助 + 开启/关闭 - {{@help}} -
    -
    开启后将使用图鉴版帮助作为Yunzai的默认帮助
    -
  • -
  • -
    - 体力作为默认体力 - #图鉴设置体力 + 开启/关闭 - {{@Note}} -
    -
    开启后将使用图鉴版体力作为Yunzai的默认体力
    -
  • -
  • -
    - 设置体力模板类型 - #图鉴设置模板 + (0-2) -
    {{@len}}
    -
    -
    需开启图鉴版体力作为Yunzai的默认体力,当前模板支持0(随机)以及1-2
    -
  • -
- -
- - - \ No newline at end of file diff --git a/resources/html/admin/index.less b/resources/html/admin/index.less deleted file mode 100644 index 0d0fe81..0000000 --- a/resources/html/admin/index.less +++ /dev/null @@ -1,89 +0,0 @@ -body { - transform: scale(1); - width: 520px; -} - -.container { - background: url("./imgs/bg.png") #000144 left top no-repeat; - background-size: 520px auto; - width:520px; -} - -.head-box { - margin: 0 0 80px 0; -} - -.cfg-box { - border-radius: 15px; - margin-top: 20px; - margin-bottom: 20px; - padding: 5px 15px; - overflow: hidden; - background: #f5f5f5; - box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); - position: relative; - background: rgba(35, 38, 57, .8); -} - - -.cfg-group { - color: #ceb78b; - font-size: 18px; - font-weight: bold; - padding: 10px 20px; -} - -.cfg-ul { - -} - -.cfg-li { - border-radius: 18px; - min-height: 36px; - position: relative; - overflow: hidden; - margin-bottom: 10px; - background: rgba(203, 196, 190, 0); -} - -.cfg-line { - color: #4e5769; - line-height: 36px; - padding-left: 20px; - font-weight: bold; - border-radius: 16px; - box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); - background: url("./imgs/cfg-right.jpg") right top #cbc4be no-repeat; - background-size: auto 36px; -} - -.cfg-hint { - font-size: 12px; - font-weight: normal; - margin-top: 3px; - margin-bottom: -3px; -} - -.cfg-status { - position: absolute; - top: 0; - right: 0; - height: 36px; - width: 160px; - text-align: center; - line-height: 36px; - font-size: 16px; - color: #495366; - font-weight: bold; - border-radius: 0 16px 16px 0; -} - -.cfg-status.status-off { - color: #a95151; -} - -.cfg-desc { - font-size: 12px; - color: #cbc4be; - margin: 5px 0 5px 20px; -} \ No newline at end of file diff --git a/resources/html/admin/imgs/bg.png b/resources/html/imgs/bg.png similarity index 100% rename from resources/html/admin/imgs/bg.png rename to resources/html/imgs/bg.png diff --git a/resources/html/admin/imgs/cfg-right.jpg b/resources/html/imgs/cfg-right.jpg similarity index 100% rename from resources/html/admin/imgs/cfg-right.jpg rename to resources/html/imgs/cfg-right.jpg diff --git a/resources/html/admin/imgs/cfg-right.png b/resources/html/imgs/cfg-right.png similarity index 100% rename from resources/html/admin/imgs/cfg-right.png rename to resources/html/imgs/cfg-right.png diff --git a/resources/html/admin/index.css b/resources/html/index.css similarity index 92% rename from resources/html/admin/index.css rename to resources/html/index.css index 0c976e6..c72dbd9 100644 --- a/resources/html/admin/index.css +++ b/resources/html/index.css @@ -2,16 +2,14 @@ body { transform: scale(1); width: 520px; } - .container { + background: url("./imgs/bg.png") #000144 left top no-repeat; background-size: 520px auto; width: 520px; } - .head-box { margin: 0 0 80px 0; } - .cfg-box { border-radius: 15px; margin-top: 20px; @@ -23,14 +21,12 @@ body { position: relative; background: rgba(35, 38, 57, 0.8); } - .cfg-group { color: #ceb78b; font-size: 18px; font-weight: bold; padding: 10px 20px; } - .cfg-li { border-radius: 18px; min-height: 36px; @@ -39,7 +35,6 @@ body { margin-bottom: 10px; background: rgba(203, 196, 190, 0); } - .cfg-line { color: #4e5769; line-height: 36px; @@ -50,14 +45,12 @@ body { background: url("./imgs/cfg-right.jpg") right top #cbc4be no-repeat; background-size: auto 36px; } - .cfg-hint { font-size: 12px; font-weight: normal; margin-top: 3px; margin-bottom: -3px; } - .cfg-status { position: absolute; top: 0; @@ -71,13 +64,12 @@ body { font-weight: bold; border-radius: 0 16px 16px 0; } - .cfg-status.status-off { color: #a95151; } - .cfg-desc { font-size: 12px; color: #cbc4be; margin: 5px 0 5px 20px; -} \ No newline at end of file +} +/*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/resources/html/index.html b/resources/html/index.html new file mode 100644 index 0000000..22c2803 --- /dev/null +++ b/resources/html/index.html @@ -0,0 +1,133 @@ +{{extend defaultLayout}} +{{block 'css'}} + +{{/block}} +{{block 'main'}} + +
+
+
喵喵管理面板
+
#喵喵设置
+
+
+
+
玩家&老婆卡片展示
+
    +
  • +
    + 角色查询 + #喵喵设置角色 + 开启/关闭 + {{@chars}} +
    +
  • +
  • +
    + 面板查询 + #喵喵设置面板 + 开启/关闭 + {{@profile}} +
    +
  • +
  • +
    + 老婆查询 + #喵喵设置老婆 + 开启/关闭 + {{@wife}} +
    +
  • +
  • +
    + 戳一戳卡片 + #喵喵设置戳一戳 + 开启/关闭 + {{@poke}} +
    +
  • +
  • +
    + 允许查他人 + #喵喵设置查他人 + 开启/关闭 + {{@other}} +
    +
    暂不支持关闭面板的查他人
    +
  • +
+
+
+
角色资料与信息查询
+
    +
  • +
    + 角色图鉴 + #喵喵设置图鉴 + 开启/关闭 + {{@wiki}} +
    +
    角色天赋、角色命座、角色图鉴(尚未完成)等资料
    +
  • +
  • +
    + 深渊统计 + #喵喵设置统计 + 开启/关闭 + {{@stat}} +
    +
    角色持有率、深渊出场率、深渊配队等统计信息
    +
  • +
  • +
    + 上传深渊 + #喵喵设置深渊 + 开启/关闭 + {{@abyss}} +
    +
    使用【#上传深渊】功能取代【#深渊】功能,默认关闭
    +
  • +
  • +
    + 角色图片 + #喵喵设置图片 + 开启/关闭 + {{@pic}} +
    +
  • +
  • +
    + 角色图片扩展包 + #喵喵更新图像 + {{if imgPlus}} +
    已安装
    + {{else}} +
    未安装
    + {{/if}} +
    +
    角色图片的扩展包,包含更多的角色图片
    +
  • +
  • +
    + 小清新角色图 + #喵喵设置小清新 + 开启/关闭 + {{@se}} +
    +
    启用后会启用角色图及增量包中的小清新图像,勇士啊,你准备好了吗
    +
  • +
+
+
+
系统设置
+
    +
  • +
    + 渲染精度 + #喵喵设置渲染100 +
    {{scale}}
    +
    +
    可选值50~200,建议100。设置高精度会提高图片的精细度,但因图片较大可能会影响渲染与发送速度
    +
  • + +
  • +
    + 喵喵作为默认帮助 + #喵喵设置帮助 + 开启/关闭 + {{@help}} +
    +
    开启后将使用喵喵版帮助作为Yunzai的默认帮助
    +
  • +
+ +
+{{/block}} \ No newline at end of file