Skip to content

Commit 34fa756

Browse files
committed
更新[BoxJs TF]: 尝试解决首屏闪屏问题, 尝试解决图标白边问题
1 parent 18ca835 commit 34fa756

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

‎box/chavy.boxjs.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,14 @@
351351
<v-col cols="3" md="2" v-for="(app, appIdx) in favApps" :key="app.id" class="d-flex justify-space-around">
352352
<div class="ma-2" @click="switchAppView(app.id)">
353353
<v-card v-if="isDarkMode" style="border-radius: 12px;">
354-
<v-img style="border-radius: 12px;" :aspect-ratio="1" width="58" height="58" contain v-ripple :src="app.icon"></v-img>
354+
<v-img style="border-radius: 12px;" :aspect-ratio="1" width="54" height="54" contain v-ripple :src="app.icon"></v-img>
355355
</v-card>
356356
<v-img
357357
v-else
358358
style="border-radius: 12px;"
359359
:aspect-ratio="1"
360-
width="58"
361-
height="58"
360+
width="54"
361+
height="54"
362362
contain
363363
v-ripple
364364
class="elevation-3"
@@ -1234,14 +1234,12 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
12341234
'background-size': 'cover',
12351235
'background-repeat': 'no-repeat'
12361236
}
1237-
// 主题发生变化时给 <body> 设置背景色
1238-
document.querySelector('body').setAttribute('style', `background-color: ${this.isDarkMode ? '#121212' : '#fff'};`)
12391237
return style
12401238
},
12411239
appIconFontStyle() {
12421240
const style = {
12431241
'font-size': '10px',
1244-
'max-width': '58px'
1242+
'max-width': '54px'
12451243
}
12461244
if (this.isWallpaper) {
12471245
style['color'] = '#fff'
@@ -1444,6 +1442,8 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
14441442
if (this.ui.editor) {
14451443
this.ui.editor._themeService.setTheme(this.isDarkMode ? 'vs-dark' : 'vs')
14461444
}
1445+
// 主题发生变化时给 <body> 设置背景色
1446+
document.querySelector('body').setAttribute('style', `background-color: ${this.isDarkMode ? '#121212' : '#fff'};`)
14471447
}
14481448
},
14491449
'box.usercfgs.color_dark_primary': {

‎box/chavy.boxjs.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const $ = new Env('BoxJs')
22

3-
$.version = '0.7.22'
3+
$.version = '0.7.23'
44
$.versionType = 'beta'
55

66
/**
@@ -139,6 +139,13 @@ async function handlePage() {
139139
() => ($.html = $.getjson($.KEY_web_cache).cache)
140140
)
141141
}
142+
// 根据偏好设置, 替换首屏颜色 (如果是`auto`则交由页面自适应)
143+
const theme = $.getdata('@chavy_boxjs_userCfgs.theme')
144+
if (theme === 'light') {
145+
$.html = $.html.replace('#121212', '#fff')
146+
} else if (theme === 'dark') {
147+
$.html = $.html.replace('#fff', '#121212')
148+
}
142149
}
143150

144151
/**

‎box/release/box.release.tf.json‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
{
22
"releases": [
33
{
4-
"version": "0.7.22",
4+
"version": "0.7.23",
55
"tags": ["beta"],
66
"author": "@chavyleung",
77
"icon": "https://avatars3.githubusercontent.com/u/29748519",
88
"repo": "https://github.com/chavyleung",
99
"notes": [
1010
{
11-
"name": "优化",
12-
"descs": ["首屏加载闪屏问题"]
13-
},
14-
{
15-
"name": "说明",
16-
"descs": ["首屏背景颜色会跟随 iOS 的主题颜色", "如果系统主题是黑色, 但 BoxJs 的主题是白色, 仍然会有一个黑到白的过程", "反之亦然"]
11+
"name": "修复",
12+
"descs": ["尝试解决首屏闪屏问题", "尝试解决图标白边问题"]
1713
}
1814
]
1915
},

0 commit comments

Comments
 (0)