FingerprintLogin.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. <template>
  2. <div class="recognize-wrapper">
  3. <div class="recognize-container">
  4. <!-- 状态圆形区域 -->
  5. <div class="status-circle" :class="statusClass">
  6. <div class="circle-glow" />
  7. <div class="fingerprint-icon-wrapper">
  8. <svg class="fingerprint-svg" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  9. <!-- 外侧指纹脊线 -->
  10. <ellipse
  11. cx="100" cy="100" rx="85" ry="90" fill="none" stroke="currentColor" stroke-width="2"
  12. opacity="0.3"
  13. />
  14. <ellipse
  15. cx="100" cy="100" rx="75" ry="80" fill="none" stroke="currentColor" stroke-width="2"
  16. opacity="0.4"
  17. />
  18. <ellipse
  19. cx="100" cy="100" rx="65" ry="70" fill="none" stroke="currentColor" stroke-width="2"
  20. opacity="0.5"
  21. />
  22. <!-- 内侧指纹脊线 -->
  23. <path
  24. d="M100 30 C130 30, 150 50, 150 80 C150 110, 130 130, 100 130 C70 130, 50 110, 50 80 C50 50, 70 30, 100 30"
  25. fill="none" stroke="currentColor" stroke-width="2.5" opacity="0.6"
  26. />
  27. <path
  28. d="M100 40 C120 40, 135 55, 135 75 C135 95, 120 110, 100 110 C80 110, 65 95, 65 75 C65 55, 80 40, 100 40"
  29. fill="none" stroke="currentColor" stroke-width="2.5" opacity="0.7"
  30. />
  31. <path
  32. d="M100 50 C110 50, 120 60, 120 70 C120 80, 110 90, 100 90 C90 90, 80 80, 80 70 C80 60, 90 50, 100 50"
  33. fill="none" stroke="currentColor" stroke-width="2.5" opacity="0.8"
  34. />
  35. <!-- 指纹脊线 -->
  36. <path
  37. d="M60 60 Q100 40, 140 60" fill="none" stroke="currentColor" stroke-width="1.5"
  38. opacity="0.6"
  39. />
  40. <path
  41. d="M65 70 Q100 50, 135 70" fill="none" stroke="currentColor" stroke-width="1.5"
  42. opacity="0.6"
  43. />
  44. <path
  45. d="M70 80 Q100 60, 130 80" fill="none" stroke="currentColor" stroke-width="1.5"
  46. opacity="0.6"
  47. />
  48. <path
  49. d="M75 90 Q100 70, 125 90" fill="none" stroke="currentColor" stroke-width="1.5"
  50. opacity="0.6"
  51. />
  52. <path
  53. d="M80 100 Q100 80, 120 100" fill="none" stroke="currentColor" stroke-width="1.5"
  54. opacity="0.6"
  55. />
  56. <!-- 中央螺旋纹 -->
  57. <circle
  58. cx="100" cy="75" r="8" fill="none" stroke="currentColor" stroke-width="2"
  59. opacity="0.8"
  60. />
  61. <circle cx="100" cy="75" r="4" fill="currentColor" opacity="0.6" />
  62. </svg>
  63. <!-- 扫描线动画 -->
  64. <div v-if="status === 'recognizing'" class="scan-line" />
  65. </div>
  66. <!-- 成功图标 -->
  67. <div v-if="status === 'success'" class="success-icon">
  68. <svg viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
  69. <circle cx="26" cy="26" r="25" fill="none" />
  70. <path fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" />
  71. </svg>
  72. </div>
  73. <!-- 失败图标 -->
  74. <div v-if="status === 'failed'" class="failed-icon">
  75. <svg viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
  76. <circle cx="26" cy="26" r="25" fill="none" />
  77. <path fill="none" d="M16 16 36 36 M36 16 16 36" />
  78. </svg>
  79. </div>
  80. </div>
  81. <!-- 状态文本 -->
  82. <div class="status-text">
  83. {{ isConnected ? statusText : '设备未连接' }}
  84. </div>
  85. <!-- 操作按钮 -->
  86. <div class="action-buttons">
  87. <van-button
  88. type="default" size="large" round block class="action-btn password-btn"
  89. @click="goToPasswordLogin"
  90. >
  91. <template #icon>
  92. <i class="fas fa-key" />
  93. </template>
  94. 使用密码登录
  95. </van-button>
  96. <van-button
  97. type="default" size="large" round block class="action-btn restart-btn"
  98. @click="handleRestart"
  99. >
  100. <template #icon>
  101. <i class="fas fa-redo-alt" />
  102. </template>
  103. 重启指纹识别
  104. </van-button>
  105. </div>
  106. <!-- 用户信息(识别成功后显示) -->
  107. <!-- <div v-if="status === 'success' && userInfo" class="user-info">
  108. <div class="user-avatar">
  109. <span class="avatar-text">{{ userInfo.name ? userInfo.name.charAt(0) : '?' }}</span>
  110. </div>
  111. <div class="user-details">
  112. <div class="user-name">{{ userInfo.name || '未知用户' }}</div>
  113. <div class="user-role">{{ userInfo.loginName || '' }}</div>
  114. </div>
  115. </div> -->
  116. </div>
  117. </div>
  118. </template>
  119. <script setup>
  120. import { useRouter, useRoute } from 'vue-router';
  121. import { ref, onMounted, onUnmounted } from 'vue';
  122. import { showSuccessToast, showFailToast, Button as VanButton } from 'vant';
  123. const route = useRoute();
  124. const router = useRouter();
  125. // 状态:waiting(等待识别), recognizing(识别中), success(成功), failed(失败)
  126. const userInfo = ref(null);
  127. const status = ref('waiting');
  128. const statusText = ref('');
  129. const isConnected = ref(false);
  130. // 计算状态类名
  131. const statusClass = ref('status-waiting');
  132. // 更新状态
  133. const updateStatus = (newStatus, text) => {
  134. status.value = newStatus;
  135. statusText.value = text;
  136. switch (newStatus) {
  137. case 'waiting':
  138. statusClass.value = 'status-waiting';
  139. break;
  140. case 'recognizing':
  141. statusClass.value = 'status-recognizing';
  142. break;
  143. case 'success':
  144. statusClass.value = 'status-success';
  145. break;
  146. case 'failed':
  147. statusClass.value = 'status-failed';
  148. break;
  149. }
  150. };
  151. // 处理指纹响应
  152. const handleFingerprintResponse = data => {
  153. console.log('接收到指纹设备的响应信息', data);
  154. if (!data) {
  155. updateStatus('failed', '识别失败,未接收到数据');
  156. showFailToast('识别失败');
  157. return;
  158. }
  159. const code = data.code;
  160. const msg = data.message || '';
  161. const responseData = data.loginInfo;
  162. if (code === 0) {
  163. // 有数据说明登录成功
  164. userInfo.value = responseData;
  165. if (msg === '连接成功' || msg === '请按下手指') {
  166. isConnected.value = true;
  167. updateStatus('recognizing', '请按下手指');
  168. }
  169. if (msg === '正在同步指纹,请稍后进行指纹登录') {
  170. updateStatus('waiting', '正在同步指纹,请稍后进行指纹登录');
  171. }
  172. if (responseData) {
  173. updateStatus('success', '识别成功,登录成功!');
  174. setTimeout(() => {
  175. localStorage.setItem('#token', responseData.token);
  176. localStorage.setItem('#accountId', responseData.accountId);
  177. localStorage.setItem('#LoginInfo', JSON.stringify(responseData));
  178. showSuccessToast('欢迎登录,' + responseData.userName);
  179. const redirectUrl = window.location.href.split('redirectUrl=')[1];
  180. if (redirectUrl) {
  181. window.location = decodeURIComponent(redirectUrl);
  182. } else {
  183. router.push('/home');
  184. }
  185. }, 1000);
  186. }
  187. } else {
  188. if (msg === '连接失败') {
  189. isConnected.value = false;
  190. } else {
  191. updateStatus('failed', msg || '识别失败,请重试');
  192. }
  193. }
  194. };
  195. // 开始识别
  196. const startRecognize = () => {
  197. if (!plugin.fingerprintConfig) {
  198. updateStatus('failed', '指纹设备插件未就绪');
  199. showFailToast('设备不支持指纹识别功能');
  200. return;
  201. }
  202. try {
  203. plugin.fingerprintConfig.recognize();
  204. } catch (error) {
  205. console.error('启动指纹识别失败', error);
  206. updateStatus('failed', '启动识别失败');
  207. showFailToast('启动识别失败');
  208. }
  209. };
  210. // 重启指纹识别
  211. const handleRestart = () => {
  212. userInfo.value = null;
  213. isConnected.value = true;
  214. updateStatus('waiting', '指纹重启中,请稍后...');
  215. setTimeout(() => {
  216. startRecognize();
  217. updateStatus('recognizing', '请按下手指');
  218. }, 1000);
  219. };
  220. // 跳转到密码登录页面
  221. const goToPasswordLogin = () => {
  222. const isOut = localStorage.getItem('isOut') === 'true';
  223. if (isOut) {
  224. router.push({ path: '/login', query: { isOut: 'true' } });
  225. } else {
  226. router.push('/login');
  227. }
  228. };
  229. // 组件挂载
  230. onMounted(() => {
  231. // 检查URL参数中是否包含isOut=true,如果有则存储到localStorage
  232. const isOutParam = route.query.isOut;
  233. if (isOutParam !== undefined) {
  234. const isOutValue = String(isOutParam) === 'true' ? 'true' : 'false';
  235. if (isOutValue == 'true') {
  236. localStorage.setItem('isOut', isOutValue);
  237. } else {
  238. localStorage.setItem('isOut', isOutValue);
  239. }
  240. } else {
  241. localStorage.setItem('isOut', 'false');
  242. }
  243. // 设置指纹设备的响应处理函数
  244. if (plugin.fingerprintConfig) {
  245. plugin.fingerprintConfig.connect();
  246. plugin.fingerprintConfig.receiveFingerprintResponse = handleFingerprintResponse;
  247. }
  248. // 延迟500ms后开始识别
  249. setTimeout(() => {
  250. startRecognize();
  251. }, 500);
  252. });
  253. // 组件卸载
  254. onUnmounted(() => {
  255. // 清理响应处理函数
  256. if (plugin.fingerprintConfig) {
  257. plugin.fingerprintConfig.receiveFingerprintResponse = () => { };
  258. plugin.fingerprintConfig.disableConnect();
  259. }
  260. });
  261. </script>
  262. <style scoped>
  263. .recognize-wrapper {
  264. width: 100%;
  265. height: 100vh;
  266. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. overflow: hidden;
  271. position: relative;
  272. }
  273. /* 背景动画 */
  274. .recognize-wrapper::before {
  275. content: '';
  276. position: absolute;
  277. width: 200%;
  278. height: 200%;
  279. background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  280. background-size: 50px 50px;
  281. animation: backgroundMove 20s linear infinite;
  282. }
  283. @keyframes backgroundMove {
  284. 0% {
  285. transform: translate(0, 0);
  286. }
  287. 100% {
  288. transform: translate(50px, 50px);
  289. }
  290. }
  291. .recognize-container {
  292. position: relative;
  293. z-index: 1;
  294. display: flex;
  295. flex-direction: column;
  296. align-items: center;
  297. justify-content: center;
  298. gap: 2rem;
  299. padding: 2rem;
  300. max-width: 500px;
  301. width: 90%;
  302. }
  303. /* 状态圆形 */
  304. .status-circle {
  305. position: relative;
  306. width: clamp(250px, 40vw, 350px);
  307. height: clamp(250px, 40vw, 350px);
  308. border-radius: 50%;
  309. background: rgba(255, 255, 255, 0.95);
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  314. transition: all 0.5s ease;
  315. overflow: hidden;
  316. }
  317. .circle-glow {
  318. position: absolute;
  319. inset: -20px;
  320. border-radius: 50%;
  321. opacity: 0;
  322. transition: opacity 0.5s ease;
  323. }
  324. /* 等待状态 */
  325. .status-waiting {
  326. border: 4px solid rgba(102, 126, 234, 0.3);
  327. }
  328. .status-waiting .circle-glow {
  329. background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
  330. opacity: 0.5;
  331. }
  332. /* 识别中状态 */
  333. .status-recognizing {
  334. border: 4px solid #667eea;
  335. animation: circlePulse 2s infinite;
  336. }
  337. .status-recognizing .circle-glow {
  338. background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
  339. opacity: 1;
  340. animation: glowPulse 2s infinite;
  341. }
  342. @keyframes circlePulse {
  343. 0%,
  344. 100% {
  345. transform: scale(1);
  346. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  347. }
  348. 50% {
  349. transform: scale(1.05);
  350. box-shadow: 0 25px 70px rgba(102, 126, 234, 0.5);
  351. }
  352. }
  353. @keyframes glowPulse {
  354. 0%,
  355. 100% {
  356. opacity: 0.8;
  357. }
  358. 50% {
  359. opacity: 1;
  360. }
  361. }
  362. /* 成功状态 */
  363. .status-success {
  364. border: 4px solid #10b981;
  365. background: rgba(16, 185, 129, 0.1);
  366. animation: successBounce 0.6s ease;
  367. }
  368. .status-success .circle-glow {
  369. background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
  370. opacity: 1;
  371. }
  372. @keyframes successBounce {
  373. 0% {
  374. transform: scale(1);
  375. }
  376. 50% {
  377. transform: scale(1.1);
  378. }
  379. 100% {
  380. transform: scale(1);
  381. }
  382. }
  383. /* 失败状态 */
  384. .status-failed {
  385. border: 4px solid #ef4444;
  386. animation: shake 0.5s ease;
  387. }
  388. .status-failed .circle-glow {
  389. background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
  390. opacity: 1;
  391. }
  392. @keyframes shake {
  393. 0%,
  394. 100% {
  395. transform: translateX(0);
  396. }
  397. 25% {
  398. transform: translateX(-10px);
  399. }
  400. 75% {
  401. transform: translateX(10px);
  402. }
  403. }
  404. /* 指纹图标 */
  405. .fingerprint-icon-wrapper {
  406. position: relative;
  407. width: 100%;
  408. height: 100%;
  409. display: flex;
  410. align-items: center;
  411. justify-content: center;
  412. }
  413. .fingerprint-svg {
  414. width: 60%;
  415. height: 60%;
  416. color: #9ca3af;
  417. transition: color 0.5s ease;
  418. }
  419. .status-waiting .fingerprint-svg {
  420. color: #d1d5db;
  421. }
  422. .status-recognizing .fingerprint-svg {
  423. color: #667eea;
  424. }
  425. .status-success .fingerprint-svg {
  426. color: #10b981;
  427. opacity: 0.3;
  428. }
  429. .status-failed .fingerprint-svg {
  430. color: #ef4444;
  431. opacity: 0.3;
  432. }
  433. /* 扫描线动画 */
  434. .scan-line {
  435. position: absolute;
  436. top: 0;
  437. left: 0;
  438. right: 0;
  439. height: 3px;
  440. background: linear-gradient(90deg, transparent, #667eea, transparent);
  441. animation: scanning 2s linear infinite;
  442. }
  443. @keyframes scanning {
  444. 0% {
  445. transform: translateY(0);
  446. }
  447. 100% {
  448. transform: translateY(clamp(250px, 40vw, 350px));
  449. }
  450. }
  451. /* 成功图标 */
  452. .success-icon {
  453. position: absolute;
  454. width: 50%;
  455. height: 50%;
  456. animation: iconAppear 0.5s ease forwards;
  457. }
  458. .success-icon svg {
  459. width: 100%;
  460. height: 100%;
  461. }
  462. .success-icon circle {
  463. stroke: #10b981;
  464. stroke-width: 3;
  465. stroke-dasharray: 166;
  466. stroke-dashoffset: 166;
  467. animation: checkmarkCircle 0.6s ease-in-out forwards;
  468. }
  469. .success-icon path {
  470. stroke: #10b981;
  471. stroke-width: 4;
  472. stroke-linecap: round;
  473. stroke-linejoin: round;
  474. stroke-dasharray: 48;
  475. stroke-dashoffset: 48;
  476. animation: checkmark 0.3s 0.3s ease-in-out forwards;
  477. }
  478. @keyframes iconAppear {
  479. from {
  480. opacity: 0;
  481. transform: scale(0.5);
  482. }
  483. to {
  484. opacity: 1;
  485. transform: scale(1);
  486. }
  487. }
  488. @keyframes checkmarkCircle {
  489. to {
  490. stroke-dashoffset: 0;
  491. }
  492. }
  493. @keyframes checkmark {
  494. to {
  495. stroke-dashoffset: 0;
  496. }
  497. }
  498. /* 失败图标 */
  499. .failed-icon {
  500. position: absolute;
  501. width: 50%;
  502. height: 50%;
  503. animation: iconAppear 0.5s ease forwards;
  504. }
  505. .failed-icon svg {
  506. width: 100%;
  507. height: 100%;
  508. }
  509. .failed-icon circle {
  510. stroke: #ef4444;
  511. stroke-width: 3;
  512. stroke-dasharray: 166;
  513. stroke-dashoffset: 166;
  514. animation: checkmarkCircle 0.6s ease-in-out forwards;
  515. }
  516. .failed-icon path {
  517. stroke: #ef4444;
  518. stroke-width: 4;
  519. stroke-linecap: round;
  520. stroke-dasharray: 50;
  521. stroke-dashoffset: 50;
  522. animation: crossmark 0.3s 0.3s ease-in-out forwards;
  523. }
  524. @keyframes crossmark {
  525. to {
  526. stroke-dashoffset: 0;
  527. }
  528. }
  529. /* 状态文本 */
  530. .status-text {
  531. font-size: clamp(1.2rem, 3vw, 1.8rem);
  532. font-weight: 600;
  533. color: white;
  534. text-align: center;
  535. text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  536. animation: textFadeIn 0.5s ease;
  537. }
  538. @keyframes textFadeIn {
  539. from {
  540. opacity: 0;
  541. transform: translateY(10px);
  542. }
  543. to {
  544. opacity: 1;
  545. transform: translateY(0);
  546. }
  547. }
  548. /* 用户信息卡片 */
  549. .user-info {
  550. background: rgba(255, 255, 255, 0.95);
  551. border-radius: 16px;
  552. padding: 1.5rem 2rem;
  553. display: flex;
  554. align-items: center;
  555. gap: 1rem;
  556. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  557. animation: slideUp 0.5s ease;
  558. width: 100%;
  559. max-width: 400px;
  560. }
  561. @keyframes slideUp {
  562. from {
  563. opacity: 0;
  564. transform: translateY(20px);
  565. }
  566. to {
  567. opacity: 1;
  568. transform: translateY(0);
  569. }
  570. }
  571. .user-avatar {
  572. width: 60px;
  573. height: 60px;
  574. border-radius: 50%;
  575. background: linear-gradient(135deg, #667eea, #764ba2);
  576. display: flex;
  577. align-items: center;
  578. justify-content: center;
  579. flex-shrink: 0;
  580. }
  581. .avatar-text {
  582. font-size: 1.5rem;
  583. font-weight: 700;
  584. color: white;
  585. }
  586. .user-details {
  587. flex: 1;
  588. }
  589. .user-name {
  590. font-size: 1.3rem;
  591. font-weight: 700;
  592. color: #1f2937;
  593. margin-bottom: 0.25rem;
  594. }
  595. .user-role {
  596. font-size: 1rem;
  597. color: #6b7280;
  598. }
  599. /* 操作按钮 */
  600. .action-buttons {
  601. display: flex;
  602. gap: 1rem;
  603. animation: slideUp 0.5s ease;
  604. }
  605. .retry-button {
  606. height: 3.5rem;
  607. padding: 0 2.5rem;
  608. font-size: 1.1rem;
  609. font-weight: 600;
  610. background: white;
  611. color: #667eea;
  612. border: 2px solid white;
  613. border-radius: 50px;
  614. transition: all 0.3s ease;
  615. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  616. }
  617. .retry-button:hover {
  618. background: rgba(255, 255, 255, 0.9);
  619. transform: translateY(-2px);
  620. box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  621. }
  622. /* 响应式设计 */
  623. @media (max-width: 768px) {
  624. .recognize-container {
  625. gap: 1.5rem;
  626. padding: 1.5rem;
  627. }
  628. .status-circle {
  629. width: clamp(200px, 50vw, 280px);
  630. height: clamp(200px, 50vw, 280px);
  631. }
  632. .user-info {
  633. padding: 1rem 1.5rem;
  634. }
  635. .user-avatar {
  636. width: 50px;
  637. height: 50px;
  638. }
  639. .avatar-text {
  640. font-size: 1.2rem;
  641. }
  642. .user-name {
  643. font-size: 1.1rem;
  644. }
  645. .user-role {
  646. font-size: 0.9rem;
  647. }
  648. }
  649. /* 暗色模式支持 */
  650. @media (prefers-color-scheme: dark) {
  651. .status-circle {
  652. background: rgba(31, 41, 55, 0.95);
  653. }
  654. .user-info {
  655. background: rgba(31, 41, 55, 0.95);
  656. }
  657. .user-name {
  658. color: #f9fafb;
  659. }
  660. .user-role {
  661. color: #d1d5db;
  662. }
  663. }
  664. /* 操作按钮 */
  665. .action-buttons {
  666. display: flex;
  667. flex-direction: column;
  668. gap: 1rem;
  669. width: 100%;
  670. max-width: 350px;
  671. animation: textFadeIn 0.5s ease;
  672. }
  673. .action-btn {
  674. font-size: 1rem;
  675. font-weight: 500;
  676. height: 48px !important;
  677. transition: all 0.3s ease;
  678. }
  679. .action-btn i {
  680. margin-right: 8px;
  681. font-size: 16px;
  682. }
  683. /* 密码登录按钮样式 */
  684. :deep(.password-btn) {
  685. background: rgba(255, 255, 255, 0.15) !important;
  686. border: 2px solid rgba(255, 255, 255, 0.5) !important;
  687. color: white !important;
  688. backdrop-filter: blur(10px);
  689. }
  690. :deep(.password-btn:active) {
  691. background: rgba(255, 255, 255, 0.25) !important;
  692. }
  693. /* 重启按钮样式 */
  694. :deep(.restart-btn) {
  695. background: rgba(255, 255, 255, 0.1) !important;
  696. border: 2px solid rgba(255, 255, 255, 0.3) !important;
  697. color: rgba(255, 255, 255, 0.9) !important;
  698. backdrop-filter: blur(10px);
  699. }
  700. :deep(.restart-btn:active) {
  701. background: rgba(255, 255, 255, 0.2) !important;
  702. }
  703. /* 响应式设计 */
  704. @media (max-width: 768px) {
  705. .action-buttons {
  706. max-width: 100%;
  707. padding: 0 1rem;
  708. }
  709. }
  710. /* 减少动画(无障碍支持) */
  711. @media (prefers-reduced-motion: reduce) {
  712. * {
  713. animation-duration: 0.01ms !important;
  714. animation-iteration-count: 1 !important;
  715. transition-duration: 0.01ms !important;
  716. }
  717. }
  718. </style>