diff --git a/web/plugins/com.msgbyte.theme.genshin/src/hutao/theme.less b/web/plugins/com.msgbyte.theme.genshin/src/hutao/theme.less index b5e93752..d04c5656 100644 --- a/web/plugins/com.msgbyte.theme.genshin/src/hutao/theme.less +++ b/web/plugins/com.msgbyte.theme.genshin/src/hutao/theme.less @@ -3,6 +3,8 @@ --tc-primary-color: @primary-color; --tc-background-image: url(./bg.jpg); + --tc-content-background-image: url(./avatar.png); + --tc-content-background-image-opacity: 0.15; .bg-navbar-light { background-color: @primary-color; @@ -20,26 +22,6 @@ background-color: lighten(@primary-color, 40%); } - [data-tc-role^=content-] { - position: relative; - - &::before { - content: ''; - position: absolute; - display: block; - left: 0; - top: 0; - bottom: 0; - right: 0; - background-image: url(./avatar.png); - background-size: contain; - background-repeat: no-repeat; - background-position: right bottom; - opacity: 0.15; - pointer-events: none; - } - } - &.dark { --tc-primary-color: darken(@primary-color, 10%); diff --git a/web/src/routes/Main/Content/PageContent.tsx b/web/src/routes/Main/Content/PageContent.tsx index 2aa98516..55226a0c 100644 --- a/web/src/routes/Main/Content/PageContent.tsx +++ b/web/src/routes/Main/Content/PageContent.tsx @@ -92,16 +92,24 @@ export const PageContent: React.FC = React.memo((props) => {
- {contentMaskEl} - {contentEl} +
+ {contentMaskEl} + {contentEl} +
+ +
); diff --git a/web/src/styles/global.less b/web/src/styles/global.less index bc80b2d7..9107dc8e 100644 --- a/web/src/styles/global.less +++ b/web/src/styles/global.less @@ -2,12 +2,20 @@ @apply text-typography-light; --tc-background-image: url(../../assets/images/bg.jpg); + --tc-content-background-image: ''; + --tc-content-background-image-opacity: 0.2; .tc-background { @apply bg-center bg-cover bg-no-repeat; background-image: var(--tc-background-image); } + .tc-content-background { + @apply absolute block inset-0 bg-contain bg-no-repeat bg-right-bottom pointer-events-none; + background-image: var(--tc-content-background-image); + opacity: var(--tc-content-background-image-opacity); + } + /* 滚动条 */ ::-webkit-scrollbar { width: 16px;