소스 검색

Write HTML & CSS for home and app

Eldar Mukhtarov 9 달 전
부모
커밋
ce88875da0

+ 152 - 0
project/frontend-angular/src/app/app.css

@@ -0,0 +1,152 @@
+* {
+  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;
+}
+
+nav {
+  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
+  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
+  border-bottom: 2px solid #333;
+  position: sticky;
+  top: 0;
+  z-index: 1000;
+}
+
+.nav-container {
+  max-width: 1200px;
+  margin: 0 auto;
+  padding: 0 20px;
+}
+
+.nav-brand {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 15px 0;
+}
+
+.brand-logo {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+}
+
+.logo-icon {
+  width: 40px;
+  height: 40px;
+  background: linear-gradient(135deg, #8C231E, #b8332e);
+  border-radius: 8px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-weight: bold;
+  font-size: 18px;
+  color: white;
+  box-shadow: 0 2px 10px rgba(140, 35, 30, 0.3);
+}
+
+.brand-text {
+  font-size: 24px;
+  font-weight: 700;
+  color: #ffffff;
+  letter-spacing: -0.5px;
+}
+
+.brand-subtitle {
+  font-size: 12px;
+  color: #888;
+  font-weight: 400;
+  margin-top: -4px;
+}
+
+.nav-menu {
+  list-style: none;
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  flex-wrap: wrap;
+}
+
+.nav-item {
+  position: relative;
+}
+
+.nav-link {
+  color: #e0e0e0;
+  text-decoration: none;
+  padding: 10px 16px;
+  border-radius: 8px;
+  font-weight: 500;
+  font-size: 14px;
+  transition: all 0.3s ease;
+  display: block;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.nav-link:hover {
+  background-color: rgba(255, 255, 255, 0.1);
+  color: #ffffff;
+  transform: translateY(-1px);
+}
+
+.nav-link.primary {
+  background: linear-gradient(135deg, #8C231E, #a52a24);
+  color: white;
+  font-weight: 600;
+}
+
+.nav-link.primary:hover {
+  background: linear-gradient(135deg, #a52a24, #8C231E);
+  transform: translateY(-2px);
+  box-shadow: 0 4px 15px rgba(140, 35, 30, 0.4);
+}
+
+.user-info {
+  background: rgba(255, 255, 255, 0.05);
+  border: 1px solid rgba(255, 255, 255, 0.1);
+  padding: 8px 12px;
+  border-radius: 20px;
+  font-size: 13px;
+  color: #b0b0b0;
+  margin-left: 10px;
+}
+
+.user-name {
+  color: #ffffff;
+  font-weight: 600;
+}
+
+.main-content {
+  max-width: 1200px;
+  margin: 0 auto;
+  padding: 40px 20px;
+  min-height: calc(100vh - 200px);
+}
+
+@media (max-width: 768px) {
+  .nav-brand {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 15px;
+  }
+
+  .nav-menu {
+    width: 100%;
+    justify-content: flex-start;
+  }
+
+  .main-content {
+    padding: 20px 15px;
+  }
+}

+ 58 - 40
project/frontend-angular/src/app/app.html

@@ -1,46 +1,64 @@
 <nav>
-  <div>
-    <ul>
-      <li>
-        <a routerLink="/">Home</a>
-      </li>
-      @if (authority === 'student') {
-        <li>
-          <a>Grades</a>
+  <div class="nav-container">
+    <div class="nav-brand">
+      <div class="brand-logo">
+        <div class="logo-icon">W</div>
+        <div>
+          <div class="brand-text">Better WIKAMP</div>
+          <div class="brand-subtitle">Academic Management Platform</div>
+        </div>
+      </div>
+      
+      <ul class="nav-menu">
+        <li class="nav-item">
+          <a routerLink="/" class="nav-link">Home</a>
         </li>
-      }
-      @if (authority === 'teacher') {
-        <li>
-          <a routerLink="subjects">Subjects</a>
-        </li>
-      }
-      @if (authority === 'admin') {
-        <li>
-          <a routerLink="admin">Manage Accounts</a>
-        </li>
-        <li>
-          <a routerLink="auth/signup">Add Accounts</a>
-        </li>
-      }
-      @if (!authority) {
-        <li>
-          <a routerLink="auth/signin">Login</a>
-        </li>
-      }
-      @if (authority) {
-        <li>
-          <a (click)="logout()">Logout</a>
-        </li>
-      }
-      @if (authority && loggedUser) {
-        <li>
-          Logged in as: {{ loggedUser }}
-        </li>
-      }
-    </ul>
+        
+        @if (authority === 'student') {
+          <li class="nav-item">
+            <a class="nav-link">Grades</a>
+          </li>
+        }
+        
+        @if (authority === 'teacher') {
+          <li class="nav-item">
+            <a routerLink="subjects" class="nav-link">Subjects</a>
+          </li>
+        }
+        
+        @if (authority === 'admin') {
+          <li class="nav-item">
+            <a routerLink="admin" class="nav-link">Manage Accounts</a>
+          </li>
+          <li class="nav-item">
+            <a routerLink="auth/signup" class="nav-link">Add Accounts</a>
+          </li>
+        }
+        
+        @if (!authority) {
+          <li class="nav-item">
+            <a routerLink="auth/signin" class="nav-link primary">Login</a>
+          </li>
+        }
+        
+        @if (authority) {
+          <li class="nav-item">
+            <a (click)="logout()" class="nav-link">Logout</a>
+          </li>
+        }
+        
+        @if (authority && loggedUser) {
+          <li class="nav-item">
+            <span class="user-info">
+              Logged in as: <span class="user-name">{{ loggedUser }}</span>
+            </span>
+          </li>
+        }
+      </ul>
+    </div>
   </div>
 </nav>
 
-<div>
+<div class="main-content">
   <router-outlet></router-outlet>
-</div>
+</div>

+ 125 - 0
project/frontend-angular/src/app/home/home.css

@@ -0,0 +1,125 @@
+.welcome-section {
+  text-align: center;
+  padding: 60px 20px;
+  background: linear-gradient(135deg, rgba(140, 35, 30, 0.1), rgba(255, 255, 255, 0.02));
+  border-radius: 16px;
+  border: 1px solid rgba(255, 255, 255, 0.1);
+  margin-bottom: 40px;
+}
+
+.welcome-title {
+  font-size: 48px;
+  font-weight: 700;
+  color: #ffffff;
+  margin-bottom: 32px;
+  letter-spacing: -1px;
+}
+
+.login-prompt {
+  margin-top: 20px;
+}
+
+.access-message {
+  font-size: 18px;
+  color: #b0b0b0;
+  font-weight: 400;
+}
+
+.user-dashboard {
+  max-width: 600px;
+  margin: 0 auto;
+  text-align: left;
+}
+
+.dashboard-title {
+  font-size: 24px;
+  font-weight: 600;
+  color: #ffffff;
+  margin-bottom: 24px;
+  text-align: center;
+}
+
+.info-grid {
+  display: grid;
+  gap: 16px;
+}
+
+.info-item {
+  background: rgba(255, 255, 255, 0.05);
+  border: 1px solid rgba(255, 255, 255, 0.1);
+  border-radius: 8px;
+  padding: 16px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  transition: all 0.3s ease;
+}
+
+.info-item:hover {
+  background: rgba(255, 255, 255, 0.08);
+  border-color: rgba(140, 35, 30, 0.3);
+}
+
+.info-label {
+  font-weight: 600;
+  color: #ffffff;
+  font-size: 14px;
+  min-width: 80px;
+}
+
+.info-value {
+  color: #b0b0b0;
+  font-size: 16px;
+  font-family: 'Courier New', monospace;
+  word-break: break-word;
+  text-align: right;
+  flex: 1;
+  margin-left: 16px;
+}
+
+.token-display {
+  font-size: 15px;
+  word-break: break-all;
+  overflow-wrap: anywhere;
+}
+
+.fade-in {
+  animation: fadeIn 0.6s ease-in;
+}
+
+@keyframes fadeIn {
+  from {
+    opacity: 0;
+    transform: translateY(20px);
+  }
+  to {
+    opacity: 1;
+    transform: translateY(0);
+  }
+}
+
+@media (max-width: 768px) {
+  .welcome-title {
+    font-size: 36px;
+  }
+
+  .welcome-section {
+    padding: 40px 15px;
+  }
+
+  .info-item {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 8px;
+  }
+
+  .info-value {
+    text-align: left;
+    margin-left: 0;
+    max-width: 100%;
+  }
+
+  .token-display {
+    font-size: 13px;
+  }
+}

+ 31 - 1
project/frontend-angular/src/app/home/home.html

@@ -1 +1,31 @@
-<p>home works!</p>
+<div class="welcome-section fade-in">
+  <h1 class="welcome-title">Welcome to Better WIKAMP</h1>
+
+@if (info.token != '{}') {
+    <div class="user-dashboard">
+        <h2 class="dashboard-title">User Information</h2>
+        <div class="info-grid">
+            <div class="info-item">
+                <span class="info-label">Username:</span>
+                <span class="info-value">{{ info.username }}</span>
+            </div>
+            <div class="info-item">
+                <span class="info-label">Authorities:</span>
+                <span class="info-value">{{ info.authorities }}</span>
+            </div>
+            <div class="info-item">
+                <span class="info-label">Token:</span>
+                <span class="info-value token-display">{{ info.token }}</span>
+            </div>
+        </div>
+    </div>
+} @else {
+    <ng-template [ngTemplateOutlet]="loggedOut"></ng-template>
+}
+
+  <ng-template #loggedOut>
+    <div class="login-prompt">
+      <p class="access-message">Access is restricted. Log in to continue.</p>
+    </div>
+  </ng-template>
+</div>

+ 2 - 1
project/frontend-angular/src/app/home/home.ts

@@ -1,9 +1,10 @@
 import {Component, OnInit} from '@angular/core';
 import {TokenStorageService} from '../auth/token-storage.service';
+import {NgTemplateOutlet} from '@angular/common';
 
 @Component({
   selector: 'app-home',
-  imports: [],
+  imports: [ NgTemplateOutlet ],
   templateUrl: './home.html',
   styleUrl: './home.css'
 })

+ 1 - 1
project/frontend-angular/src/index.html

@@ -2,7 +2,7 @@
 <html lang="en">
 <head>
   <meta charset="utf-8">
-  <title>FrontendAngular</title>
+  <title>Better WIKAMP</title>
   <base href="/">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">

+ 7 - 0
project/frontend-angular/src/styles.css

@@ -1 +1,8 @@
 /* You can add global styles to this file, and also import other style files */
+body {
+    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+    background-color: #121212;
+    color: #ffffff;
+    line-height: 1.6;
+    min-height: 100vh;
+}