Commit cb162b4e by Muhammad Usman

profile tasks bar ui fixes

parent e30ca484
<div class="right-sidebar"> <div class="right-sidebar">
<div class="user-profile"> <div class="user-profile">
<i class="fa fa-bell" *ngIf="!isMobileView"></i> <i class="fa fa-bell" *ngIf="!isMobileView"></i>
<div class="user-profile-avatar-wrapper" [ngStyle]="{backgroundImage: avatarBorder}"> <div class="user-profile-avatar-wrapper" [ngStyle]="{backgroundImage: avatarBorder, backgroundColor: backgroundColor}">
<div class="user-profile-avatar"> <div class="user-profile-avatar">
<img src="assets/my-career-web/svgs/avatar.svg" alt=""> <img src="assets/my-career-web/svgs/avatar.svg" alt="">
</div> </div>
</div> </div>
<div class="user-profile-label">Profile {{careerProfile.CompletedPercentage || 0}}% complete</div> <div class="user-profile-label">Profile {{careerProfile.CompletedPercentage || 0}}% complete <i class="fa fa-trophy" *ngIf="careerProfile.CompletedPercentage"></i></div>
<hr style="border-bottom: 1px solid #E0E0E0; margin: 24px 0;"> <hr style="border-bottom: 1px solid #E0E0E0; margin: 24px 0;">
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
&-label { &-label {
margin-top: 18px; margin-top: 18px;
text-align: center; text-align: center;
.fa-trophy {
margin-left: 10px;
color: #F3B924;
}
} }
&-name, &-role, &-label { &-name, &-role, &-label {
......
...@@ -14,6 +14,7 @@ export class ProfileTasksComponent extends BaseComponent { ...@@ -14,6 +14,7 @@ export class ProfileTasksComponent extends BaseComponent {
careerProfile = new CareerProfileModel(); careerProfile = new CareerProfileModel();
avatarBorder = 'linear-gradient(90deg, transparent 50%, #EAECEE 50%), linear-gradient(90deg, #EAECEE 50%, transparent 50%)'; avatarBorder = 'linear-gradient(90deg, transparent 50%, #EAECEE 50%), linear-gradient(90deg, #EAECEE 50%, transparent 50%)';
backgroundColor = '#1469A2';
constructor( constructor(
private ps: PersonalDetailsService, private ps: PersonalDetailsService,
...@@ -28,13 +29,21 @@ export class ProfileTasksComponent extends BaseComponent { ...@@ -28,13 +29,21 @@ export class ProfileTasksComponent extends BaseComponent {
.subscribe(profile => { .subscribe(profile => {
this.careerProfile = this.us.cloneObject(profile); this.careerProfile = this.us.cloneObject(profile);
this.setProfileCompletion(); this.setProfileCompletion();
}) });
} }
setProfileCompletion(): void { setProfileCompletion(): void {
const percentage = (this.careerProfile.CompletedPercentage || 0) * 3.6; const percentage = (this.careerProfile.CompletedPercentage || 0) * 3.6;
const degree = percentage <= 180 ? 90 + percentage : percentage - 90; for (let i = 0; i <= percentage; i++) {
this.avatarBorder = `linear-gradient(${degree}deg, transparent 50%, #EAECEE 50%), linear-gradient(90deg, #EAECEE 50%, transparent 50%)`; if (percentage === 360) {
this.backgroundColor = '#1DBA3C';
this.avatarBorder = `linear-gradient(${90 + percentage}deg, transparent 50%, #1DBA3C 50%),linear-gradient(90deg, #1DBA3C 50%, transparent 50%)`;
} else if (percentage<=180){
this.avatarBorder = `linear-gradient(${90 + percentage}deg, transparent 50%, #EAECEE 50%),linear-gradient(90deg, #EAECEE 50%, transparent 50%)`;
} else {
this.avatarBorder = `linear-gradient(${percentage - 90}deg, transparent 50%, #1469A2 50%),linear-gradient(90deg, #EAECEE 50%, transparent 50%)`;
}
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment