Skip to content

Commit 01b76da

Browse files
atsumitanakaclaude
andcommitted
Full responsive: pie charts scale, table scrollable, breakpoints
- Pie chart size adapts to container width (max 200px) - Project table wrapped in scrollable container (no overflow) - Table min-width ensures columns don't collapse - Added breakpoints for 900/768/560/480px - Stats, tools grid, and fonts scale down progressively Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cb04987 commit 01b76da

1 file changed

Lines changed: 74 additions & 22 deletions

File tree

links/index.html

Lines changed: 74 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,17 @@
327327

328328

329329
/* ======== Project Table ======== */
330+
.table-wrap {
331+
width: 100%;
332+
overflow-x: auto;
333+
-webkit-overflow-scrolling: touch;
334+
margin-top: 32px;
335+
}
336+
330337
.project-table {
331338
width: 100%;
339+
min-width: 580px;
332340
border-collapse: collapse;
333-
margin-top: 32px;
334341
}
335342

336343
.project-table th {
@@ -342,6 +349,7 @@
342349
color: #64748b;
343350
padding: 10px 16px;
344351
border-bottom: 1px solid rgba(148, 163, 184, 0.15);
352+
white-space: nowrap;
345353
}
346354

347355
.project-table th.num {
@@ -352,6 +360,7 @@
352360
padding: 12px 16px;
353361
font-size: 14px;
354362
border-bottom: 1px solid rgba(148, 163, 184, 0.07);
363+
white-space: nowrap;
355364
}
356365

357366
.project-table tr:hover td {
@@ -401,11 +410,26 @@
401410
.tools-grid {
402411
grid-template-columns: repeat(3, 1fr);
403412
}
413+
414+
.pie-charts-grid {
415+
gap: 16px;
416+
}
404417
}
405418

406419
@media (max-width: 900px) {
407420
.pie-charts-grid {
408421
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;
409433
}
410434
}
411435

@@ -435,11 +459,28 @@
435459
.stat-number {
436460
font-size: 20px;
437461
}
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+
}
438479
}
439480

440481
@media (max-width: 480px) {
441482
body {
442-
padding: 24px 12px 48px;
483+
padding: 24px 10px 48px;
443484
}
444485

445486
.tools-grid {
@@ -448,16 +489,24 @@
448489
}
449490

450491
.stats-row {
451-
gap: 10px;
492+
gap: 8px;
452493
}
453494

454495
.stat-item {
455-
min-width: 80px;
456-
padding: 10px 8px;
496+
min-width: 60px;
497+
padding: 10px 6px;
457498
}
458499

459500
.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;
461510
}
462511
}
463512
</style>
@@ -512,20 +561,22 @@ <h2>Starrydata2 Web System</h2>
512561
<div class="pie-charts-grid" id="pie-charts">
513562
<div style="grid-column:1/-1;text-align:center;color:#64748b;padding:24px;">Loading...</div>
514563
</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>
529580
</div>
530581

531582
<!-- ===== Tools ===== -->
@@ -874,7 +925,8 @@ <h3>Debye-Scherrer XRD Plots</h3>
874925
const canvas = document.getElementById(canvasId);
875926
if (!canvas) return;
876927
const ctx = canvas.getContext('2d');
877-
const size = 200;
928+
const container = canvas.parentElement;
929+
const size = Math.min(200, container.clientWidth - 20);
878930
const dpr = window.devicePixelRatio || 1;
879931
canvas.width = size * dpr;
880932
canvas.height = size * dpr;
@@ -904,7 +956,7 @@ <h3>Debye-Scherrer XRD Plots</h3>
904956

905957
// Total in center
906958
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`;
908960
ctx.textAlign = 'center';
909961
ctx.textBaseline = 'middle';
910962
ctx.fillText(total.toLocaleString(), cx, cy);

0 commit comments

Comments
 (0)