Skip to content

Commit

Permalink
Merge pull request #3 from AmeroHan/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-fish authored Nov 2, 2024
2 parents b2b9245 + c69cf93 commit dd2ba1b
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/plugins/mediawiki/infoboxDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,35 @@ export const INFOBOX_DEFINITION: {
injectStyles?: string
}[] = [
// 萌娘百科
{
match: (url) => url.host.endsWith('moegirl.org.cn'),
selector: [
(() => {
const selectors = [
// 标准信息框
'.mw-parser-output .infotemplatebox',
'.mw-parser-output table.infobox2',
// 成句
'.mw-parser-output table.infoboxSpecial',
// 旧版兼容
'.mw-parser-output table.infobox',
],
injectStyles: `
/* 隐藏部分妨碍截图的元素 */
/* 顶部导航栏和悬浮工具栏 */
body #moe-full-container > header#moe-global-header, body #moe-full-container > #moe-global-toolbar,
/* 右下角悬浮的功能按钮 */
#bottomRightCorner,
/* 全站公告弹窗 */
body > .n-modal-container,
/* [[WAF]] */
.mw-parser-output [data-id="lr-overlay"]
{
display: none !important;
}
]
return {
match: (url) => url.host.endsWith('moegirl.org.cn'),
selector: selectors,
injectStyles: `
/* 隐藏妨碍截图的元素 */
${selectors.join(', ')} {
visibility: visible;
:not(&, & *) {
visibility: hidden;
}
}
/* 调整信息框外观 */
.mw-parser-output .infotemplatebox {
margin: 1rem !important;
}
`,
},
/* 调整信息框外观 */
.mw-parser-output .infotemplatebox {
margin: 1rem !important;
}
`,
}
})(),
// Minecraft Wiki
{
match: (url) => url.host === 'minecraft.fandom.com',
Expand Down

0 comments on commit dd2ba1b

Please sign in to comment.