mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-09 02:32:50 +00:00
webOS: Fixed emulator resolution check
This commit is contained in:
parent
5061c095f3
commit
842eb1cd26
1 changed files with 29 additions and 19 deletions
|
@ -89,29 +89,39 @@ export class ServiceManager {
|
||||||
|
|
||||||
// CSS media queries do not work on older webOS versions...
|
// CSS media queries do not work on older webOS versions...
|
||||||
export function initializeWindowSizeStylesheet() {
|
export function initializeWindowSizeStylesheet() {
|
||||||
const resolution = sessionStorage.getItem('resolution');
|
if (window.innerWidth !== 0 && window.innerHeight !== 0) {
|
||||||
|
if (window.innerWidth >= 1920 && window.innerHeight >= 1080) {
|
||||||
if (resolution) {
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1920x1080.css" />');
|
||||||
window.onload = () => {
|
}
|
||||||
if (resolution == '1920x1080') {
|
else {
|
||||||
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1920x1080.css" />');
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1280x720.css" />');
|
||||||
}
|
|
||||||
else {
|
|
||||||
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1280x720.css" />');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.onresize = () => {
|
const resolution = sessionStorage.getItem('resolution');
|
||||||
if (window.innerWidth >= 1920 && window.innerHeight >= 1080) {
|
|
||||||
sessionStorage.setItem('resolution', '1920x1080');
|
if (resolution) {
|
||||||
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1920x1080.css" />');
|
window.onload = () => {
|
||||||
|
if (resolution == '1920x1080') {
|
||||||
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1920x1080.css" />');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1280x720.css" />');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
sessionStorage.setItem('resolution', '1280x720');
|
else {
|
||||||
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1280x720.css" />');
|
window.onresize = () => {
|
||||||
}
|
if (window.innerWidth >= 1920 && window.innerHeight >= 1080) {
|
||||||
};
|
sessionStorage.setItem('resolution', '1920x1080');
|
||||||
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1920x1080.css" />');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sessionStorage.setItem('resolution', '1280x720');
|
||||||
|
document.head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="./1280x720.css" />');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue