feat(game): 添加游戏房间菜单和托管功能

- 引入机器人和退出图标资源
- 实现游戏房间顶部菜单触发器和弹出菜单
- 添加托管模式切换功能
- 实现退出房间功能
- 添加全局点击和ESC键关闭菜单事件监听
- 优化菜单动画效果和交互反馈
- 移除侧边按钮区域的聊天、赞赏和开局按钮
- 调整时钟位置以适应新菜单布局
This commit is contained in:
2026-03-24 17:25:37 +08:00
parent 716bc2b106
commit 679116e455
4 changed files with 264 additions and 16 deletions

View File

@@ -107,6 +107,27 @@
z-index: 5;
}
.menu-trigger-wrap {
position: relative;
}
.menu-trigger {
transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.menu-trigger.is-feedback {
transform: scale(0.92);
}
.menu-trigger-icon {
display: inline-block;
transform-origin: center;
}
.menu-trigger.is-feedback .menu-trigger-icon {
animation: menu-toggle-spin 170ms cubic-bezier(0.2, 0.75, 0.35, 1) 1;
}
.metal-circle {
width: 50px;
height: 50px;
@@ -122,6 +143,106 @@
0 8px 16px rgba(0, 0, 0, 0.22);
}
.menu-popover {
position: absolute;
top: -4px;
left: 58px;
min-width: 124px;
padding: 8px;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.16);
background: rgba(18, 20, 27, 0.94);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
transform-origin: left top;
}
.menu-pop-enter-active,
.menu-pop-leave-active {
transition: transform 170ms cubic-bezier(0.2, 0.78, 0.3, 1), opacity 170ms ease-out;
}
.menu-pop-enter-from,
.menu-pop-leave-to {
opacity: 0;
transform: scale(0.92);
}
.menu-pop-enter-to,
.menu-pop-leave-from {
opacity: 1;
transform: scale(1);
}
.menu-list {
display: flex;
flex-direction: column;
gap: 6px;
width: 100%;
}
.menu-item {
display: inline-flex;
align-items: center;
gap: 10px;
width: 100%;
min-height: 48px;
border: 0;
border-radius: 8px;
color: #eaf3ff;
background: transparent;
text-align: left;
padding: 0 10px;
font-size: 15px;
font-weight: 700;
line-height: 1;
transform: translateX(0);
transition: background-color 130ms ease-out, transform 130ms ease-out;
}
.menu-item-icon {
width: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
opacity: 0.9;
flex: 0 0 18px;
}
.menu-item-icon img {
width: 16px;
height: 16px;
display: block;
filter: brightness(0) invert(1);
}
.menu-item:hover {
background: rgba(255, 255, 255, 0.12);
transform: translateX(4px);
}
.menu-item:active {
transform: scale(0.96);
}
.menu-item-danger {
color: #ffd0d0;
}
.menu-item-delay-1,
.menu-item-delay-2 {
opacity: 0;
transform: translateY(6px);
animation: menu-item-reveal 180ms ease-out forwards;
}
.menu-item-delay-1 {
animation-delay: 60ms;
}
.menu-item-delay-2 {
animation-delay: 120ms;
}
.left-counter {
display: inline-flex;
align-items: center;
@@ -133,6 +254,38 @@
background: rgba(13, 15, 20, 0.78);
}
.trust-chip {
display: inline-flex;
align-items: center;
height: 28px;
padding: 0 10px;
border-radius: 999px;
border: 1px solid rgba(132, 235, 166, 0.3);
color: #d4ffe0;
font-size: 12px;
background: rgba(23, 109, 52, 0.42);
}
@keyframes menu-toggle-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(22deg);
}
}
@keyframes menu-item-reveal {
0% {
opacity: 0;
transform: translateY(6px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.counter-light {
width: 16px;
height: 24px;
@@ -145,8 +298,8 @@
.top-right-clock {
position: absolute;
top: 14px;
right: 16px;
top: 30px;
right: 36px;
display: inline-flex;
align-items: center;
gap: 12px;