diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-22 19:06:46 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-01-22 19:06:46 +0200 |
| commit | 8a2152c98dc1c82b6476d6b8108615b2770e008a (patch) | |
| tree | 705dfee96abc2e86f1a30fa1c5eb03fcf4195a42 /src | |
| parent | 6679f97479a48630f2e81d8eda245d1e0ef3e61d (diff) | |
| download | DevHive-8a2152c98dc1c82b6476d6b8108615b2770e008a.tar DevHive-8a2152c98dc1c82b6476d6b8108615b2770e008a.tar.gz DevHive-8a2152c98dc1c82b6476d6b8108615b2770e008a.zip | |
Made some minor front-end design improvements: better implemented scrolling of part of a page, fixed some alignments (mainly in the files)
Diffstat (limited to 'src')
8 files changed, 137 insertions, 113 deletions
diff --git a/src/DevHive.Angular/src/app/components/feed/feed.component.css b/src/DevHive.Angular/src/app/components/feed/feed.component.css index fe3f4a1..bbb1668 100644 --- a/src/DevHive.Angular/src/app/components/feed/feed.component.css +++ b/src/DevHive.Angular/src/app/components/feed/feed.component.css @@ -1,9 +1,11 @@ #feed-page { + height: 100%; max-width: 40em; - margin: 0 auto; - border: .5em solid var(--bg-color); - border-bottom: 0; box-sizing: border-box; + border: .5em solid var(--bg-color); + + margin: 0 auto; + display: flex; } @@ -28,22 +30,8 @@ #feed-content { flex: 1; -} - -#posts { - max-height: calc(100vh - 3.5em); - overflow-y: auto; -} - - /* Hide scrollbar for Chrome, Safari and Opera */ -#posts::-webkit-scrollbar { - display: none; -} - - /* Hide scrollbar for IE, Edge and Firefox */ -#posts { - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + display: flex; + flex-direction: column; } /* Profile bar */ @@ -94,7 +82,6 @@ margin-bottom: .5em; } - #top-bar-profile-pic { height: 2.5em; width: 2.5em; diff --git a/src/DevHive.Angular/src/app/components/feed/feed.component.html b/src/DevHive.Angular/src/app/components/feed/feed.component.html index 22213bc..4a93120 100644 --- a/src/DevHive.Angular/src/app/components/feed/feed.component.html +++ b/src/DevHive.Angular/src/app/components/feed/feed.component.html @@ -14,7 +14,7 @@ <button class="submit-btn" (click)="goToSettings()">Settings</button> <button class="submit-btn" (click)="logout()">Logout</button> </nav> - <div id="feed-content"> + <div id="feed-content"> <nav id="top-bar"> <img id="top-bar-profile-pic" class="round-image" [src]="user.imageUrl" alt="" (click)="goToProfile()"> <input id="top-bar-create-post" type="text" placeholder="What's on your mind?"/> @@ -22,10 +22,10 @@ <img src="assets/images/feed/chat-pic.png" alt=""/> </a> </nav> - <ul id="posts"> - <li *ngFor="let post of posts" class="post"> + <div id="posts" class="scroll-standalone"> + <div *ngFor="let post of posts" class="post"> <app-post></app-post> - </li> - </ul> + </div> + </div> </div> </div> diff --git a/src/DevHive.Angular/src/app/components/post/post.component.css b/src/DevHive.Angular/src/app/components/post/post.component.css index 4769191..9de5a27 100644 --- a/src/DevHive.Angular/src/app/components/post/post.component.css +++ b/src/DevHive.Angular/src/app/components/post/post.component.css @@ -8,7 +8,7 @@ padding: .5em; background-color: var(--card-bg); border-radius: .6em; -box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; + box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; } /* So the bottom shadow of the last element diff --git a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.css b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.css index becae6d..3f31373 100644 --- a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.css +++ b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.css @@ -7,6 +7,10 @@ justify-content: start; } +form { + width: 100%; +} + hr { width: calc(100% - 1em); color: black; @@ -31,8 +35,32 @@ hr { margin-left: 0; } +/* Form */ + +.input-field { + border-color: var(--focus-color) !important; + caret-color: var(--focus-color); + border-width: 2px !important; + margin-top: -1px !important; +} + +.input-field-label { + font-size: .7em; + color: var(--focus-color); + transform: translate(0, -1.2em); +} + /* Buttons */ +#successful-update-msg { + background-color: var(--success); + color: white; + width: 100%; + padding: .2em; + margin-top: .5em; + text-align: center; +} + #delete-account:hover { color: indianred; border-color: indianred !important; diff --git a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html index 4477ce2..9a3fe25 100644 --- a/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html +++ b/src/DevHive.Angular/src/app/components/profile-settings/profile-settings.component.html @@ -6,62 +6,64 @@ <button class="submit-btn" (click)="logout()">Logout</button> </nav> <hr> - <form [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> + <div class="scroll-standalone"> + <form [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> - <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 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> </div> - </div> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="lastName" required> - <label class="input-field-label">Last Name</label> + <div class="input-selection"> + <input type="text" class="input-field" formControlName="lastName" required> + <label class="input-field-label">Last Name</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 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> </div> - </div> - <div class="input-selection"> - <input type="text" class="input-field" formControlName="username" required> - <label class="input-field-label">Username</label> + <div class="input-selection"> + <input type="text" class="input-field" formControlName="username" required> + <label class="input-field-label">Username</label> - <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> + <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> + </div> </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-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> + <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> + </div> </div> - </div> - <div class="input-selection"> - <input type="password" class="input-field" formControlName="password" required> - <label class="input-field-label">Password</label> + <div class="input-selection"> + <input type="password" class="input-field" formControlName="password" required> + <label class="input-field-label">Password</label> - <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 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> - </div> - <button class="submit-btn" type="submit">Update profile</button> - <div id="successful-update-msg" *ngIf="successfulUpdate"> - Profile updated successfully! - </div> - </form> - <hr> - <button id="delete-account" class="submit-btn" (click)="deleteAccount()">Delete account</button> + <button class="submit-btn" type="submit">Update profile</button> + <div id="successful-update-msg" *ngIf="successfulUpdate"> + Profile updated successfully! + </div> + </form> + <hr> + <button id="delete-account" class="submit-btn" (click)="deleteAccount()">Delete account</button> + </div> </div> diff --git a/src/DevHive.Angular/src/app/components/profile/profile.component.css b/src/DevHive.Angular/src/app/components/profile/profile.component.css index 6954b22..7d96624 100644 --- a/src/DevHive.Angular/src/app/components/profile/profile.component.css +++ b/src/DevHive.Angular/src/app/components/profile/profile.component.css @@ -49,6 +49,7 @@ hr { display: flex; flex-direction: column; align-items: center; + text-align: center; } #other-main-info > * { diff --git a/src/DevHive.Angular/src/app/components/profile/profile.component.html b/src/DevHive.Angular/src/app/components/profile/profile.component.html index 442cb8b..d775b46 100644 --- a/src/DevHive.Angular/src/app/components/profile/profile.component.html +++ b/src/DevHive.Angular/src/app/components/profile/profile.component.html @@ -7,37 +7,39 @@ <button class="submit-btn" (click)="logout()" *ngIf="loggedInUser">Logout</button> </nav> <hr> - <div id="main-info" class="rounded-border"> - <img class="round-image" [src]="user.imageUrl" alt=""/> - <div id="other-main-info"> - <div id="name"> - {{ user.firstName }} {{ user.lastName }} + <div class="scroll-standalone"> + <div id="main-info" class="rounded-border"> + <img class="round-image" [src]="user.imageUrl" alt=""/> + <div id="other-main-info"> + <div id="name"> + {{ user.firstName }} {{ user.lastName }} + </div> + <div id="username"> + @{{ user.userName }} + </div> </div> - <div id="username"> - @{{ user.userName }} - </div> - </div> - </div> - <div class="secondary-info rounded-border"> - Languages: - <div class="user-language"> - C# </div> - <div class="user-language"> - TypeScript + <div class="secondary-info rounded-border"> + Languages: + <div class="user-language"> + C# + </div> + <div class="user-language"> + TypeScript + </div> </div> - </div> - <div class="secondary-info rounded-border"> - Technologies: - <div class="user-technology"> - .NET 5 + <div class="secondary-info rounded-border"> + Technologies: + <div class="user-technology"> + .NET 5 + </div> + <div class="user-technology"> + Angular + </div> </div> - <div class="user-technology"> - Angular + <div id="posts"> + <hr> + Posts go here </div> </div> - <div id="posts"> - <hr> - Posts go here - </div> </div> diff --git a/src/DevHive.Angular/src/styles.css b/src/DevHive.Angular/src/styles.css index 1881272..1320795 100644 --- a/src/DevHive.Angular/src/styles.css +++ b/src/DevHive.Angular/src/styles.css @@ -5,6 +5,8 @@ --bg-color: white; --focus-color: forestgreen; --card-bg: white; + --success: forestgreen; + --failure: indianred; } html, body { @@ -26,8 +28,7 @@ input:focus, button:focus { box-sizing: border-box; border: .5em solid var(--bg-color); - margin-left: auto; - margin-right: auto; + margin: 0 auto; display: flex; align-items: center; @@ -35,20 +36,6 @@ input:focus, button:focus { flex-direction: column; } -#error-bar { - text-align: center; - width: 100%; - position: absolute; - top: 0; - background-color: indianred; - color: white; - padding: .2em; -} - -#error-bar:empty { - display: none; -} - .rounded-border { border: 2px solid black; border-radius: .6em; @@ -69,6 +56,23 @@ input:focus, button:focus { color: red; } +.scroll-standalone { + width: 100%; + max-height: 100%; + overflow-y: auto; +} + + /* Hide scrollbar for Chrome, Safari and Opera */ +.scroll-standalone::-webkit-scrollbar { + display: none; +} + + /* Hide scrollbar for IE, Edge and Firefox */ +.scroll-standalone { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ +} + /* Inputs, the type found in login and register */ .input-selection { |
