mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-09 08:32:48 +00:00
18 lines
330 B
TypeScript
18 lines
330 B
TypeScript
const getScreenWidth = () => {
|
|
const w = window,
|
|
d = document,
|
|
e = d.documentElement,
|
|
g = d.getElementsByTagName('body')[0];
|
|
|
|
return w.innerWidth || e.clientWidth || g.clientWidth;
|
|
};
|
|
|
|
const isMobileScreen = () => {
|
|
return getScreenWidth() < 520;
|
|
};
|
|
|
|
export const Util = {
|
|
getScreenWidth,
|
|
isMobileScreen,
|
|
};
|