diff --git a/public/battle-background.jpg b/public/battle-background.jpg index 9ed65aa..6ddf2a5 100644 Binary files a/public/battle-background.jpg and b/public/battle-background.jpg differ diff --git a/src/style.css b/src/style.css index 2f5dcf6..66dced9 100644 --- a/src/style.css +++ b/src/style.css @@ -5,6 +5,13 @@ box-sizing: border-box; } +/* 图片预加载 - 提升移动端加载性能 */ +body::before { + content: ""; + display: none; + background-image: url(/battle-background.jpg); +} + /* 根元素样式 */ :root { /* 王者荣耀风格字体 - 使用系统默认字体但设置更多样化 */ @@ -528,14 +535,15 @@ table { font-size: 14px; } - /* 移动端body不设置任何背景相关属性 */ + /* 移动端背景图片优化:保留图片但优化加载性能 */ html, body { - background: none !important; - background-image: none !important; - background-color: var(--dark-color) !important; - background-size: auto !important; - background-position: static !important; - background-repeat: repeat !important; + background-color: var(--dark-color); + background-image: url(/battle-background.jpg); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: scroll; + /* 预加载优化 */ background-attachment: scroll !important; } @@ -548,6 +556,16 @@ table { :root { font-size: 13px; } + + /* 小屏幕手机背景图片优化 */ + html, body { + background-color: var(--dark-color); + background-image: url(/battle-background.jpg); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: scroll; + } .content-container { padding: 0;