fix index

This commit is contained in:
Cai
2025-10-27 11:20:07 +08:00
parent 33bf569fb0
commit c73ea44747
5 changed files with 162 additions and 63 deletions

View File

@@ -11,40 +11,6 @@ body {
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 主体部分 */

View File

@@ -1,25 +1,23 @@
/* 页眉导航栏 基础样式 */
/* 页眉导航栏 */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
padding: 10px 20px;
border-bottom: 1px solid #eee;
margin: 0;
background-color: #2575fc;
color: rgb(235, 235, 235);
border-radius: 10px;
margin-bottom: 30px;
}
/* 导航栏 Logo 样式 */
.navbar .logo h1 {
font-size: 20px;
color: rgb(245, 245, 245);
font-size: 24px;
font-weight: bold;
color: #1f2937;
margin: 0;
}
/* 导航链接样式 */
.navbar-links a {
color: #4b5563;
color: rgb(235, 235, 235);
text-decoration: none;
margin: 0 15px;
font-size: 18px;
@@ -27,21 +25,18 @@
}
.navbar-links a:hover {
color: #2575fc;
}
/* 头像容器样式 */
.navbar .avatar {
margin-left: 0;
color: #f1c40f;
}
.navbar .avatar img {
width: 32px;
height: 32px;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
border: 2px solid white;
}
/* 下拉浮框 基础定位 */
.dropdown {
position: relative;

View File

@@ -3,20 +3,41 @@
<head>
<meta charset="UTF-8">
<title>课程选择主页</title>
<link rel="stylesheet" href="/static/css/navbar.css">
<link rel="stylesheet" href="/static/css/footer.css">
<link rel="stylesheet" href="/static/css/index.css">
</head>
<body>
<header class="navbar">
<!-- 原有导航内容保留 -->
{% include 'navbar.html' %}
</header>
<main>
<!-- 原有主体内容保留 -->
{% block content %}{% endblock %}
</main>
<main>
<div class="course-selection">
<h2>课程列表</h2>
<div class="course-list">
{% for course in courses_data %}
<div class="course-card" onclick="show_course_details('{{ course._id }}')">
<img src="{{ course.image_url }}" alt="{{ course.course_name }}">
<h3>{{ course.name }}</h3>
<p>{{ course.description }}</p>
{% if course._id in selected_courses %}
<button class="selected-button">已选择</button>
{% else %}
<button class="select-button" data-course-id="{{course._id}}">选择课程</button>
{% endif %}
</div>
{% endfor %}
</div>
</div>
</main>
{% include 'foot.html' %}
</body>
<script>
window.appData = {
user_selected_courses: JSON.parse(`{{selected_courses}}`.replace(/&#34;/g, "\""))
}
</script>
<script src="/static/js/index.js"></script>
</html>

View File

@@ -1,7 +1,12 @@
<link rel="stylesheet" href="/static/css/navbar.css">
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome 图标 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="/static/css/dashboard.css">
<header class="navbar">
<div class="logo">
<h1>华实:教学练评一体的虚拟助教</h1>
<h1>华实学伴:教学练评一体的虚拟助教</h1>
</div>
{% if role == 'teacher' %}
<!-- 如果是教师角色 -->