From 518b098f9c7b63c30712355beb3a41c6af63df42 Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Fri, 6 Jun 2025 03:28:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=BF=BB=E8=BD=AC=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/css/body.css | 154 ++++++++++++++++++++++++++++++++++++++++++- client/css/style.css | 6 ++ client/index.html | 38 +++++++++-- client/js/main.js | 8 ++- client/js/room.js | 7 +- client/js/ui.js | 78 +++++++++++++++++++++- 6 files changed, 275 insertions(+), 16 deletions(-) diff --git a/client/css/body.css b/client/css/body.css index 3d3dbb9..f1e5d1f 100644 --- a/client/css/body.css +++ b/client/css/body.css @@ -4,13 +4,161 @@ body { margin: 0; } -.login-container { +/* 翻转卡片样式 / Flip Card Styles */ +.flip-card { + perspective: 1000px; max-width: 400px; + width: 100%; + height: 500px; /* 固定高度,避免翻转时高度变化 */ +} + +.flip-card-inner { + position: relative; + width: 100%; + height: 100%; + text-align: center; + transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); + transform-style: preserve-3d; + transform-origin: center center; /* 设置旋转中心为卡片中心 */ +} + +.flip-card.flipped .flip-card-inner { + transform: rotateX(180deg); +} + +.flip-card-front, +.flip-card-back { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + backface-visibility: hidden; + border-radius: 14px; + padding: 32px 24px 24px 24px; + box-shadow: 0 2px 16px rgba(60, 80, 100, 0.09); + background: #fff; + box-sizing: border-box; + display: flex; + flex-direction: column; +} + +.flip-card-back { + transform: rotateX(180deg); + padding-top: 30px; +} + +/* 帮助按钮样式 / Help Button Styles */ +.help-btn { + position: absolute; + top: 16px; + right: 16px; + background: none; + border: 0px; + color: #666; + width: 40px; + height: 40px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; + z-index: 10; +} + +.help-btn:hover { + background: #30a8f7; + border-color: #30a8f7; + color: #fff; + transform: scale(1.1); +} + +.help-btn:active { + transform: scale(0.95); +} + +.help-btn.back-btn { + background: #f8f9fa; + border-color: #dee2e6; +} + +.help-btn.back-btn:hover { + background: #e9ecef; + border-color: #adb5bd; + color: #495057; +} + +/* 使用说明内容样式 / Help Content Styles */ +.help-content { + text-align: left; + margin-top: 20px; + padding: 0 20px; +} + +.flip-card-back h2 { + font-size: 1.8rem; + font-weight: 600; + margin-bottom: 24px; + color: #30a8f7; +} + +.flip-card-back p { + color: #666; + line-height: 1.6; + font-size: 1rem; +} + +/* 移动端适配 / Mobile Adaptation */ +@media (max-width: 768px) { + .flip-card { + + width: 95%; + } + + .flip-card-front, + .flip-card-back { + padding: 24px 16px 16px 16px; + } + + .flip-card-back { + padding-top: 30px; + } + + + + .flip-card-back h2 { + font-size: 1.5rem; + margin-bottom: 20px; + } + + .help-content { + padding: 0 10px; + } +} + +/* 触摸设备优化 / Touch Device Optimization */ +@media (hover: none) and (pointer: coarse) { + .help-btn:hover { + transform: none; + } + + .help-btn:active { + transform: scale(0.95); + } +} + +.login-container { + /* 移除原有的样式,现在由flip-card处理 */ + /* max-width: 400px; margin: 60px auto 0 auto; padding: 32px 24px 24px 24px; background: #fff; border-radius: 14px; - box-shadow: 0 2px 16px rgba(60, 80, 100, 0.09); + box-shadow: 0 2px 16px rgba(60, 80, 100, 0.09); */ + display: flex; + flex-direction: row; + justify-content: space-around; text-align: center; } @@ -394,4 +542,4 @@ body { .send-message-btn:active .text { fill: #fff; transition: all 0.1s; -} \ No newline at end of file +} diff --git a/client/css/style.css b/client/css/style.css index d76520b..af8d7ba 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -6,6 +6,12 @@ body { background: #fff; } +.login-page{ +display: flex; +justify-content: center; +flex-direction: column; +} + .container { display: flex; height: 100vh; diff --git a/client/index.html b/client/index.html index 8f0b8bb..94c1f15 100644 --- a/client/index.html +++ b/client/index.html @@ -32,13 +32,37 @@ } -
-