2020-06-27 03:06:51 +02:00
|
|
|
export class Img {
|
2020-08-08 17:50:43 +02:00
|
|
|
|
2020-11-06 03:17:27 +01:00
|
|
|
public static runningFromConsole = false;
|
|
|
|
|
2020-11-05 12:28:02 +01:00
|
|
|
static AsData(source:string){
|
2020-11-06 03:17:27 +01:00
|
|
|
if(this.runningFromConsole){
|
|
|
|
return source;
|
|
|
|
}
|
2020-11-05 12:28:02 +01:00
|
|
|
return `data:image/svg+xml;base64,${(btoa(source))}`;
|
|
|
|
}
|
|
|
|
|
2020-08-08 17:50:43 +02:00
|
|
|
static AsImageElement(source: string): string{
|
2020-11-05 12:28:02 +01:00
|
|
|
return `<img src="${Img.AsData(source)}">`;
|
|
|
|
}
|
2020-07-29 15:05:19 +02:00
|
|
|
static readonly checkmark = `<svg width="26" height="18" viewBox="0 0 26 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 7.28571L10.8261 15L23 3" stroke="black" stroke-width="4" stroke-linejoin="round"/></svg>`;
|
|
|
|
static readonly no_checkmark = `<svg width="26" height="18" viewBox="0 0 26 18" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`;
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|
|
|
|
|