@shower/core
Advanced tools
Comparing version 3.2.0 to 3.3.0
/** | ||
* Core for Shower HTML presentation engine | ||
* @shower/core v3.1.0, https://github.com/shower/core | ||
* @shower/core v3.2.0, https://github.com/shower/core | ||
* @copyright 2010–2021 Vadim Makeev, https://pepelsbey.net | ||
@@ -39,2 +39,4 @@ * @license MIT | ||
listModeClass: 'list', | ||
mouseHiddenClass: 'pointless', | ||
mouseInactivityTimeout: 5000, | ||
@@ -600,2 +602,44 @@ slideSelector: '.slide', | ||
var mouse = (shower) => { | ||
const { mouseHiddenClass, mouseInactivityTimeout } = shower.options; | ||
let hideMouseTimeoutId = null; | ||
const cleanUp = () => { | ||
shower.container.classList.remove(mouseHiddenClass); | ||
clearTimeout(hideMouseTimeoutId); | ||
hideMouseTimeoutId = null; | ||
}; | ||
const hideMouseIfInactive = () => { | ||
if (hideMouseTimeoutId !== null) { | ||
cleanUp(); | ||
} | ||
hideMouseTimeoutId = setTimeout(() => { | ||
shower.container.classList.add(mouseHiddenClass); | ||
}, mouseInactivityTimeout); | ||
}; | ||
const initHideMouseIfInactiveModule = () => { | ||
shower.container.addEventListener('mousemove', hideMouseIfInactive); | ||
}; | ||
const destroyHideMouseIfInactiveModule = () => { | ||
shower.container.removeEventListener('mousemove', hideMouseIfInactive); | ||
cleanUp(); | ||
}; | ||
const handleModeChange = () => { | ||
if (shower.isFullMode) { | ||
initHideMouseIfInactiveModule(); | ||
} else { | ||
destroyHideMouseIfInactiveModule(); | ||
} | ||
}; | ||
shower.addEventListener('start', handleModeChange); | ||
shower.addEventListener('modechange', handleModeChange); | ||
}; | ||
var installModules = (shower) => { | ||
@@ -611,2 +655,3 @@ a11y(shower); | ||
touch(shower); | ||
mouse(shower); | ||
@@ -794,2 +839,2 @@ // maintains invariant: active slide always exists in `full` mode | ||
}()); | ||
})(); |
@@ -7,2 +7,4 @@ export default { | ||
listModeClass: 'list', | ||
mouseHiddenClass: 'pointless', | ||
mouseInactivityTimeout: 5000, | ||
@@ -9,0 +11,0 @@ slideSelector: '.slide', |
@@ -10,2 +10,3 @@ import a11y from './a11y'; | ||
import touch from './touch'; | ||
import mouse from './mouse'; | ||
@@ -22,2 +23,3 @@ export default (shower) => { | ||
touch(shower); | ||
mouse(shower); | ||
@@ -24,0 +26,0 @@ // maintains invariant: active slide always exists in `full` mode |
{ | ||
"name": "@shower/core", | ||
"description": "Core for Shower HTML presentation engine", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"publishConfig": { | ||
@@ -33,4 +33,4 @@ "access": "public" | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
"eslint-plugin-prettier": "^3.4.1", | ||
"husky": "^4.3.8", | ||
@@ -42,3 +42,3 @@ "lint-staged": "^10.5.4", | ||
"puppeteer": "^3.3.0", | ||
"rollup": "^2.52.2", | ||
"rollup": "^2.58.0", | ||
"sauce-connect-launcher": "^1.3.2", | ||
@@ -45,0 +45,0 @@ "serve": "^11.3.2", |
@@ -1,2 +0,2 @@ | ||
# Core of Shower [![Build Status](https://travis-ci.org/shower/core.svg?branch=master)](https://travis-ci.org/shower/core) | ||
# Core of Shower [![Build Status](https://travis-ci.org/shower/core.svg?branch=main)](https://travis-ci.org/shower/core) | ||
@@ -3,0 +3,0 @@ Core of the [Shower](https://github.com/shower/shower) presentation engine. Doesn’t include themes. [See it in action](https://shwr.me). Follow [@shower_me](https://twitter.com/shower_me) for support and updates, [file an issue] if you have any. |
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
52440
22
1378