Skip to content
Snippets Groups Projects
Commit 1b1a8f0d authored by alec.schmidt's avatar alec.schmidt
Browse files

styling start

parent 4fb9d6a2
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 75 deletions
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './login/login.component'; import { LoginComponent } from './login-shit/login/login.component';
import { AdminComponent } from './admin/admin.component'; import { AdminComponent } from './admin/admin.component';
import { SignupComponent } from './signup/signup.component'; import { SignupComponent } from './login-shit/signup/signup.component';
const routes: Routes = [ const routes: Routes = [
{ {
......
nav {
position: sticky;
top: 0;
width: 100%;
background-color: #3f51b5;
color: #fff;
display: flex;
padding: 0 16px;
align-items: center;
height: 56px;
font: 500 20px/32px Roboto, "Helvetica Neue", sans-serif;
}
\ No newline at end of file
<nav> <div class="flex h-screen flex-col">
NAVBAR <nav class="bg-violet-900 px-6 py-4 flex flex-row justify-between text-white items-center">
<button (click)="router.navigateByUrl('/');">Home</button> <div class="flex flex-row">
<button *ngIf="auth.isAdmin()" (click)="router.navigateByUrl('/admin')">Dashboard</button> <h2 class="mr-6 border-2 border-transparent font-bold">Navbar</h2>
<button *ngIf="!auth.isLoggedIn()" (click)="router.navigateByUrl('/login')">Login</button> <div>
<button *ngIf="auth.isLoggedIn()" (click)="auth.logout()">Logout</button> <button class="mr-4 border-2 border-transparent hover:border-solid hover:border-white hover:border-2 hover:rounded-lg px-2" (click)="router.navigateByUrl('/');">Home</button>
<button *ngIf="!auth.isLoggedIn()" (click)="router.navigateByUrl('/signup')">Sign Up</button> <button class="border-2 border-transparent hover:border-solid hover:border-white hover:border-2 hover:rounded-lg px-2" *ngIf="auth.isAdmin()" (click)="router.navigateByUrl('/admin')">Dashboard</button>
<label >{{auth.getUsername()}}</label> </div>
</div>
<div class="flex flex-row">
<button class="mr-4 border-2 border-transparent hover:border-solid hover:border-white hover:border-2 hover:rounded-lg px-2" *ngIf="!auth.isLoggedIn()" (click)="router.navigateByUrl('/login')">Login</button>
<button class="mr-4 border-2 border-transparent hover:border-solid hover:border-white hover:border-2 hover:rounded-lg px-2" *ngIf="auth.isLoggedIn()" (click)="auth.logout()">Logout</button>
<button class="mr-4 border-2 border-transparent hover:border-solid hover:border-white hover:border-2 hover:rounded-lg px-2" *ngIf="!auth.isLoggedIn()" (click)="router.navigateByUrl('/signup')">Sign Up</button>
<div class="border-2 border-transparent bg-violet-950 h-8 w-8 rounded-full flex justify-center items-center">{{auth.getUsername().split('')[0].toUpperCase()}}</div>
</div>
</nav> </nav>
<main class="w-full h-full">
<router-outlet> <router-outlet>
</router-outlet> </router-outlet>
</main>
</div>
\ No newline at end of file
...@@ -5,12 +5,12 @@ import { AppRoutingModule } from './app-routing.module'; ...@@ -5,12 +5,12 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http'; import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import { AdminComponent } from './admin/admin.component'; import { AdminComponent } from './admin/admin.component';
import { LoginComponent } from './login/login.component'; import { LoginComponent } from './login-shit/login/login.component';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { TokenInterceptor } from './interceptors/token-interceptor'; import { TokenInterceptor } from './interceptors/token-interceptor';
import { SignupComponent } from './signup/signup.component'; import { SignupComponent } from './login-shit/signup/signup.component';
import { CreateUserComponent } from './create-user/create-user.component'; import { CreateUserComponent } from './user-shit/create-user/create-user.component';
import { UpdateUserComponent } from './update-user/update-user.component'; import { UpdateUserComponent } from './user-shit/update-user/update-user.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
......
<div class="h-full w-full flex justify-center">
<div class="bg-white border-2 border-neutral-800 rounded-lg p-5 flex flex-col items-center mt-80 h-fit">
<h1>Login</h1>
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
<input class="border-b-4 mt-2" type="text" placeholder="Username" formControlName="username">
<br>
<input class="border-b-4 mt-2" type="password" placeholder="Password" formControlName="password">
<br>
<button class="border-2 border-black rounded-lg px-2 hover:bg-gray-300 mt-2" type="submit">Log In</button>
</form>
</div>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { AuthenticationService } from '../services/authentication.service'; import { AuthenticationService } from '../../services/authentication.service';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
......
<div class="h-full w-full flex justify-center">
<div class="bg-white border-2 border-neutral-800 rounded-lg p-5 flex flex-col items-center mt-80 h-fit">
<h1>Sign Up</h1>
<form [formGroup]="signupForm" (ngSubmit)="onSubmit()">
<input class="border-b-4 mt-2" type="text" placeholder="Username" formControlName="username">
<br>
<input class="border-b-4 mt-2" type="password" placeholder="Password" formControlName="password">
<br>
<button class="border-2 border-black rounded-lg px-2 hover:bg-gray-300 mt-2" type="submit">Sign Up</button>
</form>
</div>
</div>
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { UsersService } from '../services/users.service'; import { UsersService } from '../../services/users.service';
import { AuthenticationService } from '../services/authentication.service'; import { AuthenticationService } from '../../services/authentication.service';
import { User } from '../Types/types'; import { User } from '../../Types/types';
@Component({ @Component({
selector: 'app-signup', selector: 'app-signup',
......
.form-signin {
width: 100%;
max-width: 330px;
padding: 15px;
margin: auto;
}
.form-signin .checkbox {
font-weight: 400;
}
.form-signin .form-floating:focus-within {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
\ No newline at end of file
<h1>Login</h1>
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
<input type="text" placeholder="Username" formControlName="username">
<br>
<input type="password" placeholder="Password" formControlName="password">
<br>
<button type="submit">Log In</button>
</form>
\ No newline at end of file
<h1>Sign Up</h1>
<form [formGroup]="signupForm" (ngSubmit)="onSubmit()">
<input type="text" placeholder="Username" formControlName="username">
<br>
<input type="password" placeholder="Password" formControlName="password">
<br>
<button type="submit">Sign Up</button>
</form>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment