=== static/index.html === MBSGame - 多人坦克大战竞技场

MBS TANK ARENA

多人坦克大战竞技场 · 实时对战 · AI动态改游戏

WASD 移动
🖱️ 瞄准
🔫 点击射击
=== static/style.css === /* ============================================ MBSGame - 多人坦克大战竞技场 样式表 暗黑主题 + 霓虹色 + 玻璃拟态 ============================================ */ :root { --bg-dark: #0a0e1a; --bg-card: rgba(15, 20, 40, 0.85); --bg-glass: rgba(255, 255, 255, 0.05); --border-glow: rgba(0, 200, 255, 0.3); --neon-cyan: #00d4ff; --neon-pink: #ff006e; --neon-green: #00ff88; --neon-orange: #ff8800; --neon-purple: #a855f7; --text-primary: #e8eaf0; --text-secondary: #8892a8; --text-dim: #4a5568; --hp-green: #2ecc71; --hp-yellow: #f1c40f; --hp-red: #e74c3c; --font-display: 'Orbitron', sans-serif; --font-body: 'Noto Sans SC', sans-serif; --shadow-neon: 0 0 20px rgba(0, 212, 255, 0.3); --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4); --radius: 12px; --radius-sm: 8px; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: var(--font-body); background: var(--bg-dark); color: var(--text-primary); overflow: hidden; width: 100vw; height: 100vh; cursor: crosshair; } .screen { width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; } /* ============================================ 开始界面 ============================================ */ #start-screen { display: flex; align-items: center; justify-content: center; background: var(--bg-dark); background-image: radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 80% 50%, rgba(255, 0, 110, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 40%); z-index: 100; } .start-container { text-align: center; padding: 60px 50px; background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: 24px; backdrop-filter: blur(20px); box-shadow: var(--shadow-card), var(--shadow-neon); position: relative; max-width: 520px; width: 90%; animation: fadeInUp 0.8s ease-out; } @keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } } .logo-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; background: radial-gradient(circle, rgba(0, 212, 255, 0.2), transparent 70%); border-radius: 50%; pointer-events: none; animation: pulse 3s ease-in-out infinite; } @keyframes pulse { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; } 50% { transform: translateX(-50%) scale(1.2); opacity: 1; } } .game-title { font-family: var(--font-display); margin-bottom: 8px; } .title-line { display: block; font-size: 64px; font-weight: 900; letter-spacing: 12px; background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-shadow: none; filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.4)); } .title-sub { display: block; font-size: 18px; font-weight: 400; letter-spacing: 8px; color: var(--text-secondary); margin-top: 4px; } .game-desc { color: var(--text-dim); font-size: 14px; margin: 16px 0 32px; } .start-form { display: flex; flex-direction: column; gap: 16px; align-items: center; } #player-name { width: 100%; max-width: 320px; padding: 14px 20px; background: var(--bg-glass); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius); color: var(--text-primary); font-size: 16px; font-family: var(--font-body); outline: none; transition: all 0.3s ease; text-align: center; } #player-name:focus { border-color: var(--neon-cyan); box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); } #player-name::placeholder { color: var(--text-dim); } .btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 14px 36px; background: linear-gradient(135deg, var(--neon-cyan), #0088cc); border: none; border-radius: var(--radius); color: white; font-size: 16px; font-weight: 700; font-family: var(--font-body); cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 2px; } .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4); } .btn-primary:active { transform: translateY(0); } .btn-icon { font-size: 20px; } .controls-hint { display: flex; justify-content: center; gap: 24px; margin-top: 32px; flex-wrap: wrap; } .hint-item { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; } kbd { display: inline-block; padding: 3px 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px; font-size: 12px; font-family: var(--font-display); color: var(--text-secondary); min-width: 26px; text-align: center; } /* ============================================ 游戏画布 ============================================ */ #game-canvas { display: block; width: 100vw; height: 100vh; background: #0d1117; } /* ============================================ HUD ============================================ */ #hud { position: fixed; top: 0; left: 0; right: 0; padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 10; } #hud > * { pointer-events: auto; } #hud-left { display: flex; flex-direction: column; gap: 10px; } .hud-hp { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-sm); padding: 8px 14px; backdrop-filter: blur(10px); } .hp-label { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--neon-cyan); letter-spacing: 2px; } .hp-bar-outer { width: 180px; height: 14px; background: rgba(255, 255, 255, 0.08); border-radius: 7px; overflow: hidden; } .hp-bar-inner { width: 100%; height: 100%; background: linear-gradient(90deg, var(--hp-green), #27ae60); border-radius: 7px; transition: width 0.3s ease, background 0.3s ease; box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); } .hp-bar-inner.warning { background: linear-gradient(90deg, var(--hp-yellow), #e67e22); box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); } .hp-bar-inner.danger { background: linear-gradient(90deg, var(--hp-red), #c0392b); box-shadow: 0 0 10px rgba(231, 76, 60, 0.5); animation: hpPulse 0.6s ease-in-out infinite; } @keyframes hpPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } } .hp-text { font-family: var(--font-display); font-size: 12px; color: var(--text-secondary); min-width: 60px; text-align: right; } .hud-stats { display: flex; gap: 12px; } .stat-item { display: flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-sm); padding: 6px 12px; backdrop-filter: blur(10px); font-family: var(--font-display); font-size: 14px; font-weight: 700; } .stat-icon { font-size: 16px; } .buff-container { display: flex; gap: 6px; } .buff-icon { background: var(--bg-card); border-radius: 6px; padding: 4px 8px; font-size: 16px; border: 1px solid rgba(255, 255, 255, 0.1); animation: buffGlow 1s ease-in-out infinite alternate; } @keyframes buffGlow { from { box-shadow: 0 0 5px rgba(0, 255, 136, 0.3); } to { box-shadow: 0 0 15px rgba(0, 255, 136, 0.6); } } /* ============================================ 排行榜 ============================================ */ .leaderboard { background: var(--bg-card); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius); padding: 12px 16px; backdrop-filter: blur(10px); min-width: 200px; } .lb-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--neon-orange); letter-spacing: 1px; margin-bottom: 8px; text-align: center; } .lb-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); } .lb-item:last-child { border-bottom: none; } .lb-rank { font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--text-dim); min-width: 22px; } .lb-rank.top1 { color: #FFD700; } .lb-rank.top2 { color: #C0C0C0; } .lb-rank.top3 { color: #CD7F32; } .lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); } .lb-score { font-family: var(--font-display); font-size: 12px; color: var(--neon-cyan); font-weight: 700; } .lb-me { background: rgba(0, 212, 255, 0.1); border-radius: 4px; padding: 4px 4px; } /* ============================================ 虚拟摇杆 ============================================ */ #joystick-zone { display: none; position: fixed; bottom: 60px; left: 40px; width: 120px; height: 120px; z-index: 15; touch-action: none; } /* 仅在触摸设备或移动端显示 */ @media (pointer: coarse), (max-width: 1024px) { #joystick-zone { display: block; } } #joystick-base { width: 100%; height: 100%; background: rgba(0, 20, 40, 0.5); border: 2px solid rgba(0, 212, 255, 0.3); border-radius: 50%; box-sizing: border-box; box-shadow: 0 0 15px rgba(0, 212, 255, 0.2); backdrop-filter: blur(5px); position: relative; } #joystick-stick { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; background: radial-gradient(circle, rgba(0, 212, 255, 0.8), rgba(0, 100, 200, 0.6)); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 10px rgba(0, 212, 255, 0.6); pointer-events: none; transition: transform 0.05s; } /* ============================================ 小地图 ============================================ */ #minimap { position: fixed; bottom: 20px; right: 20px; border: 2px solid rgba(0, 212, 255, 0.3); border-radius: var(--radius-sm); background: rgba(10, 14, 26, 0.8); backdrop-filter: blur(5px); z-index: 10; } /* ============================================ 更改游戏按钮 ============================================ */ .btn-change-game { position: fixed; bottom: 20px; left: 20px; display: flex; align-items: center; gap: 8px; padding: 12px 20px; background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(255, 0, 110, 0.8)); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius); color: white; font-size: 14px; font-weight: 700; font-family: var(--font-body); cursor: pointer; transition: all 0.3s ease; z-index: 10; backdrop-filter: blur(10px); } .btn-change-game:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5); } .btn-change-game:active { transform: translateY(0); } .change-icon { font-size: 18px; animation: spin 4s linear infinite; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } /* ============================================ 模态框 ============================================ */ .modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; } .modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); } .modal-content { position: relative; background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: 20px; padding: 0; width: 90%; max-width: 520px; box-shadow: var(--shadow-card), 0 0 60px rgba(0, 212, 255, 0.15); animation: modalIn 0.3s ease-out; overflow: hidden; } @keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } } .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); } .modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--neon-purple); } .btn-close { background: none; border: none; color: var(--text-dim); font-size: 28px; cursor: pointer; line-height: 1; transition: color 0.2s ease; padding: 0 4px; } .btn-close:hover { color: var(--neon-pink); } .modal-body { padding: 20px 24px; } .modal-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; line-height: 1.6; } #suggestion-input { width: 100%; padding: 14px 16px; background: var(--bg-glass); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; font-family: var(--font-body); resize: vertical; outline: none; transition: border-color 0.3s ease; line-height: 1.6; } #suggestion-input:focus { border-color: var(--neon-purple); box-shadow: 0 0 20px rgba(168, 85, 247, 0.15); } #suggestion-input::placeholder { color: var(--text-dim); } .suggestion-status { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; animation: fadeIn 0.3s ease; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .suggestion-status.success { background: rgba(0, 255, 136, 0.1