More refactoring!

This commit is contained in:
Pieter Vander Vennet 2021-01-03 00:19:42 +01:00
parent b2c234b51d
commit 6ac8ec84e4
22 changed files with 170 additions and 158 deletions

16
UI/Base/Img.ts Normal file
View file

@ -0,0 +1,16 @@
export default class Img {
public static runningFromConsole = false;
static AsData(source:string){
if(this.runningFromConsole){
return source;
}
return `data:image/svg+xml;base64,${(btoa(source))}`;
}
static AsImageElement(source: string): string{
return `<img src="${Img.AsData(source)}">`;
}
}