[DEV] set image back

This commit is contained in:
Edouard DUPIN 2022-05-22 23:58:53 +02:00
parent 1f199e3496
commit 5695ed8552
4 changed files with 19 additions and 55 deletions

View File

@ -1,3 +1,4 @@
<div>
<canvas width="200" height="250" style="border:1px solid #d3d3d3;" id="imageCanvas" #imageCanvas></canvas>
<!--<canvas width="200" height="250" style="border:1px solid #d3d3d3;" id="imageCanvas" #imageCanvas></canvas>-->
<img src="{{cover}}"/>
</div>

View File

@ -1,52 +1,5 @@
.count-base {
height: 0px;
width: 100%;
right: 0px;
z-index: 12;
//position:flex;
text-align: right;
.count {
height: 30px;
//width: 30px;
font-size: 17px;
line-height: 30px;
overflow:hidden;
position:relative;
z-index: 12;
right: 2px;
top: 4px;
text-align: right;
padding: 5px 10px;
color: rgba(0, 0, 0, 1.0);
background: rgba(256, 256, 256, 0.3);
border: 1px solid;
border-color: rgba(256, 256, 256, 0.8);
border-radius: 15px;
}
}
.imgContainer-small {
text-align: center;
margin: 15px 0 0 0;
}
img.miniature-small {
width: 80px;
height: 80px;
//border-radius: 50%;
}
.title-small {
height: 60px;
font-size: 24px;
overflow:hidden;
vertical-align: middle;
}
.description-small {
height: 30px;
font-size: 12px;
overflow:hidden;
vertical-align: middle;
img {
max-height: 250px;
max-width: 200px;
}

View File

@ -3,8 +3,8 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input, ElementRef, ViewChild } from '@angular/core';
import { ModelResponseHttp } from '../../service/http-wrapper';
import { Injectable, Component, OnInit, Input } from '@angular/core';
//import { ModelResponseHttp } from '../../service/http-wrapper';
import { DataService } from '../../service/data';
@Component({
@ -16,7 +16,8 @@ import { DataService } from '../../service/data';
export class ElementDataImageComponent implements OnInit {
// input parameters
@Input() id:number = -1;
cover: string = '';
/*
imageCanvas:any;
@ViewChild('imageCanvas')
set mainDivEl(el: ElementRef) {
@ -24,11 +25,13 @@ export class ElementDataImageComponent implements OnInit {
this.imageCanvas = el.nativeElement;
}
}
*/
constructor(private dataService: DataService) {
}
ngOnInit() {
this.cover = this.dataService.getCoverThumbnailUrl(this.id);
/*
let canvas = this.imageCanvas.nativeElement;
let ctx = canvas.getContext("2d");
console.log(`Request thumnail for ---> ${this.id}`);
@ -51,5 +54,6 @@ export class ElementDataImageComponent implements OnInit {
//img.src = "../../assets/aCRF-PRV111_CLN-001 v1.4-images/aCRF-PRV111_CLN-001 v1.4-blank_0.jpg";
//ctx.drawImage(img, 10, 10, 250, 250);
*/
}
}

View File

@ -52,5 +52,11 @@ export class DataService {
});
}
getCoverUrl(coverId:number):any {
return this.http.createRESTCall(`data/${ coverId}`);
}
getCoverThumbnailUrl(coverId:number):any {
return this.http.createRESTCall(`data/thumbnail/${ coverId}`);
}
}