Skip to content

Commit

Permalink
card component finished
Browse files Browse the repository at this point in the history
  • Loading branch information
Bammez committed Feb 20, 2024
1 parent 7f87658 commit 82315ff
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
39 changes: 36 additions & 3 deletions projects/ngx-cream-lib/src/lib/card/card.component.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
.card {
box-shadow: 0px 3px 6px #00000029;
border-radius: 8px;
padding: 1rem;
background-color: white;
max-width: 300px;
}

.card-content {
padding: 1rem;
}

h2 {
margin-bottom: 0.5rem;
}
margin-bottom: 1rem;
}

a.link-button {
position: relative;
display: inline-flex;
align-items: center;
gap: 1em;
width: fit-content;
text-decoration: none;
color: white;
background-color: rgb(92, 92, 173);
padding: 0.75rem 1.5rem;
border-radius: 2em;
margin-top: 1rem;
}

a.link-button:hover {
background-color: rgb(7, 7, 158);
}

.picture {
display: flex;
justify-content: center;
width: 100%;
}

.picture img {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
15 changes: 13 additions & 2 deletions projects/ngx-cream-lib/src/lib/card/card.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<div class="card">
<h2>{{ title }}</h2>
<p><ng-content></ng-content></p>
<p class="picture">
<img [src]="'../../../../../assets/img/' + imageName" alt="">
</p>
<div class="card-content">
<!-- <c3m-h [titleLevel]="titleLevel">
{{ title }}
</c3m-h> -->
<h2>
{{ title }}
</h2>
<p><ng-content></ng-content></p>
<p><a class="link-button" [attr.href]="linkUrl">{{labelButton}}</a></p>
</div>
</div>
4 changes: 4 additions & 0 deletions projects/ngx-cream-lib/src/lib/card/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ import { Component, Input } from '@angular/core';
})
export class CardComponent {
@Input() title: string = '';
@Input() titleLevel = '3';
@Input() imageName = '';
@Input() linkUrl = "";
@Input() labelButton = "";
}
2 changes: 1 addition & 1 deletion src/app/pages/card-page/card-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h3>Card component</h3>

<c3m-tabs class="block-style" label="Demo and Code">
<c3m-tab-panel class="block-style" tabTitle="Demo" [isActive]="true">
<c3m-card title="Card Title">
<c3m-card title="Card Title" titleLevel="2" imageName="illu.jpg" linkUrl="portal/card" labelButton="Découvrir">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus natus quam maxime.
Repellat atque animi consequatur fugiat perferendis dicta cumque maiores minus rem facilis,
ex unde quo laborum sunt cupiditate.
Expand Down
Binary file added src/assets/img/illu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 82315ff

Please sign in to comment.