-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added option to hide cursor in fullscreen mode #536
Conversation
@@ -144,7 +144,7 @@ | |||
right around the corner of this tag ;) | |||
|
|||
--> | |||
<div id="impress"> | |||
<div id="impress" data-hide-mouse-after="3000"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi sclausen
Good idea and easy to implement.
IMO this feature needn't be optional. (Not adding an option benefits the goal of simplicity.) I don't think anyone will miss the pointer if we just hide it always after 3 seconds of inactivity. (I can see that someone would want to leave the mouse pointer pointing at something on a slide. But that should be rare. You'd usually move the pointer to point at something, but that would still work. Also, it is more common to use laser pointers, etc.)
This commit adds a generic mouse-timeout plugin and removes the same functionality from inside the toolbar plugin. As a result, we have less code and less CSS needed on the user side as well. Feel pretty smug about myself now :-) Although this implementation is different and more generic, the suggestion to add ability to hide mouse cursor came from a pull request by Sebastian Clausen (@sclausen): impress#536 Description from README: After 3 seconds of mouse inactivity, add the css class `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the class. The use case for this plugin is to use CSS to hide elements from the screen and only make them visible when the mouse is moved. Examples where this might be used are: the toolbar from the toolbar plugin, and the mouse cursor itself. Example CSS body.impress-mouse-timeout { cursor: none; } body.impress-mouse-timeout div#impress-toolbar { display: none; }
FYI, based on this idea, I've implemented a more generic The README has the details, let me know what you think. Compared to this PR:
|
@henrikingo your mouse-timeout-hide-stuff plugin seems to be superior and we should dump my PR in favour of yours. |
@sclausen We are still tracking this in the main impress repo. We expect to at least provide a proper API to make it work without having to force the developer to rely on the plugin hacks that impress.js exposes right now, but first we need a more efficient test coverage. Sorry that this is taking some time and we encourage to use the mentioned fork in the meantime if it fixes your use case 👍 |
This commit adds a generic mouse-timeout plugin. (Same code was originally part of toolbar plugin, but is now general purpose and available to user to apply any CSS to it.) Although this implementation is different and more generic, the suggestion to add ability to hide mouse cursor came from a pull request by Sebastian Clausen (@sclausen): impress#536 The functionality is simple: After 3 seconds of mouse inactivity, add the css class `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the class. A user will then use (or not) his own CSS to hide whatever he wants to hide after 3 seconds of mouse inactivity.
This commit adds a generic mouse-timeout plugin. (Same code was originally part of toolbar plugin, but is now general purpose and available to user to apply any CSS to it.) Although this implementation is different and more generic, the suggestion to add ability to hide mouse cursor came from a pull request by Sebastian Clausen (@sclausen): #536 The functionality is simple: After 3 seconds of mouse inactivity, add the css class `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the class. A user will then use (or not) his own CSS to hide whatever he wants to hide after 3 seconds of mouse inactivity.
mouse-timeout plugin was merged to master |
making a new pull request as a replacement for #388 based on master instead of dev.