-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,091 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
packages/ | ||
typings/ | ||
dist/ | ||
**/dist/ | ||
dev/ | ||
node_modules/ | ||
!.github-json/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
registry/lib/components/live/chat-panel-fit/chat-panel-fit.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
.player-full-win:not(.hide-aside-area) { | ||
.live-room-app { | ||
.aside-area { | ||
container-name: aside-area; | ||
container-type: size; | ||
width: var(--live-chat-panel-width, 302px) !important; | ||
} | ||
.player-section { | ||
width: calc(100% - var(--live-chat-panel-width, 302px)) !important; | ||
} | ||
@container aside-area (max-width: 290px) { | ||
.control-panel-icon-row-new .icon-left-part-new { | ||
.super-chat, | ||
.like-btn { | ||
width: 32px; | ||
&-icon { | ||
margin-right: 0 !important; | ||
} | ||
&-text { | ||
display: none !important; | ||
} | ||
} | ||
} | ||
.chat-input-ctnr-new .medal-section { | ||
min-width: 0 !important; | ||
max-width: 0 !important; | ||
} | ||
} | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
registry/lib/components/live/liveroom-username-link/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { defineComponentMetadata } from '@/components/define' | ||
import { select } from '@/core/spin-query' | ||
import { delay } from '@/core/utils' | ||
|
||
const processed = new WeakSet() | ||
|
||
const entry = async () => { | ||
const userInfoBar = await select('#rank-list-ctnr-box', { | ||
queryInterval: 500, | ||
}) | ||
|
||
const observer = new MutationObserver(async () => { | ||
// 舰长列表 | ||
const guardNodes = [...document.querySelectorAll('webcomponent-userinfo')] | ||
let subtreeLoaded = false | ||
|
||
for (const node of guardNodes) { | ||
if (processed.has(node)) { | ||
continue | ||
} | ||
|
||
// eslint-disable-next-line no-underscore-dangle | ||
const { uid } = (node as any).__vue__.source.uinfo | ||
|
||
if (!subtreeLoaded) { | ||
// 等待子节点创建 | ||
while ( | ||
node.shadowRoot.querySelector('a') === null || | ||
node.shadowRoot.querySelector('.faceBox') === null | ||
) { | ||
await delay(100) | ||
} | ||
subtreeLoaded = true | ||
} | ||
|
||
const aNode = node.shadowRoot.querySelector('a') | ||
const avatarNode: HTMLDivElement = node.shadowRoot.querySelector('.faceBox') | ||
|
||
aNode.href = `https://space.bilibili.com/${uid}` | ||
aNode.style.textDecoration = 'none' | ||
|
||
avatarNode.style.cursor = 'pointer' | ||
avatarNode.addEventListener('click', () => { | ||
window.open(`https://space.bilibili.com/${uid}`) | ||
}) | ||
processed.add(node) | ||
|
||
// const name = a.innerText | ||
// console.log(`已为舰长${name}(UID: ${uid})添加超链接`) | ||
} | ||
|
||
// 观众列表 | ||
const spectorNodes = [...document.querySelectorAll('.gift-rank-list-item')] | ||
for (const node of spectorNodes) { | ||
if (processed.has(node)) { | ||
continue | ||
} | ||
|
||
// 观众列表元素似乎会原地更新,不能直接预先获取UID并绑定,这里通过点击时获取父元素动态读取UID | ||
|
||
// 名称 | ||
const nameNode: HTMLDivElement = node.querySelector('.common-nickname-wrapper .name') | ||
nameNode.style.cursor = 'pointer' | ||
nameNode.addEventListener('click', () => { | ||
// eslint-disable-next-line no-underscore-dangle | ||
const { uid } = (nameNode as any).parentNode.parentNode.parentNode.parentNode.__vue__.source | ||
window.open(`https://space.bilibili.com/${uid}`) | ||
}) | ||
|
||
// 头像 | ||
const avatarNode: HTMLDivElement = node.querySelector('.face') | ||
avatarNode.style.cursor = 'pointer' | ||
avatarNode.addEventListener('click', () => { | ||
// eslint-disable-next-line no-underscore-dangle | ||
const { uid } = (avatarNode as any).parentNode.parentNode.__vue__.source | ||
window.open(`https://space.bilibili.com/${uid}`) | ||
}) | ||
processed.add(node) | ||
|
||
// const name = nameNode.innerText | ||
// console.log(`已为观众${name}(UID: ${uid})添加超链接`) | ||
} | ||
}) | ||
|
||
observer.observe(userInfoBar, { | ||
childList: true, | ||
subtree: true, | ||
}) | ||
} | ||
|
||
export const component = defineComponentMetadata({ | ||
name: 'liveroomUsernameLink', | ||
author: { | ||
name: 'Light_Quanta', | ||
link: 'https://github.com/LightQuanta', | ||
}, | ||
displayName: '添加直播间用户超链接', | ||
entry, | ||
tags: [componentsTags.live], | ||
urlInclude: [/^https:\/\/live\.bilibili\.com\/\d+/], | ||
description: { | ||
'zh-CN': '为直播间的房间观众和大航海界面的用户列表添加可以点击的超链接', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
registry/lib/components/style/custom-navbar/settings/Widget.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<DefaultWidget | ||
name="顶栏布局设置" | ||
icon="mdi-sort" | ||
@mouseover="loadNavbarSettings()" | ||
@click="toggleNavbarSettings()" | ||
/> | ||
</template> | ||
<script lang="ts"> | ||
import { DefaultWidget } from '@/ui' | ||
import { loadNavbarSettings, toggleNavbarSettings } from './vm' | ||
export default Vue.extend({ | ||
components: { | ||
DefaultWidget, | ||
}, | ||
methods: { | ||
async loadNavbarSettings() { | ||
await loadNavbarSettings() | ||
}, | ||
toggleNavbarSettings, | ||
}, | ||
}) | ||
</script> |
Oops, something went wrong.