feat: 优化入口页面并新增房主等待房间原型在入口页面入口页面.html中,将单个“开始游戏”按钮替换为“快速开始”、“自动匹配”、“创建房间”和“加入游戏”四个游戏模式选项,并重构按钮样式。新增房主视角的房间等待页面原型房间等待[房主].html及其线框图方案。
This commit is contained in:
552
01_文档/原型设计/房间等待[房主].html
Normal file
552
01_文档/原型设计/房间等待[房主].html
Normal file
@@ -0,0 +1,552 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>房间等待 - 打飞机对战</title>
|
||||
<style>
|
||||
/* 基础CSS变量 */
|
||||
:root {
|
||||
/* 主色调 - 深空科技蓝 */
|
||||
--primary-color: #6366f1;
|
||||
--primary-light: #8b5cf6;
|
||||
--primary-dark: #4f46e5;
|
||||
|
||||
/* 辅助色 - 科技青色 */
|
||||
--secondary-color: #40e0d0;
|
||||
--secondary-light: #26d0ce;
|
||||
|
||||
/* 强调色 - 橙色 */
|
||||
--accent-color: #f59e0b;
|
||||
--accent-light: #fbbf24;
|
||||
|
||||
/* 危险色 - 红色 */
|
||||
--danger-color: #ff4757;
|
||||
--danger-light: #ff6b6b;
|
||||
|
||||
/* 背景色系 - 深色渐变 */
|
||||
--bg-primary: #0f1419;
|
||||
--bg-secondary: #1a1d29;
|
||||
--bg-tertiary: #252837;
|
||||
--bg-elevated: #2d3142;
|
||||
|
||||
/* 渐变背景 */
|
||||
--gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 30%, #16213e 70%, #0f3460 100%);
|
||||
|
||||
/* 边框色系 */
|
||||
--border-primary: #3d4159;
|
||||
--border-secondary: #4a5073;
|
||||
--border-highlight: #6366f1;
|
||||
--border-accent: rgba(64, 224, 208, 0.3);
|
||||
|
||||
/* 文字色系 */
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #b4b7c9;
|
||||
--text-tertiary: #9ca3af;
|
||||
--text-disabled: #6b7280;
|
||||
|
||||
/* 触摸目标尺寸 */
|
||||
--touch-target-min: 44px;
|
||||
--safe-area-padding: 20px;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei UI", sans-serif;
|
||||
background: var(--gradient-bg);
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-x: hidden;
|
||||
touch-action: manipulation;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.safe-area {
|
||||
padding-left: env(safe-area-inset-left);
|
||||
padding-right: env(safe-area-inset-right);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.app-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: var(--safe-area-padding);
|
||||
max-width: 400px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 头部导航 */
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
background: rgba(99, 102, 241, 0.15);
|
||||
border-radius: 12px;
|
||||
color: var(--primary-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.back-btn:active {
|
||||
transform: scale(0.95);
|
||||
background: rgba(99, 102, 241, 0.25);
|
||||
}
|
||||
|
||||
.room-info {
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
.room-number {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.room-label {
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
background: rgba(64, 224, 208, 0.15);
|
||||
border-radius: 12px;
|
||||
color: var(--secondary-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.share-btn:active {
|
||||
transform: scale(0.95);
|
||||
background: rgba(64, 224, 208, 0.25);
|
||||
}
|
||||
|
||||
/* 主内容区域 */
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 玩家项 */
|
||||
.player-item {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
padding: 20px;
|
||||
background: rgba(22, 33, 62, 0.8);
|
||||
border: 1px solid rgba(64, 224, 208, 0.3);
|
||||
border-radius: 16px;
|
||||
backdrop-filter: blur(10px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
transition: all 0.3s ease;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.player-item.host {
|
||||
background: rgba(99, 102, 241, 0.1);
|
||||
}
|
||||
|
||||
.player-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.player-avatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ai-avatar {
|
||||
background: linear-gradient(135deg, var(--text-tertiary), var(--text-secondary));
|
||||
}
|
||||
|
||||
.player-details {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 16px;
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.player-stats {
|
||||
font-size: 14px;
|
||||
color: var(--text-secondary);
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* 状态和操作 */
|
||||
.player-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-ready {
|
||||
background: rgba(64, 224, 208, 0.2);
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
|
||||
.status-waiting {
|
||||
background: rgba(156, 163, 175, 0.2);
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.kick-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
background: rgba(255, 71, 87, 0.15);
|
||||
border-radius: 8px;
|
||||
color: var(--danger-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.kick-btn:active {
|
||||
transform: scale(0.95);
|
||||
background: rgba(255, 71, 87, 0.25);
|
||||
}
|
||||
|
||||
/* 底部操作按钮 */
|
||||
.action-area {
|
||||
margin-top: auto;
|
||||
padding-top: 20px;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.start-game-btn {
|
||||
width: 100%;
|
||||
min-height: var(--touch-target-min);
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
padding: 16px 24px;
|
||||
background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
|
||||
color: #1a1a2e;
|
||||
box-shadow: 0 4px 16px rgba(64, 224, 208, 0.3);
|
||||
transition: box-shadow 0.3s ease, opacity 0.3s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.start-game-btn:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* 响应式适配 */
|
||||
@media (max-width: 375px) {
|
||||
.player-item {
|
||||
padding: 16px;
|
||||
min-height: 72px;
|
||||
}
|
||||
|
||||
.player-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.player-stats {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 640px) {
|
||||
.app-container {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.players-container {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 触觉反馈动画 */
|
||||
.haptic-feedback {
|
||||
animation: hapticVibrate 0.1s ease-out;
|
||||
}
|
||||
|
||||
@keyframes hapticVibrate {
|
||||
0%, 100% { transform: translateX(0); }
|
||||
25% { transform: translateX(-1px); }
|
||||
75% { transform: translateX(1px); }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="safe-area">
|
||||
<div class="app-container">
|
||||
<!-- 头部导航 -->
|
||||
<header class="header">
|
||||
<button class="back-btn" onclick="goBack()">
|
||||
←
|
||||
</button>
|
||||
<div class="room-info">
|
||||
<div class="room-number">123456</div>
|
||||
<div class="room-label">房间号</div>
|
||||
</div>
|
||||
<button class="share-btn" onclick="shareRoomCode()">
|
||||
📋
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<!-- 主内容 -->
|
||||
<main class="main-content">
|
||||
<!-- 房主信息 -->
|
||||
<div class="player-item host">
|
||||
<div class="player-info">
|
||||
<div class="player-avatar">张</div>
|
||||
<div class="player-details">
|
||||
<div class="player-name">张三(房主)</div>
|
||||
<div class="player-stats">
|
||||
<div class="stat-item">
|
||||
<span>🏆</span>
|
||||
<span>156场</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span>📊</span>
|
||||
<span>68%胜率</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="player-status">
|
||||
<div class="status-badge status-ready">✅准备</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AI对手信息 -->
|
||||
<div class="player-item">
|
||||
<div class="player-info">
|
||||
<div class="player-avatar ai-avatar">🤖</div>
|
||||
<div class="player-details">
|
||||
<div class="player-name">AI对手</div>
|
||||
<div class="player-stats">
|
||||
<div class="stat-item">
|
||||
<span>🎯</span>
|
||||
<span>智能难度</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="player-status">
|
||||
<div class="status-badge status-waiting">⏳等待</div>
|
||||
<button class="kick-btn" onclick="kickPlayer()">❌</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部操作区域 -->
|
||||
<div class="action-area">
|
||||
<button class="start-game-btn" onclick="startGame()">
|
||||
🎮 开始游戏
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 返回上一页
|
||||
function goBack() {
|
||||
console.log('返回上一页');
|
||||
// 添加触觉反馈
|
||||
vibrate();
|
||||
// 实际项目中这里应该调用路由返回或页面跳转
|
||||
}
|
||||
|
||||
|
||||
// 踢出玩家
|
||||
function kickPlayer() {
|
||||
console.log('踢出AI对手');
|
||||
vibrate();
|
||||
|
||||
// 显示确认提示
|
||||
if (confirm('确定要踢出AI对手吗?')) {
|
||||
// 实际项目中这里应该调用踢出玩家的API
|
||||
alert('AI对手已被踢出');
|
||||
}
|
||||
}
|
||||
|
||||
// 开始游戏
|
||||
function startGame() {
|
||||
console.log('开始游戏');
|
||||
vibrate();
|
||||
|
||||
// 检查是否所有玩家都准备
|
||||
alert('游戏即将开始...');
|
||||
// 实际项目中这里应该跳转到游戏页面
|
||||
}
|
||||
|
||||
// 分享房间码
|
||||
function shareRoomCode() {
|
||||
console.log('分享房间码');
|
||||
vibrate();
|
||||
|
||||
// 复制房间码到剪贴板
|
||||
const roomCode = '123456';
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(roomCode).then(() => {
|
||||
showToast('房间码已复制到剪贴板');
|
||||
});
|
||||
} else {
|
||||
// 降级方案
|
||||
showToast('房间码:' + roomCode);
|
||||
}
|
||||
}
|
||||
|
||||
// 触觉反馈
|
||||
function vibrate() {
|
||||
if ('vibrate' in navigator) {
|
||||
navigator.vibrate(10);
|
||||
}
|
||||
document.body.classList.add('haptic-feedback');
|
||||
setTimeout(() => document.body.classList.remove('haptic-feedback'), 100);
|
||||
}
|
||||
|
||||
// 显示提示信息
|
||||
function showToast(message) {
|
||||
// 简单的提示实现
|
||||
const toast = document.createElement('div');
|
||||
toast.textContent = message;
|
||||
toast.style.cssText = `
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
z-index: 1000;
|
||||
animation: fadeInOut 2s ease;
|
||||
`;
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
@keyframes fadeInOut {
|
||||
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
|
||||
20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
||||
100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
|
||||
}
|
||||
`;
|
||||
|
||||
document.head.appendChild(style);
|
||||
document.body.appendChild(toast);
|
||||
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(toast);
|
||||
document.head.removeChild(style);
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// 页面加载完成后的初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('房间等待页面已加载');
|
||||
|
||||
// 模拟网络状态检查
|
||||
setTimeout(() => {
|
||||
console.log('房间状态同步完成');
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// 防止页面缩放
|
||||
document.addEventListener('gesturestart', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// 添加按钮点击反馈
|
||||
document.querySelectorAll('button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
this.style.transform = 'scale(0.95)';
|
||||
setTimeout(() => {
|
||||
this.style.transform = '';
|
||||
}, 150);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user