modif card resto

This commit is contained in:
Your Name 2022-02-16 12:35:13 +01:00
parent 59ca38b89b
commit ce1fe995b8
6 changed files with 55 additions and 29 deletions

View File

@ -1,7 +1,11 @@
<div class="container position-relative shadow p-0 mb-5 bg-body rounded rounded m-5 rounded-top "
style="width: 19rem;">
style="width: 21rem;">
<img class="card-img-top " src="assets/ImagesRestos/photo.jpg" alt="Card image cap">
<div class="rond position-absolute"><i class="heart far fa-heart"></i></div>
<div class="rond position-absolute">
<app-icon class="heart"
[iconName]="isLiked ? 'heart-fill' : 'heart'"
[iconColor]="'#e35d6a'"
(click)="onClickLike()"></app-icon></div>
<div class="card-body rounded-bottom">
<h3 class="titre-resto d-flex justify-content-center d-flex align-items-center" style="font-size: 24px;">
{{restaurant.nom }}</h3>
@ -26,27 +30,31 @@
</ul>
<span class="ps-3 mt-3 " style="font-size: 1.1em; color:#545454">5/5</span>
</div>
<div class="infos ps-1 pt-2" style="color:#545454">
<span class="categorie pe-4" style="font-style: italic;">Kebab</span>
<i class="fas fa-walking ps-2 pe-1" style="color:#a8a8a8"></i><span class="categorie pe-4"
style="font-weight: bold;">550m</span>
<i class="fas fa-euro-sign ps-2 pe-1" style="color:#a8a8a8"></i><span class="prix"
style="font-weight: bold;">5-10€</span>
</div>
<div class="trait-rouge pt-3"></div>
<a href="{{restaurant.website}}" target="blank" class="description pt-3 ps-1 pe-1 text-justify d-block" style="font-size:0.9em; color:#545454"><span
class="description pe-1" style="font-style: italic;font-weight: bold;">Site web</span>
</a>
<div class="trait-rouge pt-2 pb-0"></div>
<div class="trait-rouge pt-2 pb-2 "></div>
<i class="fas fa-walking pt-3 ps-2 pe-2" style="color:#a8a8a8"></i><span class="categorie pe-3"
style="font-weight: bold;">550m</span>
<i class="fas fa-euro-sign pt-3 ps-2 pe-2" style="color:#a8a8a8"></i><span class="prix pe-3"
style="font-weight: bold;">5-10€</span>
<a href="{{restaurant.website}}" target="blank" class="description " style=" color:#000000"><i class="bi bi-globe2 pt-3 ps-2 pe-2" style="color:#a8a8a8"></i><span
class="description " style="font-style: italic; ">Site web</span>
</a>
<div class="trait-rouge pt-2 pb-2"></div>
<div class="critere ps-1 pt-3">
<span class="sur-place pe-1" style="color:#545454">Sur place :</span>
<span class="sur-place pe-3" style="color:#545454">Sur place :</span>
<app-icon
[iconName]="restaurant.surPlace ? 'fas fa-check-square' : 'fas fa-times-circle ps-1 pt-1'"
[iconName]="restaurant.surPlace ? 'bi bi-check-square-fill' : 'bi bi-x-square-fill ps-2 pt-1 '"
[iconColor]="restaurant.surPlace ? '#4ECB71' : '#ED2F2F'"
></app-icon>
<span class="a-emporter ps-3 pe-1" style="color:#545454">A emporter :</span>
<span class="a-emporter pe-2 ps-4 " style="color:#545454">A emporter :</span>
<app-icon
[iconName]="restaurant.emporter ? 'fas fa-check-square' : 'fas fa-times-circle ps-1 pt-1'"
[iconName]="restaurant.emporter ? 'bi bi-check-square-fill' : 'bi bi-x-square-fill ps-2 pt-1'"
[iconColor]="restaurant.emporter ? '#4ECB71' : '#ED2F2F'"
></app-icon>
</div>
@ -54,7 +62,7 @@
<div class="critere d-flex justify-content-center ps-1 pt-3 pb-3">
<span class="acces-pmr pe-1" style="color:#545454">Accès PMR :</span>
<app-icon
[iconName]="restaurant.accesPMR ? 'fas fa-check-square' : 'fas fa-times-circle ps-1 pt-1'"
[iconName]="restaurant.accesPMR ? 'bi bi-check-square-fill' : 'bi bi-x-square-fill ps-1 pt-1'"
[iconColor]="restaurant.accesPMR ? '#4ECB71' : '#ED2F2F'"
></app-icon>
</div>

View File

@ -1,17 +1,22 @@
.rond{
padding: 0.7em;
padding: 1em;
background-color: rgb(255, 255, 255);
top: 1em;
right: 1em;
border-radius: 50%;
width: 50px;
height: 50px;
}
.heart{
display: flex;
font-size: 1.6em;
padding: 0;
margin:0;
color: #FF2048;
position: absolute;
top: 7px;
left: 13px;
font-size: 1.5em;
}
.titre-resto{
@ -37,10 +42,10 @@
}
.ps-5 {
padding-left: 5.4rem !important;
padding-left: 6.4rem !important;
}
.pe-5 {
padding-right: 5rem !important;
padding-right: 6rem !important;
}

View File

@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component,EventEmitter, Input, Output, OnInit } from '@angular/core';
@Component({
selector: 'app-card-resto',
@ -7,8 +7,11 @@ import { Component, Input, OnInit } from '@angular/core';
})
export class CardRestoComponent implements OnInit {
@Input() restaurant : any ;
@Input() restaurant : any ;
@Input() likeResto: any;
@Output() clickLike = new EventEmitter<boolean>();
isLiked : boolean = false;
constructor() { }
ngOnInit(): void {
@ -16,6 +19,11 @@ export class CardRestoComponent implements OnInit {
console.log(this.restaurant);
}
onClickLike() {
console.log('click');
this.isLiked = !this.isLiked;
this.clickLike.emit(this.isLiked);
}

View File

@ -1,3 +1,4 @@
<i class="{{iconName}}"
<i class="bi-{{iconName}}"
[ngStyle]="{'font-size.rem': iconSize, 'color': iconColor}"></i>

View File

@ -30,5 +30,8 @@ export class HomePageComponent implements OnInit {
}
onEventLike(isLiked : boolean) {
this.apiBackService.restoLiked$.next(isLiked);
}
}

View File

@ -9,6 +9,7 @@ import { environment } from 'src/environments/environment';
export class ApiBackService {
public restoByCat : Observable<any[]> = of([]);
restoLiked$ = new Subject<any>();
constructor(private httpClient: HttpClient) {
}