283 lines
8.2 KiB
HTML
283 lines
8.2 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Card Header 修复效果预览</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||
background: #f5f5f5;
|
||
padding: 20px;
|
||
}
|
||
|
||
.container {
|
||
max-width: 800px;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.title {
|
||
text-align: center;
|
||
margin-bottom: 30px;
|
||
color: #333;
|
||
}
|
||
|
||
/* 修复后的样式 */
|
||
.project-card {
|
||
padding: 20px;
|
||
margin-bottom: 20px;
|
||
background-color: #ffffff;
|
||
border-radius: 12px;
|
||
border: 1px solid #e5e5e5;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
transition: all 0.3s ease;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.project-card:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
|
||
border-color: #007aff;
|
||
}
|
||
|
||
.card-header {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
margin-bottom: 16px;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.header-left {
|
||
flex: 1;
|
||
min-width: 0;
|
||
margin-right: 16px;
|
||
}
|
||
|
||
.header-right {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-end;
|
||
flex-shrink: 0;
|
||
gap: 8px;
|
||
}
|
||
|
||
.card-title {
|
||
font-size: 18px;
|
||
font-weight: bold;
|
||
color: #333333;
|
||
margin-bottom: 4px;
|
||
line-height: 1.3;
|
||
word-wrap: break-word;
|
||
overflow-wrap: break-word;
|
||
}
|
||
|
||
.card-category {
|
||
font-size: 14px;
|
||
color: #666666;
|
||
margin-bottom: 12px;
|
||
line-height: 1.2;
|
||
}
|
||
|
||
.difficulty-badge,
|
||
.status-badge {
|
||
position: static;
|
||
padding: 4px 12px;
|
||
border-radius: 12px;
|
||
font-size: 12px;
|
||
margin-bottom: 0;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.difficulty-1 {
|
||
background-color: #e8f5e8;
|
||
color: #2e7d32;
|
||
}
|
||
|
||
.difficulty-2 {
|
||
background-color: #fff3e0;
|
||
color: #f57c00;
|
||
}
|
||
|
||
.difficulty-3 {
|
||
background-color: #ffebee;
|
||
color: #d32f2f;
|
||
}
|
||
|
||
.status-badge.active {
|
||
background-color: #e8f5e8;
|
||
color: #2e7d32;
|
||
}
|
||
|
||
.status-badge.inactive {
|
||
background-color: #f0f0f0;
|
||
color: #666666;
|
||
}
|
||
|
||
.card-description {
|
||
font-size: 14px;
|
||
color: #666666;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
/* Web环境优化 */
|
||
@media screen and (min-width: 768px) {
|
||
.card-header {
|
||
align-items: center;
|
||
}
|
||
|
||
.header-left {
|
||
margin-right: 24px;
|
||
}
|
||
|
||
.header-right {
|
||
flex-direction: row;
|
||
align-items: center;
|
||
gap: 12px;
|
||
}
|
||
|
||
.difficulty-badge,
|
||
.status-badge {
|
||
font-size: 14px;
|
||
padding: 6px 16px;
|
||
}
|
||
|
||
.project-card {
|
||
padding: 30px;
|
||
border-radius: 16px;
|
||
}
|
||
|
||
.card-title {
|
||
font-size: 20px;
|
||
}
|
||
|
||
.card-category {
|
||
font-size: 16px;
|
||
}
|
||
|
||
.card-description {
|
||
font-size: 16px;
|
||
}
|
||
}
|
||
|
||
/* 移动端优化 */
|
||
@media screen and (max-width: 767px) {
|
||
.card-header {
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.header-right {
|
||
flex-direction: column;
|
||
align-items: flex-end;
|
||
gap: 8px;
|
||
}
|
||
|
||
.difficulty-badge,
|
||
.status-badge {
|
||
font-size: 12px;
|
||
padding: 4px 12px;
|
||
}
|
||
}
|
||
|
||
.demo-note {
|
||
background: #f0f8ff;
|
||
border: 1px solid #007aff;
|
||
border-radius: 8px;
|
||
padding: 15px;
|
||
margin-bottom: 20px;
|
||
font-size: 14px;
|
||
color: #333;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<h1 class="title">Card Header 修复效果预览</h1>
|
||
|
||
<div class="demo-note">
|
||
<strong>测试说明:</strong> 调整浏览器窗口大小查看响应式效果。在大屏幕下,右侧badge水平排列;在小屏幕下,垂直排列。
|
||
</div>
|
||
|
||
<div class="project-card">
|
||
<div class="card-header">
|
||
<div class="header-left">
|
||
<div class="card-title">基础篮球运球训练</div>
|
||
<div class="card-category">篮球训练</div>
|
||
</div>
|
||
<div class="header-right">
|
||
<div class="difficulty-badge difficulty-1">
|
||
<span>初级</span>
|
||
</div>
|
||
<div class="status-badge active">
|
||
<span>已启用</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="card-description">
|
||
适合初学者的篮球运球基础技能训练项目,包含原地运球、行进间运球和变向运球等基础技巧练习。
|
||
</div>
|
||
</div>
|
||
|
||
<div class="project-card">
|
||
<div class="card-header">
|
||
<div class="header-left">
|
||
<div class="card-title">足球传球技术训练</div>
|
||
<div class="card-category">足球训练</div>
|
||
</div>
|
||
<div class="header-right">
|
||
<div class="difficulty-badge difficulty-2">
|
||
<span>中级</span>
|
||
</div>
|
||
<div class="status-badge active">
|
||
<span>已启用</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="card-description">
|
||
提高足球传球准确性和技术的专项训练,涵盖短传、长传和实战配合等多种传球技巧。
|
||
</div>
|
||
</div>
|
||
|
||
<div class="project-card">
|
||
<div class="card-header">
|
||
<div class="header-left">
|
||
<div class="card-title">高级网球正手击球技术训练课程</div>
|
||
<div class="card-category">网球训练</div>
|
||
</div>
|
||
<div class="header-right">
|
||
<div class="difficulty-badge difficulty-3">
|
||
<span>高级</span>
|
||
</div>
|
||
<div class="status-badge inactive">
|
||
<span>已停用</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="card-description">
|
||
网球正手击球技术的系统性训练课程,通过系统化的练习方法提高击球稳定性和力量控制。
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// 添加一些交互效果
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
const cards = document.querySelectorAll('.project-card');
|
||
cards.forEach(card => {
|
||
card.addEventListener('click', function() {
|
||
console.log('卡片被点击:', this.querySelector('.card-title').textContent);
|
||
});
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|