mapcomplete/UI/Base/Img.ts
Tobias 871f512c0d Move border custom css to Tailwind Class
- migrate custom css to Tailwind class
- introduce class-parameter for `AsImageElement`
- migrate width of login button to Tailwind class
2021-01-20 21:48:47 +01:00

19 lines
490 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, css_class: string): string{
return `<img class="${css_class}" alt="" src="${Img.AsData(source)}">`;
}
}