Skip to content

Commit

Permalink
Merge pull request #24 from ADJazzzz/dev
Browse files Browse the repository at this point in the history
1.3.8
  • Loading branch information
ADJazzzz authored Sep 2, 2024
2 parents 93ad1c2 + 093e41d commit 0bbd109
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 55 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
## NEXT_VERSION

## [1.3.8](https://github.com/ADJazzzz/BLSPAM/compare/1.3.7...1.3.8) 2024-09-02

### 调整

- 适配B站直播新旧两种UI布局

## [1.3.7](https://github.com/ADJazzzz/BLSPAM/compare/1.3.6...1.3.7) 2024-08-22

### 调整

- 适配B站直播新UI(还在旧版UI的同学请勿更新)
- 适配B站直播新UI ~~(还在旧版UI的同学请勿更新)~~

## [1.3.6](https://github.com/ADJazzzz/BLSPAM/compare/1.3.5...1.3.6) 2024-08-17

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

**注意事项**

- # 还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本
- ~~还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本~~ 新版本(`1.3.8`版本及以上)已支持新旧两种UI布局
- 使用独轮车可能会对直播间环境造成污染,若你的账号被封禁或禁言,本脚本、作者以及贡献者不负任何责任
- 本脚本会使用你的账号信息用于对B站相关API请求
- 本脚本只会对B站相关域名、依赖CDN 和 Github API 发起请求
Expand Down
71 changes: 36 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bilibili-live-spamer",
"private": true,
"version": "1.3.7",
"version": "1.3.8",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,7 +11,7 @@
"format": "prettier --write src/"
},
"dependencies": {
"axios": "^1.7.4",
"axios": "^1.7.7",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"naive-ui": "^2.39.0",
Expand All @@ -20,7 +20,7 @@
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue": "^5.1.3",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"eslint": "^8.57.0",
Expand All @@ -30,6 +30,6 @@
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-plugin-monkey": "^4.0.6",
"vue-tsc": "^2.0.29"
"vue-tsc": "^2.1.4"
}
}
38 changes: 24 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ const uiStore = useUIStore()
const moduleStore = useModuleStore()
uiStore.uiConfig.isShowPanel = false
const renderPanel = () => {
pollingQuery(document, '.chat-input-ctnr-new.p-relative', 300, 300, true).then((controlPanelLeft) => {
const renderPanel = (elementName: string, ctrStyle: object) => {
pollingQuery(document, elementName, 300, 300, true).then((controlPanelContent) => {
const buttonNode = h(
NButton,
{
class: 'blspam_btn',
text: true,
tag: 'div',
style: { marginRight: '4px', alignSelf: 'center' },
style: ctrStyle,
focusable: false,
bordered: false,
onClick: () => {
Expand Down Expand Up @@ -75,29 +75,39 @@ const renderPanel = () => {
}
)
render(buttonNode, controlPanelLeft)
render(buttonNode, controlPanelContent)
})
}
const handleUpdateCollapse = (collapsed: boolean) => {
uiStore.uiConfig.isCollapsed = collapsed
}
const handleUpdateTheme = () => {
const biliTheme = unsafeWindow.bililiveThemeV2.getTheme()
uiStore.uiConfig.theme = biliTheme
}
const observer = new MutationObserver((mutationsList, observer) => {
const controlPanel = dq('#control-panel-ctnr-box')
if (controlPanel) {
renderPanel()
observer.disconnect()
logger.log('初始化完成')
const oldTheme = dq('.icon-left-part')
const newTheme = dq('.chat-input-ctnr-new.p-relative')
if (oldTheme || newTheme) {
if (oldTheme) {
renderPanel('.icon-left-part', { marginLeft: '4px', display: 'inline-block' })
}
if (newTheme) {
renderPanel('.chat-input-ctnr-new.p-relative', {
marginRight: '4px',
alignSelf: 'center'
})
}
observer.disconnect()
logger.log('初始化完成')
}
}
})
observer.observe(document.body, { childList: true, subtree: true })
const handleUpdateCollapse = (collapsed: boolean) => {
uiStore.uiConfig.isCollapsed = collapsed
}
// n-config-provider 的 preflight-style-disabled 属性不知道为什么不生效,只能这样了
GM_addStyle('body { font-size: 12px }')
</script>
Expand Down

0 comments on commit 0bbd109

Please sign in to comment.