Skip to content

Commit

Permalink
更新[BoxJs TF]: 尝试解决首屏闪屏问题, 尝试解决图标白边问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chavyleung committed Aug 16, 2020
1 parent 18ca835 commit 34fa756
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
12 changes: 6 additions & 6 deletions box/chavy.boxjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@
<v-col cols="3" md="2" v-for="(app, appIdx) in favApps" :key="app.id" class="d-flex justify-space-around">
<div class="ma-2" @click="switchAppView(app.id)">
<v-card v-if="isDarkMode" style="border-radius: 12px;">
<v-img style="border-radius: 12px;" :aspect-ratio="1" width="58" height="58" contain v-ripple :src="app.icon"></v-img>
<v-img style="border-radius: 12px;" :aspect-ratio="1" width="54" height="54" contain v-ripple :src="app.icon"></v-img>
</v-card>
<v-img
v-else
style="border-radius: 12px;"
:aspect-ratio="1"
width="58"
height="58"
width="54"
height="54"
contain
v-ripple
class="elevation-3"
Expand Down Expand Up @@ -1234,14 +1234,12 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
'background-size': 'cover',
'background-repeat': 'no-repeat'
}
// 主题发生变化时给 <body> 设置背景色
document.querySelector('body').setAttribute('style', `background-color: ${this.isDarkMode ? '#121212' : '#fff'};`)
return style
},
appIconFontStyle() {
const style = {
'font-size': '10px',
'max-width': '58px'
'max-width': '54px'
}
if (this.isWallpaper) {
style['color'] = '#fff'
Expand Down Expand Up @@ -1444,6 +1442,8 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
if (this.ui.editor) {
this.ui.editor._themeService.setTheme(this.isDarkMode ? 'vs-dark' : 'vs')
}
// 主题发生变化时给 <body> 设置背景色
document.querySelector('body').setAttribute('style', `background-color: ${this.isDarkMode ? '#121212' : '#fff'};`)
}
},
'box.usercfgs.color_dark_primary': {
Expand Down
9 changes: 8 additions & 1 deletion box/chavy.boxjs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const $ = new Env('BoxJs')

$.version = '0.7.22'
$.version = '0.7.23'
$.versionType = 'beta'

/**
Expand Down Expand Up @@ -139,6 +139,13 @@ async function handlePage() {
() => ($.html = $.getjson($.KEY_web_cache).cache)
)
}
// 根据偏好设置, 替换首屏颜色 (如果是`auto`则交由页面自适应)
const theme = $.getdata('@chavy_boxjs_userCfgs.theme')
if (theme === 'light') {
$.html = $.html.replace('#121212', '#fff')
} else if (theme === 'dark') {
$.html = $.html.replace('#fff', '#121212')
}
}

/**
Expand Down
10 changes: 3 additions & 7 deletions box/release/box.release.tf.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
{
"releases": [
{
"version": "0.7.22",
"version": "0.7.23",
"tags": ["beta"],
"author": "@chavyleung",
"icon": "https://avatars3.githubusercontent.com/u/29748519",
"repo": "https://github.com/chavyleung",
"notes": [
{
"name": "优化",
"descs": ["首屏加载闪屏问题"]
},
{
"name": "说明",
"descs": ["首屏背景颜色会跟随 iOS 的主题颜色", "如果系统主题是黑色, 但 BoxJs 的主题是白色, 仍然会有一个黑到白的过程", "反之亦然"]
"name": "修复",
"descs": ["尝试解决首屏闪屏问题", "尝试解决图标白边问题"]
}
]
},
Expand Down

0 comments on commit 34fa756

Please sign in to comment.