remove jquery all together

This commit is contained in:
Aaron Qian 2023-01-04 18:12:39 -08:00
parent b0f5b0b059
commit 8580a1f463
No known key found for this signature in database
GPG key ID: BF1A987C395B5B0E
61 changed files with 4113 additions and 684 deletions

View file

@ -1,36 +1,36 @@
let deviceState = {
isMobile: false,
isTablet: false,
isLaptop: false,
};
isLaptop: false
}
function detectDeviceState() {
function detectDeviceState () {
if (window.innerWidth <= 425) {
deviceState = {
isMobile: true,
isTablet: false,
isLaptop: false,
};
isLaptop: false
}
} else if (window.innerWidth <= 768) {
deviceState = {
isMobile: false,
isTablet: true,
isLaptop: false,
};
isLaptop: false
}
} else {
deviceState = {
isMobile: false,
isTablet: false,
isLaptop: true,
};
isLaptop: true
}
}
}
detectDeviceState();
window.addEventListener('resize', detectDeviceState);
detectDeviceState()
window.addEventListener('resize', detectDeviceState)
// returns a copy of the device state
// so other parts of code can't override this.
export function getDeviceState() {
return { ... deviceState };
export function getDeviceState () {
return { ...deviceState }
}