koishi-plugin-chat-patch 3.0.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/vue/index.vue +60 -634
- package/client/web/env.d.ts +56 -0
- package/client/web/index.html +21 -0
- package/client/web/package-lock.json +3419 -0
- package/client/web/package.json +62 -0
- package/client/web/public/bcui/css/color-dark.css +35 -0
- package/client/web/public/bcui/css/color-light.css +35 -0
- package/client/web/public/bcui/css/style.css +468 -0
- package/client/web/public/bcui/js/main.js +193 -0
- package/client/web/public/css/append-dark.css +13 -0
- package/client/web/public/css/append-light.css +13 -0
- package/client/web/public/css/append-napcat-dark.css +14 -0
- package/client/web/public/css/append-napcat-light.css +14 -0
- package/client/web/public/favicon.ico +0 -0
- package/client/web/public/img/icons/icon-for-fuck-apple.png +0 -0
- package/client/web/public/img/icons/icon-maskable.png +0 -0
- package/client/web/public/img/icons/icon.png +0 -0
- package/client/web/public/img/icons/icon.svg +10 -0
- package/client/web/public/robots.txt +2 -0
- package/client/web/public/sw.js +58 -0
- package/client/web/scripts/copy-bcui.mjs +17 -0
- package/client/web/src/App.vue +1127 -0
- package/client/web/src/assets/css/append/append_darwin.css +68 -0
- package/client/web/src/assets/css/append/append_full_vibrancy.css +290 -0
- package/client/web/src/assets/css/append/append_linux.css +125 -0
- package/client/web/src/assets/css/append/append_linux_vibrancy.css +22 -0
- package/client/web/src/assets/css/append/append_napcat.css +35 -0
- package/client/web/src/assets/css/append/append_new.css +843 -0
- package/client/web/src/assets/css/append/append_vibrancy.css +113 -0
- package/client/web/src/assets/css/append/append_win32.css +109 -0
- package/client/web/src/assets/css/append/mobile/append_mobile_horizontal.css +349 -0
- package/client/web/src/assets/css/append/mobile/append_mobile_vertical.css +96 -0
- package/client/web/src/assets/css/chat.css +2104 -0
- package/client/web/src/assets/css/msg.css +941 -0
- package/client/web/src/assets/css/options.css +811 -0
- package/client/web/src/assets/css/sys_notice.css +62 -0
- package/client/web/src/assets/css/view.css +2105 -0
- package/client/web/src/assets/font//346/226/271/346/255/243/345/226/265/345/221/234/344/275/223.ttf +0 -0
- package/client/web/src/assets/img/Vue.png +0 -0
- package/client/web/src/assets/img/cakes.svg +189 -0
- package/client/web/src/assets/img/icons/AppIcon.png +0 -0
- package/client/web/src/assets/img/icons/AppIconDark.png +0 -0
- package/client/web/src/assets/img/icons/CapacitorAppIcon.png +0 -0
- package/client/web/src/assets/img/icons/CapacitorAppIconDark.png +0 -0
- package/client/web/src/assets/img/icons/NapcatAppIcon.png +0 -0
- package/client/web/src/assets/img/icons/NapcatAppIconDark.png +0 -0
- package/client/web/src/assets/img/icons/exit.png +0 -0
- package/client/web/src/assets/img/icons/pen.png +0 -0
- package/client/web/src/assets/img/stars.svg +89 -0
- package/client/web/src/assets/img//346/234/237/345/276/205.png +0 -0
- package/client/web/src/assets/l10n/_About I10n.md +35 -0
- package/client/web/src/assets/l10n/_l10nconfig.json +7 -0
- package/client/web/src/assets/l10n/zh-CN.po +1941 -0
- package/client/web/src/assets/logo.png +0 -0
- package/client/web/src/assets/pathMap/LLOneBot.yaml +2 -0
- package/client/web/src/assets/pathMap/Lagrange.OneBot.yaml +180 -0
- package/client/web/src/assets/pathMap/NapCat.Onebot.yaml +224 -0
- package/client/web/src/assets/pathMap/SnowLuma.yaml +80 -0
- package/client/web/src/assets/qed.txt +1 -0
- package/client/web/src/components/AboutPan.vue +197 -0
- package/client/web/src/components/BulletinBody.vue +129 -0
- package/client/web/src/components/DepPan.vue +310 -0
- package/client/web/src/components/EmojiFace.vue +32 -0
- package/client/web/src/components/FacePan.vue +461 -0
- package/client/web/src/components/FileBody.vue +129 -0
- package/client/web/src/components/FileManager.vue +532 -0
- package/client/web/src/components/FriendBody.vue +54 -0
- package/client/web/src/components/GlobalSessionSearchBar.vue +301 -0
- package/client/web/src/components/History.vue +49 -0
- package/client/web/src/components/LazyLottie.vue +82 -0
- package/client/web/src/components/MergePan.vue +127 -0
- package/client/web/src/components/MsgBody.vue +1478 -0
- package/client/web/src/components/MusicPlayer.vue +549 -0
- package/client/web/src/components/NoticeBody.vue +168 -0
- package/client/web/src/components/QzonePermissionPan.vue +150 -0
- package/client/web/src/components/RawMsgRenderPreviewPan.vue +190 -0
- package/client/web/src/components/ThemeColorPickerPan.vue +420 -0
- package/client/web/src/components/TinySessionBody.vue +51 -0
- package/client/web/src/components/UmamiInfoPan.vue +1549 -0
- package/client/web/src/components/UpdatePan.vue +263 -0
- package/client/web/src/components/ViewerCom.vue +1360 -0
- package/client/web/src/components/VoiceMsg.vue +626 -0
- package/client/web/src/components/WelPan.vue +894 -0
- package/client/web/src/components/msg-body/.gitkeep +0 -0
- package/client/web/src/components/msg-component/JsonSegComp.vue +138 -0
- package/client/web/src/components/msg-component/XmlSegComp.vue +132 -0
- package/client/web/src/components/msg-component/jsonComp/AutoReply.vue +97 -0
- package/client/web/src/components/msg-component/jsonComp/Contact.lua.vue +129 -0
- package/client/web/src/components/msg-component/jsonComp/Feed.lua.vue +94 -0
- package/client/web/src/components/msg-component/jsonComp/Forum.vue +84 -0
- package/client/web/src/components/msg-component/jsonComp/Mannounce.vue +111 -0
- package/client/web/src/components/msg-component/jsonComp/Map.vue +52 -0
- package/client/web/src/components/msg-component/jsonComp/Miniapp.lua.vue +53 -0
- package/client/web/src/components/msg-component/jsonComp/Miniapp.vue +69 -0
- package/client/web/src/components/msg-component/jsonComp/Music.lua.vue +135 -0
- package/client/web/src/components/msg-component/jsonComp/Tuwen.lua.vue +56 -0
- package/client/web/src/components/notice-component/.gitkeep +0 -0
- package/client/web/src/components/notice-component/MealHungryPan.vue +119 -0
- package/client/web/src/components/tooltip/CustomFaceTooltip.vue +22 -0
- package/client/web/src/components/tooltip/Tooltip.vue +50 -0
- package/client/web/src/components/tooltip/Tooltips.vue +14 -0
- package/client/web/src/components/tooltip/UserInfoTooltip.vue +69 -0
- package/client/web/src/function/base.ts +238 -0
- package/client/web/src/function/connect.ts +2042 -0
- package/client/web/src/function/debug.ts +10 -0
- package/client/web/src/function/elements/information.ts +141 -0
- package/client/web/src/function/elements/system.ts +101 -0
- package/client/web/src/function/elements/vueComp.ts +62 -0
- package/client/web/src/function/favicon.ts +76 -0
- package/client/web/src/function/input.ts +69 -0
- package/client/web/src/function/model/emoji.ts +127 -0
- package/client/web/src/function/model/img.ts +150 -0
- package/client/web/src/function/model/msg-body.ts +51 -0
- package/client/web/src/function/msg.ts +2674 -0
- package/client/web/src/function/notify.ts +225 -0
- package/client/web/src/function/option.ts +749 -0
- package/client/web/src/function/satori-model.ts +818 -0
- package/client/web/src/function/satori.ts +325 -0
- package/client/web/src/function/sender.ts +178 -0
- package/client/web/src/function/tooltip.ts +49 -0
- package/client/web/src/function/utils/appUtil.ts +2288 -0
- package/client/web/src/function/utils/avatarUtil.ts +31 -0
- package/client/web/src/function/utils/backgroundUtil.ts +110 -0
- package/client/web/src/function/utils/linkViewUtil.ts +101 -0
- package/client/web/src/function/utils/localHistoryUtil.ts +517 -0
- package/client/web/src/function/utils/msgUtil.ts +1242 -0
- package/client/web/src/function/utils/pinyin.ts +141 -0
- package/client/web/src/function/utils/recordUtil.ts +187 -0
- package/client/web/src/function/utils/sessionUtil.ts +114 -0
- package/client/web/src/function/utils/systemUtil.ts +664 -0
- package/client/web/src/main.ts +91 -0
- package/client/web/src/pages/Chat.vue +3453 -0
- package/client/web/src/pages/Friends.vue +636 -0
- package/client/web/src/pages/Info.vue +717 -0
- package/client/web/src/pages/Messages.vue +875 -0
- package/client/web/src/pages/Options.vue +82 -0
- package/client/web/src/pages/Qzone.vue +1178 -0
- package/client/web/src/pages/chat-view/ChatDanmaku.vue +759 -0
- package/client/web/src/pages/chat-view/ChatGlagame.vue +642 -0
- package/client/web/src/pages/chat-view/ChatTerminal.vue +1044 -0
- package/client/web/src/pages/chat-view/SystemNotice.vue +171 -0
- package/client/web/src/pages/options/OptAccount.vue +107 -0
- package/client/web/src/pages/options/OptAddon.vue +185 -0
- package/client/web/src/pages/options/OptDev.vue +704 -0
- package/client/web/src/pages/options/OptFunction.vue +403 -0
- package/client/web/src/pages/options/OptInfo.vue +165 -0
- package/client/web/src/pages/options/OptView.vue +846 -0
- package/client/web/src/runtime/backend.ts +310 -0
- package/client/web/src/state/auth.ts +14 -0
- package/client/web/src/state/chat.ts +36 -0
- package/client/web/src/state/connection.ts +20 -0
- package/client/web/src/state/contact.ts +37 -0
- package/client/web/src/state/qzone.ts +18 -0
- package/client/web/src/state/sessionHistory.ts +25 -0
- package/client/web/src/state/settings.ts +18 -0
- package/client/web/src/state/sticker.ts +10 -0
- package/client/web/src/state/ui.ts +56 -0
- package/client/web/tsconfig.json +27 -0
- package/client/web/tsconfig.tsbuildinfo +1 -0
- package/client/web/vite.config.ts +33 -0
- package/dist/index.js +1 -12
- package/dist/style.css +1 -1
- package/lib/index.js +2070 -2077
- package/package.json +15 -2
- package/readme.md +0 -22
- package/src/bootstrap.ts +71 -0
- package/src/cache.ts +319 -0
- package/src/config.ts +23 -35
- package/src/database.ts +650 -0
- package/src/index.ts +27 -59
- package/src/media.ts +302 -0
- package/src/recorder.ts +175 -0
- package/src/self-message.ts +456 -0
- package/src/server.d.ts +26 -0
- package/src/types.ts +108 -48
- package/src/web.ts +712 -0
- package/client/vue/chat-logic.ts +0 -683
- package/client/vue/composables/useChatActions.ts +0 -61
- package/client/vue/composables/useChatData.ts +0 -185
- package/client/vue/composables/useImageCache.ts +0 -281
- package/client/vue/composables/useVideoCache.ts +0 -125
- package/client/vue/types.ts +0 -72
- package/lib/api-handlers.d.ts +0 -25
- package/lib/config.d.ts +0 -14
- package/lib/file-manager.d.ts +0 -124
- package/lib/index.d.ts +0 -17
- package/lib/logger.d.ts +0 -9
- package/lib/message-handler.d.ts +0 -35
- package/lib/types.d.ts +0 -57
- package/lib/utils.d.ts +0 -18
- package/src/api-handlers.ts +0 -646
- package/src/file-manager.ts +0 -1436
- package/src/message-handler.ts +0 -507
- package/src/utils.ts +0 -189
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
let fist_load = true
|
|
2
|
+
|
|
3
|
+
function changeColor(type) {
|
|
4
|
+
if(!fist_load) {
|
|
5
|
+
// 启用颜色渐变动画
|
|
6
|
+
document.body.style.transition = 'background, color, background-color .3s'
|
|
7
|
+
} else {
|
|
8
|
+
fist_load = false
|
|
9
|
+
}
|
|
10
|
+
// 切换颜色
|
|
11
|
+
let match_list = ['color-.*\.css', 'prism-.*\.css', 'append-.*\.css']
|
|
12
|
+
const css_list = document.getElementsByTagName("link")
|
|
13
|
+
for(let i=0; i<css_list.length; i++) {
|
|
14
|
+
name = css_list[i].href
|
|
15
|
+
match_list.forEach(function (value) {
|
|
16
|
+
if(name.match(value) != null) {
|
|
17
|
+
const newLink = document.createElement("link");
|
|
18
|
+
newLink.setAttribute("rel", "stylesheet");
|
|
19
|
+
newLink.setAttribute("type", "text/css");
|
|
20
|
+
if(type === "dark") {
|
|
21
|
+
newLink.setAttribute("href", name.replace('light', 'dark'));
|
|
22
|
+
} else {
|
|
23
|
+
newLink.setAttribute("href", name.replace('dark', 'light'));
|
|
24
|
+
}
|
|
25
|
+
document.getElementsByTagName("head").item(0).replaceChild(newLink, css_list[i]);
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function foldChange(sender) {
|
|
32
|
+
const svg = sender.getElementsByTagName('svg');
|
|
33
|
+
if(svg[0].style.transform === 'rotate(-90deg)') {
|
|
34
|
+
svg[0].style.transform = 'rotate(90deg)'
|
|
35
|
+
animateScroll(sender, 40)
|
|
36
|
+
} else {
|
|
37
|
+
svg[0].style.transform = 'rotate(-90deg)'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function animateScroll(element, speed) {
|
|
42
|
+
let rect=element.getBoundingClientRect()
|
|
43
|
+
let top=window.pageYOffset+rect.top
|
|
44
|
+
let currentTop=document.documentElement.scrollTop
|
|
45
|
+
let requestId
|
|
46
|
+
function step(timestamp) {
|
|
47
|
+
currentTop+=speed
|
|
48
|
+
if(currentTop<=top){
|
|
49
|
+
window.scrollTo(0,currentTop)
|
|
50
|
+
requestId=window.requestAnimationFrame(step)
|
|
51
|
+
}else{
|
|
52
|
+
window.cancelAnimationFrame(requestId)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
window.requestAnimationFrame(step)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function scrollDiv(sender) {
|
|
59
|
+
const par_body = sender.parentNode
|
|
60
|
+
const line = par_body.getElementsByClassName('scroll-top')[0];
|
|
61
|
+
if(sender.scrollTop === 0) {
|
|
62
|
+
line.style.display = 'none'
|
|
63
|
+
} else {
|
|
64
|
+
line.style.display = 'block'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getQueryVariable(variable) {
|
|
69
|
+
const query = window.location.search.substring(1);
|
|
70
|
+
const vars = query.split("&");
|
|
71
|
+
for (let i=0; i<vars.length; i++) {
|
|
72
|
+
const pair = vars[i].split("=");
|
|
73
|
+
if(pair[0] === variable){
|
|
74
|
+
return pair[1]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function initCodeInput(body, fun, regex) {
|
|
81
|
+
// 初始化输入框
|
|
82
|
+
if(body.classList.toString().indexOf('ss-code-input') >= 0) {
|
|
83
|
+
// 初始化 label onclick 事件
|
|
84
|
+
body.onclick = function () { codeInputAllow(body) }
|
|
85
|
+
// 初始化主输入框
|
|
86
|
+
const input = body.getElementsByTagName('input')[0]
|
|
87
|
+
input.oninput = function() { codeInputChanged(body, fun, regex) }
|
|
88
|
+
input.onblur = function() { codeInputNoAllow(body) }
|
|
89
|
+
input.dataset.typeing = "false"
|
|
90
|
+
input.addEventListener('compositionstart',function(e){ input.dataset.typeing = "true" }, false)
|
|
91
|
+
input.addEventListener('compositionend',function(e){ input.dataset.typeing = "false"; }, false)
|
|
92
|
+
if(input !== undefined) {
|
|
93
|
+
// 添加显示输入框
|
|
94
|
+
for(var i=0; i<body.dataset.num; i++) {
|
|
95
|
+
// 构建
|
|
96
|
+
let inputShow = document.createElement("input")
|
|
97
|
+
inputShow.onclick = function () { codeInputAllow(body) }
|
|
98
|
+
inputShow.dataset.id = (i+1).toString()
|
|
99
|
+
inputShow.disabled = true
|
|
100
|
+
// 添加
|
|
101
|
+
body.appendChild(inputShow)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function codeInputAllow(body) {
|
|
108
|
+
// 输入框 label 点击事件
|
|
109
|
+
const inputs = body.getElementsByTagName('input')
|
|
110
|
+
inputs[0].focus()
|
|
111
|
+
codeInputChanged(body)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function codeInputNoAllow(body) {
|
|
115
|
+
const inputs = body.getElementsByTagName('input')
|
|
116
|
+
for(let i=1; i<inputs.length; i++) {
|
|
117
|
+
inputs[i].classList = ""
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function codeInputChanged(body, fun, regex) {
|
|
122
|
+
// 主输入框变化事件
|
|
123
|
+
const inputs = body.getElementsByTagName('input')
|
|
124
|
+
if(inputs !== undefined && inputs.length > 1 && inputs[0].dataset.typeing === "false") {
|
|
125
|
+
if(regex === undefined) {
|
|
126
|
+
regex = ""
|
|
127
|
+
}
|
|
128
|
+
if(inputs[0].dataset.up === "true") {
|
|
129
|
+
inputs[0].value = inputs[0].value.toUpperCase()
|
|
130
|
+
}
|
|
131
|
+
// 变更输入框内容
|
|
132
|
+
for(let i=1; i<inputs.length; i++) {
|
|
133
|
+
inputs[i].value = ""
|
|
134
|
+
}
|
|
135
|
+
for(let i=0; i<inputs[0].value.length; i++) {
|
|
136
|
+
// 检查正则表达式
|
|
137
|
+
const reg = new RegExp(regex)
|
|
138
|
+
if(reg.test(inputs[0].value.substring(i, i+1))) {
|
|
139
|
+
if(i < inputs.length - 2) {
|
|
140
|
+
inputs[i+1].classList = ""
|
|
141
|
+
inputs[i+1].value = inputs[0].value.substring(i, i+1)
|
|
142
|
+
if(i + 2 < inputs.length) {
|
|
143
|
+
inputs[i+2].classList = "ss-code-input-selete"
|
|
144
|
+
}
|
|
145
|
+
if(i + 3 < inputs.length) {
|
|
146
|
+
inputs[i+3].classList = ""
|
|
147
|
+
}
|
|
148
|
+
} else if( i == inputs.length - 2) {
|
|
149
|
+
inputs[i+1].value = inputs[0].value.substring(i, i+1)
|
|
150
|
+
if(fun !== undefined) {
|
|
151
|
+
// 触发函数
|
|
152
|
+
inputs[0].disabled = true
|
|
153
|
+
// 完成部分动画
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
fun()
|
|
156
|
+
}, 300)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
inputs[0].value = inputs[0].value.substring(0, inputs[0].value.length - 1)
|
|
161
|
+
inputs[i+1].classList = "ss-code-input-selete ss-code-input-err"
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
inputs[i+1].classList = "ss-code-input-selete"
|
|
164
|
+
}, 500)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if(inputs[0].value.length == 0) {
|
|
168
|
+
inputs[1].classList = "ss-code-input-selete"
|
|
169
|
+
inputs[2].classList = ""
|
|
170
|
+
}
|
|
171
|
+
// 防止光标不在最后
|
|
172
|
+
inputs[0].setSelectionRange(inputs[0].value.length, inputs[0].value.length)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function getCodeInput(body) {
|
|
177
|
+
if(body.classList.toString().indexOf('ss-code-input') >= 0) {
|
|
178
|
+
const inputs = body.getElementsByTagName('input')
|
|
179
|
+
return inputs[0].value.substring(0, inputs.length - 1)
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function cleanCodeInput(body) {
|
|
184
|
+
if(body.classList.toString().indexOf('ss-code-input') >= 0) {
|
|
185
|
+
const inputs = body.getElementsByTagName('input')
|
|
186
|
+
inputs[0].value = ""
|
|
187
|
+
inputs[0].disabled = false
|
|
188
|
+
for(let i=1; i<inputs.length; i++) {
|
|
189
|
+
inputs[i].classList = ""
|
|
190
|
+
}
|
|
191
|
+
codeInputChanged(body)
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-blue: #6291fd;
|
|
3
|
+
--color-green: #6cd892;
|
|
4
|
+
--color-red: #f56269;
|
|
5
|
+
--color-yellow: #f6c344;
|
|
6
|
+
|
|
7
|
+
--color-bg-blue: #393e47;
|
|
8
|
+
--color-bg-green: #3f544a;
|
|
9
|
+
--color-bg-red: #523a3c;
|
|
10
|
+
--color-bg-yellow: #504b3d;
|
|
11
|
+
|
|
12
|
+
--color-issue-close: #a47ff1;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-blue: #316cf4;
|
|
3
|
+
--color-green: #408558;
|
|
4
|
+
--color-red: #cb444a;
|
|
5
|
+
--color-yellow: #d68100;
|
|
6
|
+
|
|
7
|
+
--color-bg-blue: #d3e1fc;
|
|
8
|
+
--color-bg-green: #d5e6de;
|
|
9
|
+
--color-bg-red: #f3d8da;
|
|
10
|
+
--color-bg-yellow: #fdf3d1;
|
|
11
|
+
|
|
12
|
+
--color-issue-close: #8059d9;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--heroui-background: 0 0% 0%;
|
|
3
|
+
--tw-bg-opacity: 1;
|
|
4
|
+
|
|
5
|
+
--color-main: #142342;
|
|
6
|
+
--color-main-0: #142342;
|
|
7
|
+
--color-font-r: var(--color-font);
|
|
8
|
+
--color-font-1-r: var(--color-font-1);
|
|
9
|
+
|
|
10
|
+
--color-bg: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
11
|
+
--color-card: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
12
|
+
--color-card-1: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
13
|
+
--color-card-2: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--heroui-background: 0 0% 100%;
|
|
3
|
+
--tw-bg-opacity: .5 !important;
|
|
4
|
+
|
|
5
|
+
--color-main: #c8dafb;
|
|
6
|
+
--color-main-0: #c8dafb;
|
|
7
|
+
--color-font-r: var(--color-font);
|
|
8
|
+
--color-font-1-r: var(--color-font-1);
|
|
9
|
+
|
|
10
|
+
--color-bg: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
11
|
+
--color-card: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
12
|
+
--color-card-1: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
13
|
+
--color-card-2: hsl(var(--heroui-background) / var(--heroui-background-opacity, var(--tw-bg-opacity)));
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="1080" height="1080" viewBox="0 0 1080 1080" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M537 1080C833.577 1080 1074 839.577 1074 543C1074 246.423 833.577 6 537 6C240.423 6 0 246.423 0 543C0 839.577 240.423 1080 537 1080Z" fill="#606E7A"/>
|
|
3
|
+
<path d="M540.28 803.2C493.78 803.2 451.18 787.7 423.68 764.4C409.78 768.6 391.88 775.3 380.68 783.6C371.08 790.7 372.28 798 373.98 800.9C381.58 813.8 504.68 809.1 540.28 805.1V803.2ZM540.28 803.2C586.78 803.2 629.38 787.7 656.88 764.4C670.78 768.6 688.68 775.3 699.88 783.6C709.48 790.7 708.28 798 706.58 800.9C698.98 813.8 575.88 809.1 540.28 805.1V803.2Z" fill="#F8F9FA"/>
|
|
4
|
+
<path d="M540.58 524.8C617.28 524.3 678.78 509.4 699.58 503.7C704.58 502.3 707.18 499.9 707.18 499.9C707.18 499.2 707.48 487.4 707.48 481.3C707.48 378.9 659.18 276 540.18 276C421.28 276 372.88 378.9 372.88 481.3C372.88 487.4 373.18 499.2 373.18 499.9C373.18 499.9 375.38 502.2 379.28 503.3C398.48 508.7 461.18 524.2 539.78 524.8H540.58ZM749.08 610.1C744.28 594.8 737.88 576.9 731.28 559.8C731.28 559.8 727.48 559.3 725.58 559.9C666.58 577 595.08 588 540.58 587.3H539.98C485.78 587.9 414.78 577.2 355.98 560.2C353.78 559.6 349.28 559.8 349.28 559.8C342.68 576.9 336.18 594.8 331.48 610.1C308.78 683.1 316.18 713.3 321.78 714C333.78 715.5 368.48 659.1 368.48 659.1C368.48 716.4 420.18 804.4 538.68 805.2H541.78C660.28 804.4 711.98 716.4 711.98 659.1C711.98 659.1 746.68 715.5 758.68 714C764.38 713.3 771.68 683.1 749.08 610.1Z" fill="#F8F9FA"/>
|
|
5
|
+
<path d="M497.98 427.3C481.88 428 468.08 409.7 467.18 386.3C466.28 362.9 478.68 343.4 494.78 342.7C510.88 342 524.68 360.3 525.58 383.7C526.48 407.1 514.08 426.6 497.98 427.3ZM613.38 386.3C612.48 409.7 598.78 428 582.58 427.3C566.48 426.6 554.08 407 554.98 383.7C555.88 360.3 569.58 342 585.78 342.7C601.88 343.4 614.28 362.9 613.38 386.3Z" fill="#F8F9FA"/>
|
|
6
|
+
<path d="M517.78 386.7C518.48 395.9 513.48 404.1 506.48 405C499.48 405.9 493.28 399.1 492.48 389.9C491.78 380.7 496.78 372.5 503.78 371.6C510.78 370.7 517.08 377.4 517.78 386.7ZM562.08 389.7C563.48 387.1 573.18 373.7 593.28 378.6C598.58 379.9 600.98 381.8 601.48 382.5C602.28 383.6 602.48 385.2 601.68 387.3C600.18 391.5 596.98 391.4 595.28 390.5C594.18 390 580.18 380.6 567.28 394.6C566.38 395.6 564.78 395.9 563.28 394.7C561.88 393.6 561.28 391.3 562.08 389.7Z" fill="#F8F9FA"/>
|
|
7
|
+
<path d="M540.58 583.9H539.98C502.88 584.3 457.98 579.4 414.48 570.9C410.78 592.5 408.48 619.6 410.48 651.9C415.38 733.6 463.88 785 538.78 785.7H541.78C616.68 785 665.18 733.6 670.08 651.9C671.98 619.6 669.78 592.5 666.08 570.9C622.58 579.5 577.68 584.4 540.58 583.9Z" fill="#F8F9FA"/>
|
|
8
|
+
<path d="M435.08 577.1V657.5C435.08 657.5 471.88 664.9 508.78 659.8V585.6C485.38 584.3 460.18 581.4 435.08 577.1Z" fill="#E9EBED"/>
|
|
9
|
+
<path d="M707.28 499.9C707.28 499.9 635.68 522.5 540.58 523.2H539.98C445.08 522.6 373.58 500 373.28 499.9L349.28 559.8C409.28 577.9 483.68 589.6 539.88 588.9H540.48C596.68 589.6 671.08 577.9 731.18 559.8L707.28 499.9Z" fill="#E9EBED"/>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 本文件由 Copilot 生成,sw 配置实在是太难写了 😭
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const CACHE_NAME = 'qlogo-cache-v1'
|
|
6
|
+
// const CACHE_DURATION = 1000;
|
|
7
|
+
const CACHE_DURATION = 3 * 24 * 60 * 60 * 1000
|
|
8
|
+
|
|
9
|
+
self.addEventListener('install', (event) => {
|
|
10
|
+
// 跳过等待,立即激活
|
|
11
|
+
self.skipWaiting()
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
self.addEventListener('activate', (event) => {
|
|
15
|
+
// 清理旧缓存
|
|
16
|
+
event.waitUntil(
|
|
17
|
+
caches.keys().then((cacheNames) => {
|
|
18
|
+
return Promise.all(
|
|
19
|
+
cacheNames.map((cacheName) => {
|
|
20
|
+
if (cacheName !== CACHE_NAME) {
|
|
21
|
+
return caches.delete(cacheName)
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
)
|
|
25
|
+
}),
|
|
26
|
+
)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
self.addEventListener('fetch', (event) => {
|
|
30
|
+
const url = new URL(event.request.url)
|
|
31
|
+
|
|
32
|
+
// sw.js 本身的请求不缓存
|
|
33
|
+
if (url.pathname === '/sw.js') {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (url.hostname === 'q1.qlogo.cn') {
|
|
38
|
+
// 对于 QQ 头像的请求,缓存三天
|
|
39
|
+
event.respondWith(
|
|
40
|
+
caches.open(CACHE_NAME).then((cache) => {
|
|
41
|
+
return cache.match(event.request).then((response) => {
|
|
42
|
+
if (response) {
|
|
43
|
+
return response
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return fetch(event.request).then((response) => {
|
|
47
|
+
const responseClone = response.clone()
|
|
48
|
+
cache.put(event.request, responseClone)
|
|
49
|
+
return response
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
} else {
|
|
55
|
+
// 对于其他请求,采用默认的网络优先策略
|
|
56
|
+
event.respondWith(fetch(event.request))
|
|
57
|
+
}
|
|
58
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { copyFile, mkdir } from 'node:fs/promises'
|
|
2
|
+
import { dirname, resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
|
|
5
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
6
|
+
const source = resolve(root, 'node_modules/vue3-bcui/dist')
|
|
7
|
+
const target = resolve(root, 'public/bcui')
|
|
8
|
+
|
|
9
|
+
await mkdir(resolve(target, 'css'), { recursive: true })
|
|
10
|
+
await mkdir(resolve(target, 'js'), { recursive: true })
|
|
11
|
+
|
|
12
|
+
await Promise.all([
|
|
13
|
+
copyFile(resolve(source, 'css/style.css'), resolve(target, 'css/style.css')),
|
|
14
|
+
copyFile(resolve(source, 'css/color-light.css'), resolve(target, 'css/color-light.css')),
|
|
15
|
+
copyFile(resolve(source, 'css/color-dark.css'), resolve(target, 'css/color-dark.css')),
|
|
16
|
+
copyFile(resolve(source, 'js/main.js'), resolve(target, 'js/main.js')),
|
|
17
|
+
])
|