diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-22 15:48:24 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-22 15:48:24 +0200 |
| commit | 7329675be5912a4924b32cf41cd5ac87cb33e456 (patch) | |
| tree | a66385c3d2755967cf90d8c50226675b5dc33350 | |
| parent | 05f0129fbcf5421b3b0acab0429c8dbbb5737ba4 (diff) | |
| download | DevHive-Angular-7329675be5912a4924b32cf41cd5ac87cb33e456.tar DevHive-Angular-7329675be5912a4924b32cf41cd5ac87cb33e456.tar.gz DevHive-Angular-7329675be5912a4924b32cf41cd5ac87cb33e456.zip | |
Major redesign of almost all of profile settings page
| -rw-r--r-- | src/app/components/profile-settings/profile-settings.component.html | 175 | ||||
| -rw-r--r-- | src/styles.css | 33 |
2 files changed, 104 insertions, 104 deletions
diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index 9e0e80e..9887527 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -2,117 +2,106 @@ <app-loading *ngIf="!dataArrived"></app-loading> -<div id="content" class="scroll-standalone under-navbar" *ngIf="dataArrived"> - <nav id="navigation"> - <button class="submit-btn" (click)="goToProfile()">ᐊ Back</button> - <button class="submit-btn" (click)="navigateToAdminPanel()" *ngIf="isAdminUser">Panel</button> - <button class="submit-btn" (click)="logout()">Logout</button> - </nav> - <hr> - <div class="scroll-standalone"> - <form id="update-profile-picture" [formGroup]="updateProfilePictureFormGroup" (ngSubmit)="updateProfilePicture()"> - <img id="profile-picture" class="round-image" [src]="user.profilePictureURL"> - <div id="submit-file"> - <div id="upload-file" class="submit-btn"> - <input type="file" accept="image/*" formControlName="fileUpload" (change)="onFileUpload($event)"> - </div> - <button class="submit-btn" type="submit">Update profile picture</button> +<main class="scroll-standalone under-navbar centered-content flex-col"> + <form class="flex-row card font-size-dot9" [formGroup]="updateProfilePictureFormGroup" (ngSubmit)="updateProfilePicture()"> + <img id="profile-picture" class="round-image" [src]="user.profilePictureURL"> + <section class="flexible flex-col flex-center-align-items flex-justify-center side-padding-font"> + <input class="full-width faded-slim-border padding-smaller lighter-hover click-effect border-radius-smaller" type="file" accept="image/*" formControlName="fileUpload" (change)="onFileUpload($event)"> + <button class="full-width faded-slim-border padding-smaller lighter-hover click-effect border-radius-smaller margin-top-normal" type="submit" *ngIf="newProfilePicture.size > 0"> + Update profile picture + </button> + </section> + </form> + <form class="flex-col card padding-big" [formGroup]="updateUserFormGroup" (ngSubmit)="onSubmit()"> + <section class="flex-col"> + <div class="flex-row"> + <label class="flexible">First Name</label> + + <label *ngIf="updateUserFormGroup.get('firstName')?.errors?.required" class="error">*Required</label> + <label *ngIf="updateUserFormGroup.get('firstName')?.errors?.minlength" class="error">*Minimum 3 characters</label> </div> - </form> - <hr> - <form id="update-user" [formGroup]="updateUserFormGroup" (ngSubmit)="onSubmit()"> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="firstName" required> - <label class="input-field-label">First Name</label> + <input type="text" class="fancy-input faded-slim-border border-bottom-only" formControlName="firstName" required> + </section> + <section class="flex-col"> + <div class="flex-row"> + <label class="flexible">Last Name</label> - <div class="input-errors"> - <label *ngIf="updateUserFormGroup.get('firstName')?.errors?.required" class="error">*Required</label> - <label *ngIf="updateUserFormGroup.get('firstName')?.errors?.minlength" class="error">*Minimum 3 characters</label> - </div> + <label *ngIf="updateUserFormGroup.get('lastName')?.errors?.required" class="error">*Required</label> + <label *ngIf="updateUserFormGroup.get('lastName')?.errors?.minlength" class="error">*Minimum 3 characters</label> </div> + <input type="text" class="fancy-input faded-slim-border border-bottom-only" formControlName="lastName" required> + </section> + <section class="flex-col"> + <div class="flex-row"> + <label class="flexible">Username</label> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="lastName" required> - <label class="input-field-label">Last Name</label> + <label *ngIf="updateUserFormGroup.get('username')?.errors?.required" class="error">*Required</label> + <label *ngIf="updateUserFormGroup.get('username')?.errors?.minlength" class="error">*Minimum 3 characters</label> + </div> + <input type="text" class="fancy-input faded-slim-border border-bottom-only" formControlName="username" required> + </section> + <section class="flex-col"> + <div class="flex-row"> + <label class="flexible">Email</label> - <div class="input-errors"> - <label *ngIf="updateUserFormGroup.get('lastName')?.errors?.required" class="error">*Required</label> - <label *ngIf="updateUserFormGroup.get('lastName')?.errors?.minlength" class="error">*Minimum 3 characters</label> - </div> + <label *ngIf="updateUserFormGroup.get('email')?.errors?.required" class="error">*Required</label> + <label *ngIf="updateUserFormGroup.get('email')?.errors?.email" class="error">*Invalid email</label> </div> + <input type="text" class="fancy-input faded-slim-border border-bottom-only" formControlName="email" required> + </section> + <section class="flex-col"> + <div class="flex-row"> + <label class="flexible">Password</label> + <label *ngIf="updateUserFormGroup.get('password')?.errors?.required" class="error">*Required</label> + <label *ngIf="updateUserFormGroup.get('password')?.errors?.minlength" class="error">*Minimum 3 characters</label> + <label *ngIf="updateUserFormGroup.get('password')?.errors?.pattern" class="error">*At least 1 number</label> + </div> + <input type="password" class="fancy-input faded-slim-border border-bottom-only" formControlName="password" required> + </section> + <button type="button" class="submit-btn edit-btn" (click)="toggleLanguages()">▼ Edit Languages ▼</button> + <div *ngIf="showLanguages"> <div class="input-selection"> - <input type="text" class="input-field" formControlName="username" required> - <label class="input-field-label">Username</label> - + <input type="text" class="input-field" formControlName="languageInput" required> <div class="input-errors"> - <label *ngIf="updateUserFormGroup.get('username')?.errors?.required" class="error">*Required</label> - <label *ngIf="updateUserFormGroup.get('username')?.errors?.minlength" class="error">*Minimum 3 characters</label> + <label class="error">Type in your desired languages, separated by a space</label> </div> </div> - - <div class="input-selection"> - <input type="text" class="input-field" formControlName="email" required> - <label class="input-field-label">Email</label> - - <div class="input-errors"> - <label *ngIf="updateUserFormGroup.get('email')?.errors?.required" class="error">*Required</label> - <label *ngIf="updateUserFormGroup.get('email')?.errors?.email" class="error">*Invalid email</label> + Available languages: + <div id="all-languages"> + <div class="user-language" *ngFor="let lang of availableLanguages"> + {{ lang.name }} </div> </div> - + </div> + <button type="button" class="submit-btn edit-btn" (click)="toggleTechnologies()">▼ Edit Technologies ▼</button> + <div *ngIf="showTechnologies"> <div class="input-selection"> - <input type="password" class="input-field" formControlName="password" required> - <label class="input-field-label">Password</label> - + <input type="text" class="input-field" formControlName="technologyInput" required> <div class="input-errors"> - <label *ngIf="updateUserFormGroup.get('password')?.errors?.required" class="error">*Required</label> - <label *ngIf="updateUserFormGroup.get('password')?.errors?.minlength" class="error">*Minimum 3 characters</label> - <label *ngIf="updateUserFormGroup.get('password')?.errors?.pattern" class="error">*At least 1 number</label> - </div> - </div> - <button type="button" class="submit-btn edit-btn" (click)="toggleLanguages()">▼ Edit Languages ▼</button> - <div *ngIf="showLanguages"> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="languageInput" required> - - <div class="input-errors"> - <label class="error">Type in your desired languages, separated by a space</label> - </div> - </div> - Available languages: - <div id="all-languages"> - <div class="user-language" *ngFor="let lang of availableLanguages"> - {{ lang.name }} - </div> + <label class="error">Type in your desired technologies, separated by a space</label> </div> </div> - - <button type="button" class="submit-btn edit-btn" (click)="toggleTechnologies()">▼ Edit Technologies ▼</button> - <div *ngIf="showTechnologies"> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="technologyInput" required> - - <div class="input-errors"> - <label class="error">Type in your desired technologies, separated by a space</label> - </div> - </div> - Available technologies: - <div id="all-technologies"> - <div class="user-technology" *ngFor="let tech of availableTechnologies"> - {{ tech.name }} - </div> + Available technologies: + <div id="all-technologies"> + <div class="user-technology" *ngFor="let tech of availableTechnologies"> + {{ tech.name }} </div> </div> - - <button id="update-profile-btn" class="submit-btn" type="submit">Update profile</button> - <app-success-bar></app-success-bar> - <app-error-bar></app-error-bar> - </form> - <hr> - <div id="confirm-delete" *ngIf="deleteAccountConfirm"> + </div> + <button class="full-width faded-slim-border padding-smaller lighter-hover click-effect border-radius-smaller margin-top-normal" type="submit"> + Update profile + </button> + <app-success-bar></app-success-bar> + <app-error-bar></app-error-bar> + </form> + <section class="card full-width"> + <div class="margin-bot-bigger text-centered error-fg-color" *ngIf="deleteAccountConfirm"> Are you sure you want to delete your account?<br>This is permanent! </div> - <button class="submit-btn delete-btn" (click)="deleteAccount()">Delete account</button> - </div> -</div> + <button class="full-width faded-slim-border padding-smaller lighter-hover click-effect border-radius-smaller error-fg-color" (click)="deleteAccount()"> + Delete account + </button> + </section> + </main> + diff --git a/src/styles.css b/src/styles.css index 06ddae6..a20cef2 100644 --- a/src/styles.css +++ b/src/styles.css @@ -53,6 +53,7 @@ input[type=file]::file-selector-button { visibility: hidden; } + .rounded-border { border: 2px solid black; border-radius: 0.6em; @@ -206,12 +207,6 @@ input[type=file]::file-selector-button { height: 1em; } -/* General colors */ - -.fg-color-faded { - color: var(--faded-color); -} - /* General text */ .text-centered { @@ -246,6 +241,22 @@ input[type=file]::file-selector-button { border-right: none; } +/* General colors */ + +.fg-color-faded { + color: var(--faded-color); +} + +.focus-fg-color { + color: var(--focus-color); + border-color: var(--focus-color); +} + +.error-fg-color { + color: var(--failure); + border-color: var(--failure); +} + /* General padding */ .padding-big { @@ -272,6 +283,11 @@ input[type=file]::file-selector-button { padding: 0.1em; } +.side-padding-font { + padding-right: 1em; + padding-left: 1em; +} + .side-padding-smaller { padding-right: 0.3em; padding-left: 0.3em; @@ -364,11 +380,6 @@ input[type=file]::file-selector-button { height: calc(100% - var(--navbar-height)) !important; } -.focus-fg-color { - color: var(--focus-color); - border-color: var(--focus-color); -} - /* Inputs, the type found in login and register */ .textarea-new-msg { |
