201 lines
3.4 KiB
CSS
201 lines
3.4 KiB
CSS
/* Reset some default styles */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* Body & Page Background */
|
|
body {
|
|
font-family: 'Arial', sans-serif;
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
/* 页眉导航栏 */
|
|
.navbar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
background-color: #2575fc;
|
|
color: white;
|
|
border-radius: 10px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.navbar .logo h1 {
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.navbar-links a {
|
|
color: white;
|
|
text-decoration: none;
|
|
margin: 0 15px;
|
|
font-size: 16px;
|
|
transition: color 0.3s;
|
|
}
|
|
|
|
.navbar-links a:hover {
|
|
color: #f1c40f;
|
|
}
|
|
|
|
.navbar .avatar img {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
border: 2px solid white;
|
|
}
|
|
|
|
/* Dashboard 主体部分 */
|
|
.dashboard {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 0 20px;
|
|
}
|
|
|
|
.dashboard-title {
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
margin-bottom: 20px;
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
/* 课程卡片容器 */
|
|
.course-cards {
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
gap: 20px;
|
|
justify-content: flex-start;
|
|
padding: 10px 0;
|
|
overflow: hidden;
|
|
position: relative;
|
|
|
|
}
|
|
|
|
/* 课程卡片 */
|
|
.course-card {
|
|
width: 300px;
|
|
height: 500px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background-color: white;
|
|
border-radius: 15px;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
|
overflow: hidden;
|
|
transition: transform 0.3s;
|
|
}
|
|
|
|
.select-button {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 10px;
|
|
background-color: #2575fc;
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
margin-top: auto; /* 将按钮推到父元素的底部 */
|
|
}
|
|
|
|
.course-card:hover {
|
|
transform: translateY(-10px); /* 提升效果 */
|
|
}
|
|
|
|
.course-image {
|
|
width: 100%;
|
|
height: 200px;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.course-info {
|
|
padding: 20px;
|
|
}
|
|
|
|
.course-name {
|
|
font-size: 22px;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
.course-description {
|
|
font-size: 14px;
|
|
color: #777;
|
|
margin-top: 10px;
|
|
}
|
|
/* 右侧滑出进度卡片样式 */
|
|
.course-progress {
|
|
position: fixed;
|
|
top: 0;
|
|
right: -400px; /* 初始时在屏幕外 */
|
|
width: 400px;
|
|
height: 100%;
|
|
background-color: #fff;
|
|
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
|
|
padding: 30px;
|
|
transition: right 0.3s ease;
|
|
z-index: 9999;
|
|
border-radius: 15px; /* 添加圆角 */
|
|
}
|
|
|
|
.course-progress.open {
|
|
right: 0; /* 打开时显示 */
|
|
}
|
|
|
|
.progress-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.close-btn {
|
|
background: none;
|
|
border: none;
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
|
|
/* 章节和子章节样式 */
|
|
.chapter-list {
|
|
list-style-type: none;
|
|
padding-left: 0;
|
|
}
|
|
|
|
.chapter-item {
|
|
margin: 5px 0;
|
|
padding: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.chapter-item .chapter-title {
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.chapter-item .sub-chapter-list {
|
|
display: none; /* 初始状态下子章节隐藏 */
|
|
padding-left: 20px;
|
|
}
|
|
|
|
.chapter-item.open .sub-chapter-list {
|
|
display: block; /* 展开时显示子章节 */
|
|
}
|
|
|
|
.chapter-item:hover {
|
|
background-color: #f1f1f1;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
/* 子章节的样式 */
|
|
.sub-chapter-item {
|
|
margin: 3px 0;
|
|
padding: 3px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.sub-chapter-item:hover {
|
|
background-color: #e8e8e8;
|
|
} |