1
1
mirror of https://github.com/neosubhamoy/neodlp-website.git synced 2026-02-04 13:22:23 +05:30

(chore): initial MVP release

This commit is contained in:
2025-05-13 09:49:26 +05:30
Verified
commit 76cf1d3d41
46 changed files with 15065 additions and 0 deletions

30
src/lib/utils.ts Normal file
View File

@@ -0,0 +1,30 @@
import type { OS } from "@/types/os";
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function getOS(): OS {
const userAgent = window.navigator.userAgent;
const platform = (window.navigator as any)?.userAgentData?.platform || window.navigator.platform;
const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K', 'macOS'];
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
if (macosPlatforms.includes(platform)) {
return 'macos';
} else if (iosPlatforms.includes(platform)) {
return 'ios';
} else if (windowsPlatforms.includes(platform)) {
return 'windows';
} else if (/Android/.test(userAgent)) {
return 'android';
} else if (/Linux/.test(platform)) {
return 'linux';
} else {
return 'unknown';
}
}