feat: worked on some stuff

This commit is contained in:
Nick 2024-12-07 13:24:32 -06:00
parent f898d204d0
commit cb51b17c08

View file

@ -3,11 +3,34 @@
// The value returned here will be passed as flags
// into your `Shared.init` function.
export const flags = ({ env }) => {
// Log the environment parameter
console.log('Environment:', env);
// Log the window's inner height and width
console.log('Window Height:', window.innerHeight);
console.log('Window Width:', window.innerWidth);
// Determine the device type based on the user agent
const userAgent = navigator.userAgent.toLowerCase();
let deviceType = 'Unknown Device';
if (/mobile|android|iphone|ipad|ipod|windows phone/i.test(userAgent)) {
deviceType = 'Mobile Device';
} else if (/tablet|ipad/i.test(userAgent)) {
deviceType = 'Tablet';
} else if (/desktop|laptop|windows|mac|linux/i.test(userAgent)) {
deviceType = 'Desktop or Laptop';
}
// Log the detected device type
console.log('Device Type:', deviceType);
return {
height: window.innerHeight,
width: window.innerWidth
}
}
};
};
// This is called AFTER your Elm app starts up
//