|
327 | 327 |
|
328 | 328 |
|
329 | 329 | /* ======== Project Table ======== */ |
| 330 | + .table-wrap { |
| 331 | + width: 100%; |
| 332 | + overflow-x: auto; |
| 333 | + -webkit-overflow-scrolling: touch; |
| 334 | + margin-top: 32px; |
| 335 | + } |
| 336 | + |
330 | 337 | .project-table { |
331 | 338 | width: 100%; |
| 339 | + min-width: 580px; |
332 | 340 | border-collapse: collapse; |
333 | | - margin-top: 32px; |
334 | 341 | } |
335 | 342 |
|
336 | 343 | .project-table th { |
|
342 | 349 | color: #64748b; |
343 | 350 | padding: 10px 16px; |
344 | 351 | border-bottom: 1px solid rgba(148, 163, 184, 0.15); |
| 352 | + white-space: nowrap; |
345 | 353 | } |
346 | 354 |
|
347 | 355 | .project-table th.num { |
|
352 | 360 | padding: 12px 16px; |
353 | 361 | font-size: 14px; |
354 | 362 | border-bottom: 1px solid rgba(148, 163, 184, 0.07); |
| 363 | + white-space: nowrap; |
355 | 364 | } |
356 | 365 |
|
357 | 366 | .project-table tr:hover td { |
|
401 | 410 | .tools-grid { |
402 | 411 | grid-template-columns: repeat(3, 1fr); |
403 | 412 | } |
| 413 | + |
| 414 | + .pie-charts-grid { |
| 415 | + gap: 16px; |
| 416 | + } |
404 | 417 | } |
405 | 418 |
|
406 | 419 | @media (max-width: 900px) { |
407 | 420 | .pie-charts-grid { |
408 | 421 | grid-template-columns: repeat(2, 1fr); |
| 422 | + gap: 16px; |
| 423 | + } |
| 424 | + |
| 425 | + .main-img-wrap { |
| 426 | + width: 300px; |
| 427 | + } |
| 428 | + |
| 429 | + .project-table th, |
| 430 | + .project-table td { |
| 431 | + padding: 10px 10px; |
| 432 | + font-size: 13px; |
409 | 433 | } |
410 | 434 | } |
411 | 435 |
|
|
435 | 459 | .stat-number { |
436 | 460 | font-size: 20px; |
437 | 461 | } |
| 462 | + |
| 463 | + .project-table th, |
| 464 | + .project-table td { |
| 465 | + padding: 8px 8px; |
| 466 | + font-size: 12px; |
| 467 | + } |
| 468 | + } |
| 469 | + |
| 470 | + @media (max-width: 560px) { |
| 471 | + .pie-charts-grid { |
| 472 | + grid-template-columns: repeat(2, 1fr); |
| 473 | + gap: 12px; |
| 474 | + } |
| 475 | + |
| 476 | + .pie-chart-card h4 { |
| 477 | + font-size: 12px; |
| 478 | + } |
438 | 479 | } |
439 | 480 |
|
440 | 481 | @media (max-width: 480px) { |
441 | 482 | body { |
442 | | - padding: 24px 12px 48px; |
| 483 | + padding: 24px 10px 48px; |
443 | 484 | } |
444 | 485 |
|
445 | 486 | .tools-grid { |
|
448 | 489 | } |
449 | 490 |
|
450 | 491 | .stats-row { |
451 | | - gap: 10px; |
| 492 | + gap: 8px; |
452 | 493 | } |
453 | 494 |
|
454 | 495 | .stat-item { |
455 | | - min-width: 80px; |
456 | | - padding: 10px 8px; |
| 496 | + min-width: 60px; |
| 497 | + padding: 10px 6px; |
457 | 498 | } |
458 | 499 |
|
459 | 500 | .stat-number { |
460 | | - font-size: 18px; |
| 501 | + font-size: 16px; |
| 502 | + } |
| 503 | + |
| 504 | + .stat-label { |
| 505 | + font-size: 9px; |
| 506 | + } |
| 507 | + |
| 508 | + .project-table { |
| 509 | + min-width: 480px; |
461 | 510 | } |
462 | 511 | } |
463 | 512 | </style> |
@@ -512,20 +561,22 @@ <h2>Starrydata2 Web System</h2> |
512 | 561 | <div class="pie-charts-grid" id="pie-charts"> |
513 | 562 | <div style="grid-column:1/-1;text-align:center;color:#64748b;padding:24px;">Loading...</div> |
514 | 563 | </div> |
515 | | - <table class="project-table"> |
516 | | - <thead> |
517 | | - <tr> |
518 | | - <th>Project</th> |
519 | | - <th class="num">Papers</th> |
520 | | - <th class="num">Figures</th> |
521 | | - <th class="num">Samples</th> |
522 | | - <th class="num">Curves</th> |
523 | | - </tr> |
524 | | - </thead> |
525 | | - <tbody id="project-tbody"> |
526 | | - <tr><td colspan="5" style="color:#64748b; text-align:center; padding:24px;">Loading...</td></tr> |
527 | | - </tbody> |
528 | | - </table> |
| 564 | + <div class="table-wrap"> |
| 565 | + <table class="project-table"> |
| 566 | + <thead> |
| 567 | + <tr> |
| 568 | + <th>Project</th> |
| 569 | + <th class="num">Papers</th> |
| 570 | + <th class="num">Figures</th> |
| 571 | + <th class="num">Samples</th> |
| 572 | + <th class="num">Curves</th> |
| 573 | + </tr> |
| 574 | + </thead> |
| 575 | + <tbody id="project-tbody"> |
| 576 | + <tr><td colspan="5" style="color:#64748b; text-align:center; padding:24px;">Loading...</td></tr> |
| 577 | + </tbody> |
| 578 | + </table> |
| 579 | + </div> |
529 | 580 | </div> |
530 | 581 |
|
531 | 582 | <!-- ===== Tools ===== --> |
@@ -874,7 +925,8 @@ <h3>Debye-Scherrer XRD Plots</h3> |
874 | 925 | const canvas = document.getElementById(canvasId); |
875 | 926 | if (!canvas) return; |
876 | 927 | const ctx = canvas.getContext('2d'); |
877 | | - const size = 200; |
| 928 | + const container = canvas.parentElement; |
| 929 | + const size = Math.min(200, container.clientWidth - 20); |
878 | 930 | const dpr = window.devicePixelRatio || 1; |
879 | 931 | canvas.width = size * dpr; |
880 | 932 | canvas.height = size * dpr; |
@@ -904,7 +956,7 @@ <h3>Debye-Scherrer XRD Plots</h3> |
904 | 956 |
|
905 | 957 | // Total in center |
906 | 958 | ctx.fillStyle = '#e2e8f0'; |
907 | | - ctx.font = `bold ${size * 0.11}px -apple-system, sans-serif`; |
| 959 | + ctx.font = `bold ${Math.max(10, size * 0.11)}px -apple-system, sans-serif`; |
908 | 960 | ctx.textAlign = 'center'; |
909 | 961 | ctx.textBaseline = 'middle'; |
910 | 962 | ctx.fillText(total.toLocaleString(), cx, cy); |
|
0 commit comments