mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
35 lines
873 B
TypeScript
35 lines
873 B
TypeScript
import { ComponentMetadata } from '@/components/types'
|
|
import { liveUrls } from '@/core/utils/urls'
|
|
|
|
const id = 'dpi-live-showgirl'
|
|
const entry = async () => {
|
|
const { addStyle } = await import('@/core/style')
|
|
if (document.getElementById(id) === null) {
|
|
addStyle(`
|
|
.haruna-ctnr,
|
|
.avatar-btn
|
|
{
|
|
transform: scale(${1 / window.devicePixelRatio}) !important;
|
|
}
|
|
`, id)
|
|
}
|
|
}
|
|
export const component: ComponentMetadata = {
|
|
name: 'dpiLiveShowgirl',
|
|
displayName: '直播看板娘高 DPI 适配',
|
|
enabledByDefault: window.devicePixelRatio > 1,
|
|
description: {
|
|
'zh-CN': '根据屏幕 DPI 缩放直播看板娘的大小, 避免像素锯齿.',
|
|
},
|
|
tags: [
|
|
componentsTags.live,
|
|
componentsTags.style,
|
|
],
|
|
entry,
|
|
reload: entry,
|
|
unload: () => {
|
|
document.getElementById(id)?.remove()
|
|
},
|
|
urlInclude: liveUrls,
|
|
}
|