mapcomplete/UI/Base/Img.ts
2021-01-06 02:21:50 +01:00

19 lines
451 B
TypeScript

import Constants from "../../Models/Constants";
import {Utils} from "../../Utils";
export default class Img {
public static runningFromConsole = false;
static AsData(source:string){
if(Utils.runningFromConsole){
return source;
}
return `data:image/svg+xml;base64,${(btoa(source))}`;
}
static AsImageElement(source: string): string{
return `<img src="${Img.AsData(source)}">`;
}
}