Spaces:
Sleeping
Sleeping
File size: 17,265 Bytes
c86c45b 9def1ee e72f32a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | /* =========================================
1. REACT layout setting
========================================= */
html, body, #root {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.app-container {
width: 100%;
min-height: 100vh; /* screen height */
display: flex;
flex-direction: column;
background-color: #f9f9f9;
}
/* =========================================
2. original layout
========================================= */
/* GLOBAL STYLES */
body {
font-family: 'Nunito', sans-serif;
background-color: #f9f9f9;
overflow-x: hidden;
overflow-y: auto;
}
/* dynamic class name */
.hidden {
display: none !important;
}
/* TOP MENU */
#top-menu {
height: 60px;
background-color: white;
display: flex;
align-items: center;
justify-content: center; /* Center buttons horizontally */
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
}
.menu-btn {
background: none;
border: none;
font-family: 'Nunito', sans-serif;
font-size: 16px;
color: #333;
padding: 10px 20px;
cursor: pointer;
transition: background-color 0.2s;
}
.menu-btn:hover {
background-color: #f0f0f0;
border-radius: 4px;
}
/* active for React */
.menu-btn.active {
font-weight: bold;
color: #007BFF;
background-color: #eef7ff;
border-radius: 4px;
}
.separator {
width: 1px;
height: 20px;
background-color: #555; /* Dark gray separator */
margin: 0 5px;
}
/* PAGE CONTAINER */
.page {
/* content under menu */
min-height: calc(100vh - 60px);
width: 100%;
padding-top: 60px; /* Space for fixed menu */
padding-bottom: 40px; /* Space at bottom for scrolling */
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
}
/* Ensure page titles are black */
.page h1 {
color: #000 !important;
background: transparent !important;
}
.page-title {
color: #000 !important;
background: transparent !important;
}
/* PAGE A SPECIFIC */
#page-a {
justify-content: center; /* Center vertically */
/* 注意:因为 React 结构变化,如果感觉偏下,可以微调这个 margin-top */
margin-top: -40px;
flex: 1; /* 确保它占满剩余空间以便垂直居中 */
}
#page-a h1 {
font-size: 80px;
margin: 0 0 10px 0;
color: #000;
text-align: center; /* 确保文字居中 */
}
#page-a p {
color: #666;
font-size: 20px;
margin-bottom: 40px;
text-align: center;
}
.btn-main {
background-color: #007BFF; /* Blue */
color: white;
border: none;
padding: 15px 50px;
font-size: 20px;
font-family: 'Nunito', sans-serif;
border-radius: 30px; /* Fully rounded corners */
cursor: pointer;
transition: transform 0.2s ease;
}
.btn-main:hover {
transform: scale(1.1); /* Zoom effect */
}
/* PAGE B SPECIFIC */
#page-b {
justify-content: space-evenly; /* Distribute vertical space */
padding-bottom: 20px;
min-height: calc(100vh - 60px); /* 再次确保高度足够 */
}
/* 1. Display Area */
#display-area {
width: 60%;
height: 50vh; /* 改用 vh 单位,确保在不同屏幕下的高度比例 */
min-height: 300px;
border: 2px solid #ddd;
border-radius: 12px;
background-color: #fff;
display: flex;
align-items: center;
justify-content: center;
color: #555;
font-size: 24px;
position: relative;
/* 确保视频元素也能居中且不溢出 */
overflow: hidden;
}
#display-area video {
width: 100%;
height: 100%;
object-fit: cover; /* 类似于 background-size: cover */
}
/* 2. Timeline Area */
#timeline-area {
width: 60%;
height: 80px;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.timeline-label {
position: absolute;
top: 0;
left: 0;
color: #888;
font-size: 14px;
}
#timeline-line {
width: 100%;
height: 2px;
background-color: #87CEEB; /* Light blue */
}
/* 3. Control Panel */
#control-panel {
display: flex;
gap: 20px;
width: 60%;
justify-content: space-between;
}
.action-btn {
flex: 1; /* Evenly distributed width */
padding: 12px 0;
border: none;
border-radius: 12px;
font-size: 16px;
font-family: 'Nunito', sans-serif;
font-weight: 700;
cursor: pointer;
color: white;
transition: opacity 0.2s;
}
.action-btn:hover {
opacity: 0.9;
}
.action-btn.green { background-color: #28a745; }
.action-btn.yellow { background-color: #ffce0b; }
.action-btn.blue { background-color: #326ed6; }
.action-btn.red { background-color: #dc3545; }
/* 4. Frame Control */
#frame-control {
display: flex;
align-items: center;
gap: 15px;
color: #333;
font-weight: bold;
}
#frame-slider {
width: 200px;
cursor: pointer;
}
#frame-input {
width: 50px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 5px;
text-align: center;
font-family: 'Nunito', sans-serif;
}
/* ================ ACHIEVEMENT PAGE ================ */
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
width: 80%;
margin: 40px auto;
}
.stat-card {
background: white;
padding: 30px;
border-radius: 12px;
text-align: center;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.stat-number {
font-size: 48px;
font-weight: bold;
color: #007BFF;
margin-bottom: 10px;
}
.stat-label {
font-size: 16px;
color: #666;
}
.achievements-section {
width: 80%;
margin: 0 auto;
}
.achievements-section h2 {
color: #333;
margin-bottom: 20px;
}
.badges-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.badge {
background: white;
padding: 30px 20px;
border-radius: 12px;
text-align: center;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: transform 0.2s;
}
.badge:hover {
transform: translateY(-5px);
}
.badge.locked {
opacity: 0.4;
filter: grayscale(100%);
}
.badge-icon {
font-size: 64px;
margin-bottom: 15px;
}
.badge-name {
font-size: 16px;
font-weight: bold;
color: #333;
}
/* ================ RECORDS PAGE ================ */
.records-controls {
display: flex;
gap: 10px;
margin: 20px auto;
width: 80%;
justify-content: center;
}
.filter-btn {
padding: 10px 20px;
border: 2px solid #007BFF;
background: white;
color: #007BFF;
border-radius: 8px;
cursor: pointer;
font-family: 'Nunito', sans-serif;
font-weight: 600;
transition: all 0.2s;
}
.filter-btn:hover {
background: #e7f3ff;
}
.filter-btn.active {
background: #007BFF;
color: white;
}
.chart-container {
width: 80%;
background: white;
padding: 30px;
border-radius: 12px;
margin: 20px auto;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#focus-chart {
display: block;
margin: 0 auto;
/* 确保图表在容器内自适应 */
max-width: 100%;
}
.sessions-list {
width: 80%;
margin: 20px auto;
}
.sessions-list h2 {
color: #333;
margin-bottom: 15px;
}
#sessions-table {
width: 100%;
background: white;
border-collapse: collapse;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#sessions-table th {
background: #007BFF;
color: white;
padding: 15px;
text-align: left;
font-weight: 600;
}
#sessions-table td {
padding: 12px 15px;
border-bottom: 1px solid #eee;
}
#sessions-table tr:last-child td {
border-bottom: none;
}
#sessions-table tbody tr:hover {
background: #f8f9fa;
}
.btn-view {
padding: 6px 12px;
background: #007BFF;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-family: 'Nunito', sans-serif;
transition: background 0.2s;
}
.btn-view:hover {
background: #0056b3;
}
/* ================ SETTINGS PAGE ================ */
.settings-container {
width: 60%;
max-width: 800px;
margin: 20px auto;
}
.setting-group {
background: white;
padding: 30px;
border-radius: 12px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.setting-group h2 {
margin-top: 0;
color: #333;
font-size: 20px;
margin-bottom: 20px;
border-bottom: 2px solid #007BFF;
padding-bottom: 10px;
}
.setting-item {
margin-bottom: 25px;
}
.setting-item:last-child {
margin-bottom: 0;
}
.setting-item label {
display: block;
margin-bottom: 8px;
color: #333;
font-weight: 600;
}
.slider-group {
display: flex;
align-items: center;
gap: 15px;
}
.slider-group input[type="range"] {
flex: 1;
}
.slider-group span {
min-width: 40px;
text-align: center;
font-weight: bold;
color: #007BFF;
font-size: 18px;
}
.setting-description {
font-size: 14px;
color: #666;
margin-top: 5px;
font-style: italic;
}
input[type="checkbox"] {
margin-right: 10px;
cursor: pointer;
}
input[type="number"] {
width: 100px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
font-family: 'Nunito', sans-serif;
}
/* --- 新的代码:让按钮居中且变宽 --- */
.setting-group .action-btn {
display: inline-block; /* 允许并排显示 */
width: 48%; /* 两个按钮各占约一半宽度 (留2%缝隙) */
margin: 15px 1%; /* 上下 15px,左右 1% 间距来实现居中和分隔 */
text-align: center; /* 文字居中 */
box-sizing: border-box; /* 确保边框不会撑大按钮导致换行 */
}
#save-settings {
display: block;
margin: 20px auto;
}
/* ================ HELP PAGE ================ */
.help-container {
width: 70%;
max-width: 900px;
margin: 20px auto;
}
/* Fake ad block (Help page) */
.fake-ad {
position: relative;
display: block;
width: min(600px, 90%);
margin: 10px auto 30px auto;
border: 1px solid #e5e5e5;
border-radius: 12px;
overflow: hidden;
background: #fff;
text-decoration: none;
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fake-ad:hover {
transform: translateY(-2px);
box-shadow: 0 12px 30px rgba(0,0,0,0.16);
}
.fake-ad img {
display: block;
width: 100%;
height: auto;
}
.fake-ad-badge {
position: absolute;
top: 12px;
left: 12px;
background: rgba(0,0,0,0.75);
color: #fff;
font-size: 12px;
padding: 4px 8px;
border-radius: 6px;
letter-spacing: 0.5px;
}
.fake-ad-cta {
position: absolute;
right: 12px;
bottom: 12px;
background: #111;
color: #fff;
font-size: 14px;
padding: 8px 12px;
border-radius: 8px;
}
.help-section {
background: white;
padding: 30px;
border-radius: 12px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.help-section h2 {
color: #007BFF;
margin-top: 0;
margin-bottom: 15px;
}
.help-section ol,
.help-section ul {
line-height: 1.8;
color: #333;
}
.help-section p {
line-height: 1.6;
color: #333;
}
details {
margin: 15px 0;
cursor: pointer;
padding: 10px;
background: #f8f9fa;
border-radius: 5px;
}
summary {
font-weight: bold;
padding: 5px;
color: #007BFF;
}
details[open] summary {
margin-bottom: 10px;
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
}
details p {
margin: 10px 0 0 0;
}
/* ================ SESSION SUMMARY MODAL ================ */
/* 如果将来要做弹窗,这些样式可以直接复用 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
}
.modal-content {
background: white;
padding: 40px;
border-radius: 16px;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
max-width: 500px;
width: 90%;
}
.modal-content h2 {
margin-top: 0;
color: #333;
text-align: center;
margin-bottom: 30px;
}
.summary-stats {
margin-bottom: 30px;
}
.summary-item {
display: flex;
justify-content: space-between;
padding: 15px 0;
border-bottom: 1px solid #eee;
}
.summary-item:last-child {
border-bottom: none;
}
.summary-label {
font-weight: 600;
color: #666;
}
.summary-value {
font-weight: bold;
color: #007BFF;
font-size: 18px;
}
.modal-content .btn-main {
display: block;
margin: 0 auto;
padding: 12px 40px;
}
/* ================ TIMELINE BLOCKS ================ */
.timeline-block {
transition: opacity 0.2s;
border-radius: 2px;
}
.timeline-block:hover {
opacity: 0.7;
}
/* ================ RESPONSIVE DESIGN ================ */
@media (max-width: 1200px) {
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
.badges-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.stats-grid,
.badges-grid {
grid-template-columns: 1fr;
width: 90%;
}
.settings-container,
.help-container,
.chart-container,
.sessions-list,
.records-controls {
width: 90%;
}
#control-panel {
width: 90%;
flex-wrap: wrap;
}
#display-area {
width: 90%;
}
#timeline-area {
width: 90%;
}
#frame-control {
width: 90%;
flex-direction: column;
}
}
/* =========================================
SESSION RESULT OVERLAY (新增)
========================================= */
.session-result-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85); /* 深色半透明背景 */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: white;
z-index: 10;
animation: fadeIn 0.5s ease;
backdrop-filter: blur(5px); /* 背景模糊效果 (可选) */
}
.session-result-overlay h3 {
font-size: 32px;
margin-bottom: 30px;
color: #4cd137; /* 绿色标题 */
text-transform: uppercase;
letter-spacing: 2px;
}
.session-result-overlay .result-item {
display: flex;
justify-content: space-between;
width: 200px; /* 控制宽度 */
margin-bottom: 15px;
font-size: 20px;
border-bottom: 1px solid rgba(255,255,255,0.2);
padding-bottom: 5px;
}
.session-result-overlay .label {
color: #ccc;
font-weight: normal;
}
.session-result-overlay .value {
color: #fff;
font-weight: bold;
font-family: 'Courier New', monospace; /* 看起来像数据 */
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
/* ================= 迎宾弹窗样式 ================= */
.welcome-modal-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.welcome-modal {
background-color: #1e1e24;
padding: 40px;
border-radius: 15px;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
border: 1px solid #333;
}
.welcome-modal h2 { margin-top: 0; color: #fff; }
.welcome-modal p { margin-bottom: 30px; color: #ccc; }
.welcome-buttons { display: flex; gap: 20px; justify-content: center; }
/* ================= 左上角头像样式 (修改版) ================= */
#top-menu {
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-container {
position: absolute;
left: 20px;
cursor: pointer;
}
.avatar-circle {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
font-size: 1.2rem;
color: white;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.avatar-circle.user { background-color: #555; }
.avatar-circle.admin { background-color: #ffaa00; border-color: #fff; box-shadow: 0 0 10px rgba(255, 170, 0, 0.5); }
/* ================= 首页按钮 2x2 响应式网格 (终极修正版) ================= */
.home-button-grid {
display: grid;
grid-template-columns: 1fr 1fr; /* 强行平分两列,绝不妥协 */
gap: 20px; /* 按钮之间的间距 */
width: 100%;
max-width: 500px; /* 限制最大宽度,宽屏下也不会显得傻大黑粗 */
margin: 40px auto 0 auto; /* 上边距40px,左右auto保证绝对居中! */
}
.home-button-grid .btn-main {
width: 100%;
height: 60px; /* 统一高度,像一块块整齐的砖头 */
margin: 0; /* 清除默认外边距 */
padding: 10px;
font-size: 1rem;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
box-sizing: border-box; /* 保证边框和内边距不会撑破格子 */
}
/* 📱 手机端专属适配 (屏幕宽度小于 600px 时自动缩放) */
@media (max-width: 600px) {
.home-button-grid {
gap: 15px;
max-width: 90%;
}
.home-button-grid .btn-main {
height: 50px;
font-size: 0.85rem;
}
} |