Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

sclausen
Copy link

making a new pull request as a replacement for #388 based on master instead of dev.

@@ -144,7 +144,7 @@
right around the corner of this tag ;)

-->
<div id="impress">
<div id="impress" data-hide-mouse-after="3000">
Copy link
Member

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.)

henrikingo added a commit to henrikingo/impress.js that referenced this pull request Aug 7, 2016
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;
    }
@henrikingo
Copy link
Member

FYI, based on this idea, I've implemented a more generic mouse-timeout plugin in my repo. It supports hiding mouse cursor, but also hiding other things.

The README has the details, let me know what you think.

Compared to this PR:

  • The feature is still optional. It now depends on user writing CSS for the body.impress-mouse-timeout selector. It does not, however, add any data-* attribute.
  • I omitted the check for whether presentation is in full-screen mode, since IMO hiding the mouse cursor is ok to do also in a normal window. However, following the same style, it would be easy to add a separate is-fullscreen plugin, that would set a body.impress-is-fullscreen class when the window is in fullscreen mode.

@sclausen
Copy link
Author

sclausen commented Aug 8, 2016

@henrikingo your mouse-timeout-hide-stuff plugin seems to be superior and we should dump my PR in favour of yours.

@sclausen sclausen closed this Aug 8, 2016
@FagnerMartinsBrack
Copy link
Member

FagnerMartinsBrack commented Aug 8, 2016

@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 👍

henrikingo added a commit to henrikingo/impress.js that referenced this pull request Oct 23, 2017
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.
henrikingo added a commit that referenced this pull request Oct 30, 2017
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.
@henrikingo
Copy link
Member

mouse-timeout plugin was merged to master

@henrikingo henrikingo closed this Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants