icebear0828
refactor: migrate electron from branch to npm workspace
178e38e
raw
history blame
423 Bytes
export type Platform = "mac" | "win";
export function getPlatform(): Platform {
const ua = navigator.userAgent.toLowerCase();
if (ua.includes("macintosh") || ua.includes("mac os")) return "mac";
return "win";
}
/** Apply platform class to <html> element on startup */
export function applyPlatformClass(): void {
const platform = getPlatform();
document.documentElement.classList.add(`platform-${platform}`);
}