gl-w-frontend
Advanced tools
Comparing version 10.3.0 to 10.4.0
@@ -22,2 +22,6 @@ import { IFullScreenAlt, IFullScreenSrc, IMenuButton } from '../../menu/src'; | ||
export declare const BrowserViewPort: ViewPort; | ||
declare class Cursor { | ||
hideWhenIdle(): void; | ||
} | ||
export declare const BrowserCursor: Cursor; | ||
export {}; |
@@ -106,2 +106,26 @@ import screenfull from 'screenfull'; | ||
export const BrowserViewPort = new ViewPort(); | ||
class Cursor { | ||
hideWhenIdle() { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
let idleMouseTimer; | ||
let forceMouseHide = false; | ||
document.body.style.cursor = 'none'; | ||
document.body.addEventListener('mousemove', () => { | ||
if (forceMouseHide) { | ||
return; | ||
} | ||
document.body.style.cursor = ''; | ||
clearTimeout(idleMouseTimer); | ||
idleMouseTimer = setTimeout(() => { | ||
document.body.style.cursor = 'none'; | ||
forceMouseHide = true; | ||
setTimeout(() => { | ||
forceMouseHide = false; | ||
}, 200); | ||
}, 1000); | ||
}); | ||
}); | ||
} | ||
} | ||
export const BrowserCursor = new Cursor(); | ||
//# sourceMappingURL=core-services-browser.service.js.map |
@@ -22,2 +22,6 @@ import { IFullScreenAlt, IFullScreenSrc, IMenuButton } from '../../menu/src'; | ||
export declare const BrowserViewPort: ViewPort; | ||
declare class Cursor { | ||
hideWhenIdle(): void; | ||
} | ||
export declare const BrowserCursor: Cursor; | ||
export {}; |
@@ -106,2 +106,26 @@ import screenfull from 'screenfull'; | ||
export const BrowserViewPort = new ViewPort(); | ||
class Cursor { | ||
hideWhenIdle() { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
let idleMouseTimer; | ||
let forceMouseHide = false; | ||
document.body.style.cursor = 'none'; | ||
document.body.addEventListener('mousemove', () => { | ||
if (forceMouseHide) { | ||
return; | ||
} | ||
document.body.style.cursor = ''; | ||
clearTimeout(idleMouseTimer); | ||
idleMouseTimer = setTimeout(() => { | ||
document.body.style.cursor = 'none'; | ||
forceMouseHide = true; | ||
setTimeout(() => { | ||
forceMouseHide = false; | ||
}, 200); | ||
}, 1000); | ||
}); | ||
}); | ||
} | ||
} | ||
export const BrowserCursor = new Cursor(); | ||
//# sourceMappingURL=core-services-browser.service.js.map |
{ | ||
"name": "gl-w-frontend", | ||
"version": "10.3.0", | ||
"version": "10.4.0", | ||
"description": "Common code for using among web front-end development such as ES6+ and TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "lib/bundle.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
527014
8100