mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 00:59:29 -07:00
Add comprehensive responsive scanline scaling system with anti-aliasing
- Attempt pixel-perfect scanline rendering for scaled displays and zoom scenarios - Implement dynamic scanline thickness calculation to prevent sub-pixel rendering issues - Add enhanced kiosk detection via isKioskLike for better fullscreen optimization - Optimize scanlines for specific kiosk resolutions (1024x768, 1023x767) - Add responsive SCSS media queries for different display densities - Include extensive debugging utilities for scanline troubleshooting - Improve noSleep error handling with proper promise rejection handling - Update to modern fullscreen API method names - Add async/await error handling for fullscreen requests - Trigger resize after fullscreen engagement to apply optimal scaling
This commit is contained in:
@@ -7,12 +7,19 @@ const noSleep = (enable = false) => {
|
||||
// get a nosleep controller
|
||||
if (!noSleep.controller) noSleep.controller = new NoSleep();
|
||||
// don't call anything if the states match
|
||||
if (wakeLock === enable) return false;
|
||||
if (wakeLock === enable) return Promise.resolve(false);
|
||||
// store the value
|
||||
wakeLock = enable;
|
||||
// call the function
|
||||
if (enable) return noSleep.controller.enable();
|
||||
return noSleep.controller.disable();
|
||||
if (enable) {
|
||||
return noSleep.controller.enable().catch((error) => {
|
||||
// Handle wake lock request failures gracefully
|
||||
console.warn('Wake lock request failed:', error.message);
|
||||
wakeLock = false;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return Promise.resolve(noSleep.controller.disable());
|
||||
};
|
||||
|
||||
export default noSleep;
|
||||
|
||||
Reference in New Issue
Block a user