-
Notifications
You must be signed in to change notification settings - Fork 33
/
utils.ts
53 lines (45 loc) · 1.38 KB
/
utils.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export const colors = [
"slate",
"red",
"orange",
"amber",
"yellow",
"lime",
"green",
"teal",
"cyan",
"blue",
"indigo",
"violet",
"purple",
"fuchsia",
"pink",
"rose",
]
export const shades = ["300", "400", "500", "600", "700", "800", "900"]
function getRandom(array: string[]) {
return array[Math.floor(Math.random() * array.length)]
}
export function generateRandomGradient() {
const fromColor = getRandom(colors)
const toColor = getRandom(colors)
const fromShade = getRandom(shades)
const toShade = getRandom(shades)
return [`from-${fromColor}-${fromShade}`, `to-${toColor}-${toShade}`]
}
export const localExecutablePath =
process.platform === "win32"
? "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
: process.platform === "linux"
? "/usr/bin/google-chrome"
: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
export const remoteExecutablePath =
"https://github.com/Sparticuz/chromium/releases/download/v123.0.1/chromium-v123.0.1-pack.tar"
export const isDev = process.env.NODE_ENV === "development"
export const userAgent =
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36"