Browse Source

Modify HTML & CSS for Grade viewing by Student's Side

Eldar Mukhtarov 9 tháng trước cách đây
mục cha
commit
2c40de01d8

+ 218 - 0
project/frontend-angular/src/app/grade-student/grade-student.css

@@ -0,0 +1,218 @@
+/* Better WIKAMP - Subjects List Interface CSS */
+
+/* CSS Reset & Base Styles */
+* {
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+}
+
+body {
+    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+    background-color: #121212;
+    color: #ffffff;
+    line-height: 1.6;
+    min-height: 100vh;
+}
+
+/* Animation Keyframes */
+@keyframes fadeIn {
+    from {
+        opacity: 0;
+        transform: translateY(10px);
+    }
+    to {
+        opacity: 1;
+        transform: translateY(0);
+    }
+}
+
+/* Main Container */
+.subjects-container {
+    max-width: 1200px;
+    margin: 0 auto;
+    padding: 40px 20px;
+    animation: fadeIn 0.6s ease-in;
+}
+
+/* Search Section */
+.search-section {
+    background: rgba(255, 255, 255, 0.02);
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    border-radius: 12px;
+    padding: 20px;
+    margin-bottom: 24px;
+    transition: all 0.3s ease;
+}
+
+.search-section:hover {
+    background: rgba(255, 255, 255, 0.05);
+    border-color: rgba(255, 255, 255, 0.15);
+}
+
+.search-label {
+    display: block;
+    font-size: 14px;
+    font-weight: 500;
+    color: #e0e0e0;
+    margin-bottom: 8px;
+}
+
+.search-input {
+    width: 100%;
+    padding: 12px 16px;
+    background: rgba(255, 255, 255, 0.05);
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    border-radius: 8px;
+    color: #ffffff;
+    font-size: 14px;
+    font-family: inherit;
+    transition: all 0.3s ease;
+}
+
+.search-input:focus {
+    outline: none;
+    border-color: rgba(255, 255, 255, 0.2);
+    background: rgba(255, 255, 255, 0.08);
+}
+
+.search-input::placeholder {
+    color: #888;
+}
+
+/* Table Section */
+.table-section {
+    background: rgba(255, 255, 255, 0.02);
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    border-radius: 16px;
+    overflow: hidden;
+}
+
+.subjects-table {
+    width: 100%;
+    border-collapse: collapse;
+}
+
+.table-header {
+    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
+}
+
+.table-header th {
+    padding: 16px 20px;
+    text-align: left;
+    font-size: 14px;
+    font-weight: 600;
+    color: #ffffff;
+    border-bottom: 2px solid #333;
+}
+
+.sort-button {
+    background: none;
+    border: none;
+    color: #e0e0e0;
+    cursor: pointer;
+    margin-left: 8px;
+    font-size: 16px;
+    transition: all 0.3s ease;
+}
+
+.sort-button:hover {
+    color: #ffffff;
+    transform: scale(1.1);
+}
+
+.table-row {
+    transition: all 0.3s ease;
+}
+
+.table-row:hover {
+    background: rgba(255, 255, 255, 0.05);
+}
+
+.table-row.even-row {
+    background: rgba(255, 255, 255, 0.02);
+}
+
+.table-row.even-row:hover {
+    background: rgba(255, 255, 255, 0.08);
+}
+
+.table-cell {
+    padding: 16px 20px;
+    font-size: 14px;
+    color: #e0e0e0;
+    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
+}
+
+.subject-name {
+    font-weight: 500;
+    color: #ffffff;
+}
+
+/* Grades Container */
+.grades-container {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 8px;
+    align-items: center;
+}
+
+.grade-badge {
+    display: inline-block;
+    background: rgba(255, 255, 255, 0.05);
+    border: 1px solid rgba(255, 255, 255, 0.1);
+    border-radius: 8px;
+    padding: 6px 12px;
+    font-family: 'Courier New', monospace;
+    font-size: 12px;
+    font-weight: 600;
+    color: #ffffff;
+    transition: all 0.3s ease;
+}
+
+.grade-badge:hover {
+    background: rgba(255, 255, 255, 0.1);
+    transform: translateY(-1px);
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
+}
+
+/* Empty State */
+.empty-state {
+    text-align: center;
+    padding: 40px 20px;
+    color: #888;
+    font-size: 16px;
+    font-style: italic;
+}
+
+/* Responsive Design */
+@media (max-width: 768px) {
+    .subjects-container {
+        padding: 20px 15px;
+    }
+
+    .search-section {
+        padding: 16px;
+        margin-bottom: 20px;
+    }
+
+    .table-header th,
+    .table-cell {
+        padding: 12px 16px;
+    }
+
+    .subjects-table {
+        font-size: 12px;
+    }
+
+    .grade-badge {
+        font-size: 11px;
+        padding: 4px 8px;
+    }
+
+    .grades-container {
+        flex-direction: column;
+        align-items: flex-start;
+        gap: 4px;
+    }
+}

+ 40 - 31
project/frontend-angular/src/app/grade-student/grade-student.html

@@ -1,37 +1,46 @@
-<div>
-  <div>
-    <label for="search">Search by Name:</label>
-    <input type="text" id="search" [(ngModel)]="searchTerm" (input)="filterSubjects()" placeholder="Enter subject name">
+<div class="subjects-container">
+  <div class="search-section">
+    <label class="search-label" for="search">Search by Subject:</label>
+    <input 
+      type="text" 
+      id="search" 
+      class="search-input"
+      [(ngModel)]="searchTerm" 
+      (input)="filterSubjects()" 
+      placeholder="Enter subject name"
+    >
   </div>
-  <div>
-    <table>
-      <thead>
-      <tr>
-        <th>
-          Subject 
-          @if (sortDirection==='desc') {
-            <span (click)="sortByName()">↓</span>
-          }
-          @if (sortDirection==='asc') {
-            <span (click)="sortByName()">↑</span>
-          }
-        </th>
-        <th>Grades</th>
-      </tr>
+  <div class="table-section">
+    <table class="subjects-table">
+      <thead class="table-header">
+        <tr>
+          <th>
+            Subject 
+            @if (sortDirection==='desc') {
+              <button class="sort-button" (click)="sortByName()">↓</button>
+            }
+            @if (sortDirection==='asc') {
+              <button class="sort-button" (click)="sortByName()">↑</button>
+            }
+          </th>
+          <th>Grades</th>
+        </tr>
       </thead>
       <tbody>
-      <ng-container *ngFor="let subject of filteredSubjectList; index as i">
-        <tr [class.even-row]="i % 2 === 1">
-          <td>{{ subject.name }}</td>
-          <td>
-            <ul *ngFor="let grade of gradeList">
-              @if (grade.subject.id === subject.id) {
-                <li>{{ grade.grade }}</li>
-              }
-            </ul>
-          </td>
-        </tr>
-      </ng-container>
+        <ng-container *ngFor="let subject of filteredSubjectList; index as i">
+          <tr class="table-row" [class.even-row]="i % 2 === 1">
+            <td class="table-cell subject-name">{{ subject.name }}</td>
+            <td class="table-cell grades-cell">
+              <div class="grades-container">
+                <ng-container *ngFor="let grade of gradeList">
+                  @if (grade.subject.id === subject.id) {
+                    <span class="grade-badge">{{ grade.grade }}</span>
+                  }
+                </ng-container>
+              </div>
+            </td>
+          </tr>
+        </ng-container>
       </tbody>
     </table>
   </div>