blob: 470c49cdd171aa84d1a56ddf2c38a64b96eeb74e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/**
* Check the size of the current viewport.
* @returns {Boolean} True if viewport lower than 1200px; false otherwise.
*/
function isSmallVw() {
return window.innerWidth < 1200;
}
/**
* Check if /assets/styles.js exists (Webpack dev mode).
* @returns {Boolean} True if style.js exists ; false otherwise.
*/
async function isStyleJsExists() {
const filePath = 'assets/js/style.js';
const response = await fetch(filePath);
return response.status === 200;
}
export { isSmallVw, isStyleJsExists };
|