feat(game): 添加房间管理和游戏启动功能

- 添加 setActiveRoom 导入和房间状态管理功能
- 实现房间所有者判断逻辑和玩家准备状态检查
- 添加游戏启动按钮和相关权限控制
- 实现房间信息请求和响应处理机制
- 添加 WebSocket 消息规范化处理函数
- 集成 tile 数据标准化和验证逻辑
- 更新 CSS 样式以支持新的界面元素
- 修复 Vite 配置以支持外部访问
- 优化 UI 组件布局和交互反馈机制
This commit is contained in:
2026-03-26 23:37:00 +08:00
parent 0fa3c4f1df
commit 921f47d916
5 changed files with 525 additions and 20 deletions

View File

@@ -592,9 +592,6 @@
}
.ready-toggle {
position: absolute;
right: 120px;
bottom: 70px;
display: inline-flex;
align-items: center;
justify-content: center;
@@ -615,6 +612,10 @@
animation: ready-toggle-pop 180ms ease-out;
}
.ready-toggle-inline {
position: static;
}
.ready-toggle-label {
color: #e5c472;
font-size: 14px;
@@ -631,6 +632,15 @@
transform: translateY(1px) scale(0.96);
}
.ready-toggle:disabled {
opacity: 0.56;
cursor: not-allowed;
box-shadow:
inset 0 1px 0 rgba(255, 244, 214, 0.06),
inset 0 -1px 0 rgba(0, 0, 0, 0.18),
0 4px 10px rgba(0, 0, 0, 0.14);
}
@keyframes ready-toggle-pop {
from {
opacity: 0;
@@ -762,6 +772,38 @@
font-size: 18px;
}
.waiting-owner-tip {
position: absolute;
top: 25%;
left: 50%;
transform: translate(-50%, -50%);
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 220px;
min-height: 44px;
padding: 0 20px;
border: 1px solid rgba(220, 191, 118, 0.2);
border-radius: 999px;
color: #f2d68f;
font-size: 20px;
font-weight: 800;
letter-spacing: 1px;
text-shadow:
-1px 0 rgba(0, 0, 0, 0.38),
0 1px rgba(0, 0, 0, 0.38),
1px 0 rgba(0, 0, 0, 0.38),
0 -1px rgba(0, 0, 0, 0.38);
background:
linear-gradient(180deg, rgba(14, 55, 40, 0.78), rgba(8, 36, 27, 0.82)),
radial-gradient(circle at 20% 24%, rgba(237, 214, 157, 0.08), transparent 34%);
box-shadow:
inset 0 1px 0 rgba(255, 244, 214, 0.08),
0 8px 18px rgba(0, 0, 0, 0.16);
z-index: 4;
pointer-events: none;
}
.bottom-control-panel {
position: absolute;
left: 50%;
@@ -771,6 +813,12 @@
padding: 8px 14px 12px;
}
.bottom-action-bar {
display: flex;
justify-content: flex-end;
margin-bottom: 10px;
}
.control-copy {
margin-bottom: 10px;
text-align: center;
@@ -1085,10 +1133,21 @@
width: calc(100% - 40px);
}
.waiting-owner-tip {
top: 23%;
min-width: 0;
width: calc(100% - 60px);
font-size: 16px;
}
.bottom-control-panel {
width: calc(100% - 20px);
}
.bottom-action-bar {
justify-content: center;
}
.action-orbs {
position: static;
justify-content: center;