统一样式

This commit is contained in:
史悦
2025-09-11 13:17:27 +08:00
parent 483ab26505
commit adbd205b7e
7 changed files with 942 additions and 283 deletions

View File

@@ -8,7 +8,14 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- 引入通用样式 -->
<link rel="stylesheet" href="common-styles.css">
<!-- 引入导航功能 -->
<script src="navigation.js"></script>
<style>
/* 页面特定样式 - 覆盖通用样式中的部分设置 */
:root {
--primary-color: #6366f1;
--primary-light: #8b5cf6;
@@ -495,12 +502,19 @@
completePlacement() {
if(this.planes.every(p => p.isPlaced)) {
this.updateStatus("准备就绪,等待对手...");
this.updateStatus("准备就绪,正在进入对战...");
localStorage.setItem('playerPlanes', JSON.stringify(this.planes));
// 禁用所有按钮
Object.values(this.dom).flat().forEach(el => {
if(el.tagName === 'BUTTON') el.disabled = true;
});
// 延迟1秒后跳转到对战页面
setTimeout(() => {
if (typeof window.completePlacementAndNavigate === 'function') {
window.completePlacementAndNavigate();
} else if (typeof navigateTo === 'function') {
navigateTo('battle');
} else {
window.location.href = '05_对战页面.html';
}
}, 1000);
} else {
this.updateStatus("请先放置所有飞机。");
}