-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor existing cards to 2 new card components
- Loading branch information
Showing
11 changed files
with
138 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<p-card [styleClass]="type==='light' ? 'heading-card-light' : 'heading-card-dark'"> | ||
<ng-template pTemplate="content"> | ||
<h1 style="margin: 0">{{ heading }}</h1> | ||
</ng-template> | ||
</p-card> |
21 changes: 21 additions & 0 deletions
21
src/app/components/heading-card/heading-card.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
:host ::ng-deep { | ||
.p-card-content { | ||
padding: 0; | ||
} | ||
|
||
.heading-card { | ||
width: 80%; | ||
display: inline-block; | ||
margin-bottom: 5vh; | ||
} | ||
|
||
.heading-card-light { | ||
@extend .heading-card; | ||
} | ||
|
||
.heading-card-dark { | ||
@extend .heading-card; | ||
background: rgb(75,75,75); | ||
color: white; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {CardModule} from "primeng/card"; | ||
|
||
@Component({ | ||
selector: 'heading-card', | ||
standalone: true, | ||
imports: [ | ||
CardModule | ||
], | ||
templateUrl: './heading-card.component.html', | ||
styleUrl: './heading-card.component.scss' | ||
}) | ||
export class HeadingCardComponent { | ||
|
||
@Input() heading: string; | ||
|
||
@Input() type?: "light" | "dark" = "dark"; | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/app/components/timeline-card/timeline-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<p-card [header]="heading" [subheader]="subheading" | ||
[styleClass]="type==='light'? 'timeline-card-light' : 'timeline-card-dark'"> | ||
<div [innerHTML]="content" style="margin-top: 1rem"></div> | ||
<div *ngIf="bulletPoints" style="margin-top: 1rem"> | ||
<p-badge *ngFor="let bulletPoint of bulletPoints" [value]="bulletPoint" | ||
[style]="{'margin': '0 0.3vh', 'background': 'rgba(75,85,93,0.7)'}"></p-badge> | ||
</div> | ||
</p-card> |
30 changes: 30 additions & 0 deletions
30
src/app/components/timeline-card/timeline-card.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
:host ::ng-deep { | ||
.p-card-content { | ||
padding: 0; | ||
} | ||
|
||
.timeline-card { | ||
margin-bottom: 3vh; | ||
} | ||
|
||
.timeline-card-light { | ||
@extend .timeline-card; | ||
border: var(--border-dark); | ||
background: var(--background-light); | ||
} | ||
|
||
.timeline-card-dark { | ||
@extend .timeline-card; | ||
border: var(--border-light); | ||
background: var(--background-dark); | ||
color: #dcdcdc; | ||
|
||
& > div.p-card-body > div.p-card-title { | ||
color: white; | ||
} | ||
|
||
& > div.p-card-body > div.p-card-subtitle { | ||
color: #ffffff; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/components/timeline-card/timeline-card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {CardModule} from "primeng/card"; | ||
import {BadgeModule} from "primeng/badge"; | ||
import {NgClass, NgForOf, NgIf} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'timeline-card', | ||
standalone: true, | ||
imports: [ | ||
CardModule, | ||
BadgeModule, | ||
NgIf, | ||
NgForOf, | ||
NgClass | ||
], | ||
templateUrl: './timeline-card.component.html', | ||
styleUrl: './timeline-card.component.scss' | ||
}) | ||
export class TimelineCardComponent { | ||
|
||
@Input() heading: string; | ||
@Input() subheading: string; | ||
@Input() content: string; | ||
@Input() bulletPoints?: string[]; | ||
|
||
@Input() type?: "light" | "dark" = "light"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters