@intuitionrobotics/thunderstorm
Version:
28 lines • 984 B
JavaScript
import { Module } from "@intuitionrobotics/ts-common";
class ThunderstormModule_Class extends Module {
constructor() {
super("ThunderstormModule");
this.setDefaultConfig({ appName: "Thunderstorm-WebApp" });
}
init() {
this.setAppName(this.config.appName);
this.setChromeThemeColor(this.config.themeColor);
}
setAppName(appName) {
document.title = appName;
}
setChromeThemeColor(themeColor) {
let themeTag = document.head.querySelector('meta[name="theme-color"]');
if (!themeTag) {
themeTag = document.createElement('meta');
themeTag.name = "theme-color";
document.getElementsByTagName('head')[0].appendChild(themeTag);
}
themeTag.setAttribute('content', themeColor);
}
getAppName() {
return this.config.appName;
}
}
export const ThunderstormModule = new ThunderstormModule_Class();
//# sourceMappingURL=ThunderstormModule.js.map