From b547564befe97020b75d6b38eae563ef6ba89bc1 Mon Sep 17 00:00:00 2001 From: "liweiliang0905@gmail.com" Date: Fri, 23 Jan 2026 18:00:42 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=BF=90=E5=8A=A8/=E9=A5=AE=E9=A3=9F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=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 - 运动页面: 响应式网格、表格转卡片、FAB 位置调整 - 饮食页面: 日历紧凑布局、照片网格优化 - 两页均添加底部 Tab 导航 Co-Authored-By: Claude Opus 4.5 --- src/vitals/web/app.py | 136 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 119 insertions(+), 17 deletions(-) diff --git a/src/vitals/web/app.py b/src/vitals/web/app.py index 7e136c5..2c08488 100644 --- a/src/vitals/web/app.py +++ b/src/vitals/web/app.py @@ -4179,15 +4179,24 @@ def get_exercise_page_html() -> str: .nav a:hover { color: #667eea; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { - flex-wrap: wrap; - gap: 10px; - } - .modal-content { - margin: 5% auto; - width: 95%; - } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + /* 表格转卡片 */ + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } } @@ -4496,6 +4505,45 @@ def get_exercise_page_html() -> str: document.getElementById('addExerciseForm').addEventListener('submit', submitExerciseForm); loadExerciseStats(); loadExerciseList(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + + @@ -4754,16 +4802,31 @@ def get_meal_page_html() -> str: button:disabled { opacity: 0.7; cursor: not-allowed; } .nav a { transition: color 0.2s; } .nav a:hover { color: #f59e0b; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { - flex-wrap: wrap; - gap: 10px; - } - .calendar .day { - min-height: 60px; - padding: 8px; - } - .modal-content { margin: 5% auto; width: 95%; } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + .calendar { grid-template-columns: repeat(7, 1fr); gap: 4px; } + .calendar .day { min-height: 50px; padding: 6px; font-size: 0.75rem; } + .photo-grid { grid-template-columns: repeat(2, 1fr); } + .photo-grid img { height: 100px; } + /* 表格转卡片 */ + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } + } + @media (max-width: 480px) { + .grid { grid-template-columns: 1fr; } } @@ -5230,6 +5293,45 @@ def get_meal_page_html() -> str: document.getElementById('addMealForm').addEventListener('submit', submitMealForm); loadMealStats(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + +